db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r507151 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/ suites/ tests/jdbcapi/
Date Tue, 13 Feb 2007 18:44:22 GMT
Author: djd
Date: Tue Feb 13 10:44:15 2007
New Revision: 507151

URL: http://svn.apache.org/viewvc?view=rev&rev=507151
Log:
Switch a number of tests in jdbcapi to run under JUnit using JDBCHarnessJavaTest
(and removed them from the old harness suites).

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc20.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc30.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc20.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCHarnessJavaTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetQueryTimeoutTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtNull.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/rsgetXXXcolumnNames.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc20.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc30.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc20.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc20.out?view=diff&rev=507151&r1=507150&r2=507151
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc20.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc20.out
Tue Feb 13 10:44:15 2007
@@ -21,7 +21,5 @@
 PASS -- expected exception
 SQLSTATE(X0Y78): java.sql.SQLException: Statement.executeQuery() cannot be called with a
statement that returns a row count.
 PASS -- expected exception
-SQLSTATE(42X05): java.sql.SQLException: Table/View 'TRASH' does not exist.
-PASS -- expected exception
 SQLSTATE(X0Y79): java.sql.SQLException: Statement.executeUpdate() cannot be called with a
statement that returns a ResultSet.
 Test statementJdbc20 finished

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc30.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc30.out?view=diff&rev=507151&r1=507150&r2=507151
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc30.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc30.out
Tue Feb 13 10:44:15 2007
@@ -2,18 +2,10 @@
 trying stmt.getMoreResults(int) :
 trying stmt.executeUpdate(String, int) :
 trying stmt.executeUpdate(String, int[]) :
-PASS -- expected exception
-SQLSTATE(0A000): java.sql.SQLException: Feature not implemented: executeUpdate(String, int[]).
 trying stmt.executeUpdate(String, String[]) :
-PASS -- expected exception
-SQLSTATE(0A000): java.sql.SQLException: Feature not implemented: executeUpdate(String, String[]).
 trying stmt.execute(String, int) :
 trying stmt.execute(String, int[]) :
-PASS -- expected exception
-SQLSTATE(0A000): java.sql.SQLException: Feature not implemented: execute(String, int[]).
 trying stmt.execute(String, String[]) :
-PASS -- expected exception
-SQLSTATE(0A000): java.sql.SQLException: Feature not implemented: execute(String, String[]).
 trying stmt.getResultSetHoldability() :
 trying stmt.getGeneratedKeys() :
 Test statementJdbc30 finished

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc20.runall
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc20.runall?view=diff&rev=507151&r1=507150&r2=507151
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc20.runall
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc20.runall
Tue Feb 13 10:44:15 2007
@@ -2,8 +2,4 @@
 lang/scrollCursors2.java
 lang/scrollCursors3.sql
 jdbcapi/getCurConnJdbc20.sql
-jdbcapi/statementJdbc20.java
-jdbcapi/connectionJdbc20.java
-jdbcapi/StmtCloseFunTest.java
-jdbcapi/resultsetJdbc20.java
 jdbcapi/dataSourceReference.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall?view=diff&rev=507151&r1=507150&r2=507151
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
Tue Feb 13 10:44:15 2007
@@ -1,6 +1,5 @@
 jdbcapi/bestrowidentifier.sql
 jdbcapi/checkDriver.java
-jdbcapi/derbyStress.java
 jdbcapi/nullSQLText.java
 jdbcapi/prepStmtMetaData.java
 jdbcapi/resultset.java
@@ -9,12 +8,8 @@
 jdbcapi/users2.sql
 jdbcapi/secureUsers.sql
 jdbcapi/secureUsers1.sql
-jdbcapi/maxfieldsize.java
 jdbcapi/LOBTest.java
 jdbcapi/parameterMapping.java
 jdbcapi/setTransactionIsolation.java
-jdbcapi/SetQueryTimeoutTest.java
-jdbcapi/prepStmtNull.java
 jdbcapi/testRelative.java
-jdbcapi/rsgetXXXcolumnNames.java
 jdbcapi/SURTest_ij.sql

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.runall
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.runall?view=diff&rev=507151&r1=507150&r2=507151
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.runall
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.runall
Tue Feb 13 10:44:15 2007
@@ -3,6 +3,5 @@
 jdbcapi/checkDataSource30.java
 jdbcapi/parameterMetaDataJdbc30.java
 lang/procedureJdbc30.java
