KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derbyTesting > functionTests > tests > store > LogChecksumRecovery1


1 /*
2
3    Derby - Class org.apache.derbyTesting.functionTests.store.LogChecksumRecovery1
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to You under the Apache License, Version 2.0
9    (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 import java.sql.Connection JavaDoc;
24 import java.sql.SQLException JavaDoc;
25 import java.util.zip.CRC32 JavaDoc;
26 import org.apache.derby.tools.ij;
27
28 /*
29  * Purpose of this class is to test the database recovery of the
30  * updates statements executed in LogChecksumRecovery.java.
31  * This test should be run after the store/LogChecksumRecovery.java.
32  *
33  * @author <a HREF="mailto:suresh.thalamati@gmail.com">Suresh Thalamati</a>
34  * @version 1.0
35  * @see LogChecksumSetup
36  * @see LogChecksumRecovery
37  */

38
39 public class LogChecksumRecovery1 extends LogChecksumSetup {
40
41     LogChecksumRecovery1() {
42         super();
43     }
44     
45     private void runTest(Connection JavaDoc conn) throws SQLException JavaDoc
46     {
47         logMessage("Begin LogCheckumRecovery1 Test");
48         verifyData(conn, 10);
49         logMessage("End LogCheckumRecovery1 Test");
50     }
51     
52     public static void main(String JavaDoc[] argv)
53         throws Throwable JavaDoc
54     {
55         
56         LogChecksumRecovery1 lctest = new LogChecksumRecovery1();
57         ij.getPropertyArg(argv);
58         Connection JavaDoc conn = ij.startJBMS();
59         conn.setAutoCommit(false);
60
61         try {
62             lctest.runTest(conn);
63         }
64         catch (SQLException JavaDoc sqle) {
65             org.apache.derby.tools.JDBCDisplayUtil.ShowSQLException(
66                 System.out, sqle);
67             sqle.printStackTrace(System.out);
68         }
69     }
70 }
71
72
73
74
75
76
77
78
79
80
Popular Tags