db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r429412 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi: UpdateXXXTest.java UpdateXXXTest_app.properties
Date Mon, 07 Aug 2006 17:56:59 GMT
Author: djd
Date: Mon Aug  7 10:56:58 2006
New Revision: 429412

URL: http://svn.apache.org/viewvc?rev=429412&view=rev
Log:
Change UpdateXXTest to be a JUnit test that runs under J2ME and its suite method to setup
the test cases correctly based upon the JDBC environment. No longer requires a _app.properties
file from the old test harness.

Removed:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest_app.properties
Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest.java?rev=429412&r1=429411&r2=429412&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest.java
Mon Aug  7 10:56:58 2006
@@ -20,6 +20,7 @@
 package org.apache.derbyTesting.functionTests.tests.jdbcapi;
 
 import org.apache.derbyTesting.functionTests.util.BaseJDBCTestCase;
+import org.apache.derbyTesting.functionTests.util.JDBC;
 
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -29,6 +30,9 @@
 
 import java.math.BigDecimal;
 
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
 
 /**
  * Tests updateXXX() methods on updatable resultsets.
@@ -45,6 +49,26 @@
     public UpdateXXXTest(final String name) {
         super(name);
     }
+    
+    public static Test suite() {
+        TestSuite suite = new TestSuite();
+        
+        suite.addTest(new UpdateXXXTest("testUpdateShort"));
+        suite.addTest(new UpdateXXXTest("testUpdateInt"));
+        suite.addTest(new UpdateXXXTest("testUpdateLong"));
+        suite.addTest(new UpdateXXXTest("testUpdateFloat"));
+        suite.addTest(new UpdateXXXTest("testUpdateDouble"));
+        suite.addTest(new UpdateXXXTest("testUpdateNull"));
+        suite.addTest(new UpdateXXXTest("testUpdateObjectWithNull"));
+        suite.addTest(new UpdateXXXTest("testUpdateString"));
+        
+        // requires java.math.BigDecimal
+        if (JDBC.vmSupportsJDBC2())
+            suite.addTest(new UpdateXXXTest("testUpdateBigDecimal"));
+                      
+        return suite;
+    }
+ 
 
     /**
      * The setup creates a Connection to the database, and also
@@ -82,8 +106,12 @@
             ps.setFloat(4, 1.0f);
             ps.setDouble(5, 1.0);
             ps.setDouble(6, 1.0);
-            ps.setBigDecimal(7, BigDecimal.valueOf(1L));
-            ps.setBigDecimal(8, BigDecimal.valueOf(1L));
+            
+            // Use setString instead of setBigDecimal to
+            // allow most of the test cases to run under J2ME
+            ps.setString(7, "1");
+            ps.setString(8, "1");
+            
             ps.setString(9, "1");
             ps.setString(10, "1");
             ps.executeUpdate();



Mime
View raw message