-jdbcapi/statementJdbc30.java
 jdbcapi/savepointJdbc30_JSR169.java
 jdbcapi/savepointJdbc30_XA.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCHarnessJavaTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCHarnessJavaTest.java?view=diff&rev=507151&r1=507150&r2=507151
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCHarnessJavaTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/JDBCHarnessJavaTest.java
Tue Feb 13 10:44:15 2007
@@ -93,7 +93,6 @@
         
         // Tests that run ok in embedded but have a different client master file.
         "savepointJdbc30_JSR169",
-        "savepointJdbc30_XA",
         "prepStmtMetaData",
         
         // Tests that pass on embedded but fail on client
@@ -105,6 +104,9 @@
      */
     private static final String[] JDBCAPI_TESTS_EMEBDDED_JDBC3 =
     {
+        // Tests that run ok in embedded but have a different client master file.
+        "savepointJdbc30_XA",
+        
         // Tests that pass on embedded but fail on client
         "parameterMetaDataJdbc30",
         "dataSourcePermissions",         

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetQueryTimeoutTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetQueryTimeoutTest.java?view=diff&rev=507151&r1=507150&r2=507151
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetQueryTimeoutTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetQueryTimeoutTest.java
Tue Feb 13 10:44:15 2007
@@ -732,9 +732,6 @@
         System.out.println("Test SetQueryTimeoutTest starting");
 
         Connection[] connections = new Connection[CONNECTIONS];
-        for (int i = 0; i < connections.length; ++i) {
-            connections[i] = null;
-        }
 
         try {
             // Load the JDBC Driver class

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java?view=diff&rev=507151&r1=507150&r2=507151
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java
Tue Feb 13 10:44:15 2007
@@ -67,12 +67,10 @@
 			// make the initial connection.
 			ij.getPropertyArg(args);
 			Connection conn = ij.startJBMS();
-			cleanUp(conn);
 			test1(conn);
 			test2(conn);
 			test3(conn);
 
-			cleanUp(conn);
 			conn.close();		
 				
 		} catch (SQLException e) {
@@ -84,16 +82,6 @@
 
 		System.out.println("Statement Close Fun Test finished");
 	}
-
-	
-    private static void cleanUp(Connection conn) throws SQLException {
-	Statement s = conn.createStatement();
-	String[] testObjects = {"PROCEDURE TAKESSTRING", "TABLE TAB1", "TABLE TAB2", "TABLE TAB3"};
-        try {
-		TestUtil.cleanUpTest(s, testObjects);
-	} catch (SQLException se){//
-	}
-    }
 
     private static void test1(Connection conn) {
 		Statement s;

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java?view=diff&rev=507151&r1=507150&r2=507151
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
Tue Feb 13 10:44:15 2007
@@ -62,6 +62,10 @@
 		suite.addTest(BatchUpdateTest.suite());
 		suite.addTest(StreamTest.suite());
         
+        // Old harness .java tests that run using the HarnessJavaTest
+        // adapter and continue to use a single master file.
+        suite.addTest(JDBCHarnessJavaTest.suite());
+        
         if (JDBC.vmSupportsJDBC3())
         {
             // Class requires javax.sql.PooledConnection

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java?view=diff&rev=507151&r1=507150&r2=507151
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java
Tue Feb 13 10:44:15 2007
@@ -42,10 +42,6 @@
  */
 
 public class connectionJdbc20{ 
-   
-	static private boolean isDerbyNet = false;
-
-	static private String[] testObjects = {"TABLE TAB1"};
 
 	public static void main(String[] args) {
 		Connection conn, connreturn;
@@ -59,10 +55,9 @@
 			// make the initial connection.
 			 ij.getPropertyArg(args);
 			 conn = ij.startJBMS();
-			 isDerbyNet = TestUtil.isNetFramework();
+
 			 stmt = conn.createStatement();
-			// cleanup table, just in case
-			TestUtil.cleanUpTest(stmt, testObjects);
+
             //create a table, insert a row, do a select from the table,
 			 stmt.execute("create table tab1("+
                                            "c1 char(100) for bit data,"+
@@ -146,6 +141,7 @@
             }
             // try to get a statemet from a meta data result set
             stmt = rs.getStatement(); 
+            rs.close();
 
             // Try to get the Connection back from a Metadata
             System.out.println("Try to Get the connection back from metadata");
@@ -167,7 +163,6 @@
 
             cs.close();
 			conn.close();
-			TestUtil.cleanUpTest(stmt, testObjects);
 
 		}
 		catch (SQLException e) {

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java?view=diff&rev=507151&r1=507150&r2=507151
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java
Tue Feb 13 10:44:15 2007
@@ -32,8 +32,6 @@
 
 public class derbyStress {
 	
-	private static String[] testObjects = {"table t1"};
-	
 	private static int numConn = 1;
 	private static int numRows = 100;
 	private static int numPreparedStmts = 2000; 
@@ -70,8 +68,6 @@
 	private static void createTables(Connection conn, int numRows) throws SQLException{
 		Statement stmt = conn.createStatement();
 		
-		TestUtil.cleanUpTest(stmt, testObjects);
-		
 		stmt.execute("create table t1 (lvc  LONG VARCHAR)");
 		stmt.close();
 		
@@ -132,7 +128,6 @@
 			ResultSet rs = stmt.executeQuery("values(1)");
 			// How silly! I forgot to close the result set.
 		}
-		TestUtil.cleanUpTest(stmt, testObjects);
 		conn.commit();
 		stmt.close();
 		conn.close();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java?view=diff&rev=507151&r1=507150&r2=507151
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java
Tue Feb 13 10:44:15 2007
@@ -42,9 +42,6 @@
  */
 
 public class maxfieldsize { 
-    
-   
-    public static ResultSet rs;
 
 	static final int START_SECOND_HALF = 5;
 	static final int NUM_EXECUTIONS = 2 * START_SECOND_HALF;
@@ -76,7 +73,7 @@
 			 ij.getPropertyArg(args);
 			 conn = ij.startJBMS();
 			 stmt = conn.createStatement();
-			 TestUtil.cleanUpTest(stmt, testObjects);
+
             //create a table, insert a row, do a select from the table,
 			 stmt.execute("create table tab1("+
                                            "c1 char(100) for bit data,"+
@@ -99,7 +96,7 @@
 
 				System.out.println("Iteration #: " + loop);
 	            System.out.println("Max Field Size = "  + stmt.getMaxFieldSize());
-				rs = stmt.executeQuery("select * from tab1");
+				ResultSet rs = stmt.executeQuery("select * from tab1");
                 while (rs.next())
                 {
                     for(int i=1 ; i < 7 ; i++)
@@ -169,8 +166,6 @@
 
 			testSort(conn, stmt);
 
-			TestUtil.cleanUpTest(stmt, testObjects);
-
 			stmt.close();
 			conn.close();
 
@@ -270,7 +265,7 @@
 			 * out 1st and last 5 rows.  This should test streaming to/from
 			 * a work table.
 			 */
-			rs = stmt.executeQuery("select * from tab2 order by c0 desc");
+			ResultSet rs = stmt.executeQuery("select * from tab2 order by c0 desc");
 			for (int index = 0; index < 5000; index++)
 			{
 				rs.next();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtNull.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtNull.java?view=diff&rev=507151&r1=507150&r2=507151
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtNull.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtNull.java
Tue Feb 13 10:44:15 2007
@@ -70,6 +70,7 @@
 
 		
 			pStmt.executeBatch();
+            pStmt.close();
 			con.commit();
 
 			stmt1 = con.createStatement();
@@ -80,7 +81,9 @@
 			}
 			String[] testObjects = {"table nullTS"};
                         TestUtil.cleanUpTest(stmt1, testObjects);
+            stmt1.close();
    			con.commit();
+            con.close();
  		} catch(SQLException sqle) {
  		   dumpSQLExceptions(sqle);
  		   sqle.printStackTrace();
@@ -124,6 +127,7 @@
 
 		
 			pStmt.executeBatch();
+            pStmt.close();
 			con.commit();
 
 			stmt1 = con.createStatement();
@@ -134,7 +138,9 @@
 			}
 			String[] testObjects = {"table nullBlob"};
                         TestUtil.cleanUpTest(stmt1, testObjects);
+            stmt1.close();
    			con.commit();
+            con.close();
  		} catch(SQLException sqle) {
  		   dumpSQLExceptions(sqle);
  		   sqle.printStackTrace();
@@ -175,14 +181,19 @@
                pStmt.setNull(1, Types.VARCHAR,"");
                pStmt.setBytes(2, b2);
                pStmt.execute();
+               pStmt.close();
 
                stmt1 = con.createStatement();
                rs = stmt1.executeQuery("select * from ClobBlob");
                while(rs.next()) {
                     System.out.println("ResultSet is: "+rs.getObject(1));
                }
+               rs.close();
                String[] testObjects = {"table ClobBlob"};
                TestUtil.cleanUpTest(stmt1, testObjects);
+               
+               stmt1.close();
+               con.close();
           } catch(SQLException sqle) {
                dumpSQLExceptions(sqle);
           } catch(Throwable e) {

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/rsgetXXXcolumnNames.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/rsgetXXXcolumnNames.java?view=diff&rev=507151&r1=507150&r2=507151
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/rsgetXXXcolumnNames.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/rsgetXXXcolumnNames.java
Tue Feb 13 10:44:15 2007
@@ -104,6 +104,10 @@
 			   System.out.println("Col col1: "+rs.getInt("col1"));
 			}
 			rs.close();
+            stmt1.close();
+            stmt.close();
+            con.commit();
+            con.close();
  		} catch(SQLException sqle) {
  		   dumpSQLExceptions(sqle);
  		   sqle.printStackTrace();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc20.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc20.java?view=diff&rev=507151&r1=507150&r2=507151
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc20.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc20.java
Tue Feb 13 10:44:15 2007
@@ -31,6 +31,8 @@
 
 import org.apache.derby.tools.ij;
 import org.apache.derby.tools.JDBCDisplayUtil;
+import org.apache.derbyTesting.junit.BaseJDBCTestCase;
+import org.apache.derbyTesting.junit.JDBC;
 
 /**
  * Test of additional methods in JDBC2.0  methods in statement and 
@@ -160,7 +162,7 @@
 			}
 			catch (SQLException e)
 			{
-              dumpExpectedSQLExceptions(e);
+              BaseJDBCTestCase.assertSQLState("42X05", e);
 			}
 
 			// executeUpdate() not allowed on statements
@@ -175,6 +177,7 @@
 			}
 
 			stmt.close();
+            con.commit();
 			con.close();
 
 		}

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc30.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc30.java?view=diff&rev=507151&r1=507150&r2=507151
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc30.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc30.java
Tue Feb 13 10:44:15 2007
@@ -28,6 +28,7 @@
 
 import org.apache.derby.tools.ij;
 import org.apache.derby.iapi.reference.JDBC30Translation;
+import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 
 /**
  * Test of additional methods in JDBC3.0  methods in statement class.
@@ -74,7 +75,7 @@
 			try {
 				stmt.executeUpdate("insert into tab1 values(2, 3, 4.1)", columnIndexes);
 			} catch (SQLException ex) {
-				dumpExpectedSQLExceptions(ex);
+                BaseJDBCTestCase.assertSQLState("0A000", ex);
 			}
 
 			System.out.println("trying stmt.executeUpdate(String, String[]) :");
@@ -84,7 +85,7 @@
 			try {
 				stmt.executeUpdate("insert into tab1 values(2, 3, 4.1)", columnNames);
 			} catch (SQLException ex) {
-				dumpExpectedSQLExceptions(ex);
+                BaseJDBCTestCase.assertSQLState("0A000", ex);
 			}
 
 			System.out.println("trying stmt.execute(String, int) :");
@@ -94,14 +95,14 @@
 			try {
 				stmt.execute("insert into tab1 values(2, 3, 4.1)", columnIndexes);
 			} catch (SQLException ex) {
-				dumpExpectedSQLExceptions(ex);
+                BaseJDBCTestCase.assertSQLState("0A000", ex);
 			}
 
 			System.out.println("trying stmt.execute(String, String[]) :");
 			try {
 				stmt.execute("insert into tab1 values(2, 3, 4.1)", columnNames);
 			} catch (SQLException ex) {
-				dumpExpectedSQLExceptions(ex);
+                BaseJDBCTestCase.assertSQLState("0A000", ex);
 			}
 
 			System.out.println("trying stmt.getResultSetHoldability() :");
@@ -112,6 +113,7 @@
 
 			rs.close();
 			stmt.close();
+            con.commit();
 			con.close();
 
 		}
@@ -124,14 +126,5 @@
 		}
 
 		System.out.println("Test statementJdbc30 finished");
-    }
-
-	public static void dumpExpectedSQLExceptions (SQLException se) {
-		System.out.println("PASS -- expected exception");
-		while (se != null)
-		{
-			System.out.println("SQLSTATE("+se.getSQLState()+"): "+se);
-			se = se.getNextException();
-        }
     }
 }



Mime
View raw message