01: /*
02:
03: Derby - Class org.apache.derbyTesting.functionTests.store.LogChecksumRecovery1
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to You under the Apache License, Version 2.0
09: (the "License"); you may not use this file except in compliance with
10: the License. You may obtain a copy of the License at
11:
12: http://www.apache.org/licenses/LICENSE-2.0
13:
14: Unless required by applicable law or agreed to in writing, software
15: distributed under the License is distributed on an "AS IS" BASIS,
16: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: See the License for the specific language governing permissions and
18: limitations under the License.
19:
20: */
21:
22: package org.apache.derbyTesting.functionTests.tests.store;
23:
24: import java.sql.Connection;
25: import java.sql.SQLException;
26: import java.util.zip.CRC32;
27: import org.apache.derby.tools.ij;
28:
29: /*
30: * Purpose of this class is to test the database recovery of the
31: * updates statements executed in LogChecksumRecovery.java.
32: * This test should be run after the store/LogChecksumRecovery.java.
33: *
34: * @author <a href="mailto:suresh.thalamati@gmail.com">Suresh Thalamati</a>
35: * @version 1.0
36: * @see LogChecksumSetup
37: * @see LogChecksumRecovery
38: */
39:
40: public class LogChecksumRecovery1 extends LogChecksumSetup {
41:
42: LogChecksumRecovery1() {
43: super ();
44: }
45:
46: private void runTest(Connection conn) throws SQLException {
47: logMessage("Begin LogCheckumRecovery1 Test");
48: verifyData(conn, 10);
49: logMessage("End LogCheckumRecovery1 Test");
50: }
51:
52: public static void main(String[] argv) throws Throwable {
53:
54: LogChecksumRecovery1 lctest = new LogChecksumRecovery1();
55: ij.getPropertyArg(argv);
56: Connection conn = ij.startJBMS();
57: conn.setAutoCommit(false);
58:
59: try {
60: lctest.runTest(conn);
61: } catch (SQLException sqle) {
62: org.apache.derby.tools.JDBCDisplayUtil.ShowSQLException(
63: System.out, sqle);
64: sqle.printStackTrace(System.out);
65: }
66: }
67: }
|