01: /*
02:
03: Derby - Class org.apache.derbyTesting.functionTests.harness.procedure
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 org.apache.derby.iapi.db.OnlineCompress;
25:
26: import org.apache.derby.iapi.services.sanity.SanityManager;
27:
28: import java.sql.CallableStatement;
29: import java.sql.Connection;
30: import java.sql.PreparedStatement;
31: import java.sql.ResultSet;
32: import java.sql.SQLException;
33: import java.sql.Statement;
34:
35: import org.apache.derby.tools.ij;
36:
37: public class oc_rec1 extends OnlineCompressTest {
38:
39: public oc_rec1() {
40: }
41:
42: /**
43: * setup for restart recovery test.
44: * <p>
45: * Do setup to test restart recovery of online compress. Real work
46: * is done in next test oc_rec2 which will run restart recovery on
47: * the work done in this test.
48: *
49: **/
50: private void test1(Connection conn, String test_name,
51: String table_name) throws SQLException {
52: beginTest(conn, test_name);
53: createAndLoadTable(conn, true, table_name, 5000, 0);
54: executeQuery(conn, "delete from " + table_name, true);
55: callCompress(conn, "APP", table_name, true, true, true, true);
56: endTest(conn, test_name);
57: }
58:
59: public void testList(Connection conn) throws SQLException {
60: test1(conn, "test1", "TEST1");
61: }
62:
63: public static void main(String[] argv) throws Throwable {
64: oc_rec1 test = new oc_rec1();
65:
66: ij.getPropertyArg(argv);
67: Connection conn = ij.startJBMS();
68: conn.setAutoCommit(false);
69:
70: try {
71: test.testList(conn);
72: } catch (SQLException sqle) {
73: org.apache.derby.tools.JDBCDisplayUtil.ShowSQLException(
74: System.out, sqle);
75: sqle.printStackTrace(System.out);
76: }
77: }
78: }
|