db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r555806 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests: lang/FullCollationTests.java upgradeTests/BasicSetup.java upgradeTests/Changes10_3.java
Date Thu, 12 Jul 2007 22:52:10 GMT
Author: kmarsden
Date: Thu Jul 12 15:52:09 2007
New Revision: 555806

URL: http://svn.apache.org/viewvc?view=rev&rev=555806
Log:
DERBY-2931 move test case to BasicSetup


Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/FullCollationTests.java
Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_3.java

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/FullCollationTests.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/FullCollationTests.java?view=auto&rev=555806
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/FullCollationTests.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/FullCollationTests.java
Thu Jul 12 15:52:09 2007
@@ -0,0 +1,55 @@
+/**
+ *  Derby - Class org.apache.derbyTesting.functionTests.tests.lang.CollationTest
+ *  
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.derbyTesting.functionTests.tests.lang;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.derbyTesting.junit.Decorator;
+
+
+public class FullCollationTests extends CollationTest {
+    
+    public FullCollationTests(String name) {
+        super(name);
+       
+    }
+
+    
+    /**
+     * Return a suite that uses a single use database with
+     * a primary fixture from this test plus all tests
+     * @param locale Locale to use for the database
+     * @param baseFixture Base fixture from this test.
+     * @return suite of tests to run for the given locale
+     */
+    public static Test suite() 
+    {
+        TestSuite suite = new TestSuite("FullCollationTests:territory=" +"no_NO");
+        suite.addTest(new CollationTest("testNorwayCollation"));
+        suite.addTest(org.apache.derbyTesting.functionTests.tests.lang._Suite.suite());
+        suite.addTest(org.apache.derbyTesting.functionTests.tests.jdbcapi._Suite.suite());
+        suite.addTest(org.apache.derbyTesting.functionTests.tests.store._Suite.suite());
+        return Decorator.territoryCollatedDatabase(suite, "no_NO");
+    }
+
+}

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java?view=diff&rev=555806&r1=555805&r2=555806
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
Thu Jul 12 15:52:09 2007
@@ -22,10 +22,13 @@
 
 import java.sql.DatabaseMetaData;
 import java.sql.PreparedStatement;
+import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
 
 import org.apache.derby.iapi.services.io.DerbyIOException;
+import org.apache.derbyTesting.junit.JDBC;
+import org.apache.derbyTesting.junit.TestConfiguration;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -128,6 +131,58 @@
         ps.close();
         commit();
     }
+
+    /**
+     * Make sure table created in soft upgrade mode can be 
+     * accessed after shutdown.  DERBY-2931
+     * @throws SQLException
+     */
+    public void testCreateTable() throws SQLException
+    {
+        
+        Statement stmt = createStatement();
+        try {
+            stmt.executeUpdate("DROP table t");
+        } catch (SQLException se) {
+            // ignore table does not exist error on
+            // on drop table.
+            assertSQLState("42Y55",se ); 
+        }
+        stmt.executeUpdate("CREATE TABLE T (I INT)");
+        TestConfiguration.getCurrent().shutdownDatabase();
+        stmt = createStatement();
+        ResultSet rs = stmt.executeQuery("SELECT * from t");
+        JDBC.assertEmpty(rs);  
+        rs.close();
+    }
+    
+
+    /**
+     * Test table with index can be read after
+     * shutdown DERBY-2931
+     * @throws SQLException
+     */
+    public void testIndex() throws SQLException 
+    {
+        Statement stmt = createStatement();
+        try {
+            stmt.executeUpdate("DROP table ti");
+        } catch (SQLException se) {
+            // ignore table does not exist error on
+            // on drop table.
+            assertSQLState("42Y55",se ); 
+        }
+        stmt.executeUpdate("CREATE TABLE TI (I INT primary key not null)");
+        stmt.executeUpdate("INSERT INTO  TI values(1)");
+        stmt.executeUpdate("INSERT INTO  TI values(2)");
+        stmt.executeUpdate("INSERT INTO  TI values(3)");
+        TestConfiguration.getCurrent().shutdownDatabase();
+        stmt = createStatement();
+        ResultSet rs = stmt.executeQuery("SELECT * from TI ORDER BY I");
+        JDBC.assertFullResultSet(rs, new String[][] {{"1"},{"2"},{"3"}});
+        rs.close();        
+    }
+
     
     /**
      * Ensure that after hard upgrade (with the old version)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_3.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_3.java?view=diff&rev=555806&r1=555805&r2=555806
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_3.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_3.java
Thu Jul 12 15:52:09 2007
@@ -81,51 +81,6 @@
         super(name);
     }
     
-
-    /**
-     * Make sure table created in soft upgrade mode can be 
-     * accessed after shutdown.  DERBY-2931
-     * @throws SQLException
-     */
-    public void testCreateTable() throws SQLException
-    {
-        
-        Statement stmt = createStatement();
-        try {
-            stmt.executeUpdate("DROP table t");
-        } catch (SQLException se) {
-            // ignore table does not exist error on
-            // on drop table.
-            assertSQLState("42Y55",se ); 
-        }
-        stmt.executeUpdate("CREATE TABLE T (I INT)");
-        TestConfiguration.getCurrent().shutdownDatabase();
-        stmt = createStatement();
-        ResultSet rs = stmt.executeQuery("SELECT * from t");
-        JDBC.assertEmpty(rs);  
-        rs.close();
-    }
-    
-    public void testIndex() throws SQLException 
-    {
-        Statement stmt = createStatement();
-        try {
-            stmt.executeUpdate("DROP table ti");
-        } catch (SQLException se) {
-            // ignore table does not exist error on
-            // on drop table.
-            assertSQLState("42Y55",se ); 
-        }
-        stmt.executeUpdate("CREATE TABLE TI (I INT primary key not null)");
-        stmt.executeUpdate("INSERT INTO  TI values(1)");
-        stmt.executeUpdate("INSERT INTO  TI values(2)");
-        stmt.executeUpdate("INSERT INTO  TI values(3)");
-        TestConfiguration.getCurrent().shutdownDatabase();
-        stmt = createStatement();
-        ResultSet rs = stmt.executeQuery("SELECT * from TI ORDER BY I");
-        JDBC.assertFullResultSet(rs, new String[][] {{"1"},{"2"},{"3"}});
-        rs.close();        
-    }
     /**
      * Verify the compilation schema is nullable after upgrade to 10.3
      * or later. (See DERBY-630)



Mime
View raw message