Changeset: 2f72b89e1686 for monetdb-java
URL: https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=2f72b89e1686
Modified Files:
        tests/Test_PSlargebatchval.java
Branch: default
Log Message:

Improve test. Add a SELECT COUNT(*) query after the execution of the batched 
inserts to verify the expected nr of rows have been inserted.


diffs (35 lines):

diff --git a/tests/Test_PSlargebatchval.java b/tests/Test_PSlargebatchval.java
--- a/tests/Test_PSlargebatchval.java
+++ b/tests/Test_PSlargebatchval.java
@@ -38,6 +38,7 @@ public class Test_PSlargebatchval {
                        pstmt.setDouble(3, 1.0);
                        pstmt.addBatch();
                        pstmt.executeBatch();
+                       System.out.println("1. inserted 1 large string");
 
                        /* test issue reported at 
https://www.monetdb.org/bugzilla/show_bug.cgi?id=3470 */
                        pstmt.setLong(1, -2L);
@@ -45,6 +46,7 @@ public class Test_PSlargebatchval {
                        pstmt.setDouble(3, -2.0);
                        pstmt.addBatch();
                        pstmt.executeBatch();
+                       System.out.println("2. inserted 1 large clob via 
StringReader() object");
 
                        Clob myClob = con.createClob();
                        myClob.setString(1L, largeStr);
@@ -54,9 +56,15 @@ public class Test_PSlargebatchval {
                        pstmt.setDouble(3, 12345678901.98765);
                        pstmt.addBatch();
                        pstmt.executeBatch();
+                       System.out.println("3. inserted 1 large clob via 
createClob() object");
 
                        pstmt.close();
 
+                       ResultSet rs = stmt.executeQuery("SELECT COUNT(*) FROM 
x");
+                       if (rs.next())
+                               System.out.println(rs.getInt(1) + " rows 
inserted.");
+                       rs.close();
+
                        stmt.execute("DROP TABLE x");
                        stmt.close();
                } catch (SQLException e) {
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to