1.1 --- a/visualweb.dataprovider/test/CachedRowSet_DataProvider_unit.sh Wed Nov 28 01:58:47 2007 +0000
1.2 +++ b/visualweb.dataprovider/test/CachedRowSet_DataProvider_unit.sh Thu Nov 29 00:06:11 2007 +0000
1.3 @@ -3,12 +3,14 @@
1.4 #rmdir /S /Q lib
1.5 #rmdir /S /Q work
1.6 #rmdir /S /Q results
1.7 -export BASE=g:/home/tr61
1.8 +#BASE is the root of the NetBeans repository
1.9 +export BASE=../../../../
1.10 echo $BASE
1.11
1.12 # uncomment when running CachedRowSetTest also - after including test in cfg-unit.xml
1.13 ant -Dnetbeans.dest.dir="$BASE/nbbuild/netbeans" -Dxtest.file_database.properties=$BASE/visualweb/test/data/DefaultDatabase.properties -Dxtest.testtype="unit" -Dxtest.testattribs="stable" -Dnetbeans.javacore.noscan=true
1.14 +#ant check-properties -Dnetbeans.dest.dir="$BASE/nbbuild/netbeans" -Dxtest.testtype="unit" -Dxtest.testattribs="stable" -Dnetbeans.javacore.noscan=true
1.15 +#ant -Dnetbeans.dest.dir="$BASE/nbbuild/netbeans" -Dxtest.testtype="unit" -Dxtest.testattribs="stable" -Dnetbeans.javacore.noscan=true
1.16
1.17 -#ant -Dnetbeans.dest.dir="$BASE/nbbuild/netbeans" -Dxtest.testtype="unit" -Dxtest.testattribs="stable" -Dnetbeans.javacore.noscan=true
1.18
1.19
2.1 --- a/visualweb.dataprovider/test/unit/src/org/netbeans/modules/visualweb/dataprovider/CachedRowSetDataProviderTest.java Wed Nov 28 01:58:47 2007 +0000
2.2 +++ b/visualweb.dataprovider/test/unit/src/org/netbeans/modules/visualweb/dataprovider/CachedRowSetDataProviderTest.java Thu Nov 29 00:06:11 2007 +0000
2.3 @@ -132,6 +132,7 @@
2.4
2.5 insert.execute();
2.6 }
2.7 +
2.8 }
2.9
2.10
2.11 @@ -168,10 +169,18 @@
2.12 provider.close();
2.13 }
2.14
2.15 + public void testRowCount() {
2.16 + int currentRowCount = 0;
2.17 + CachedRowSetXImpl rowset = new CachedRowSetXImpl();
2.18 + currentRowCount = getRowCount(rowset);
2.19 + assert (currentRowCount > 0);
2.20 + assertEquals(currentRowCount, 1);
2.21 + }
2.22 +
2.23 public void testInsertRow() {
2.24 - try {
2.25 - int newRowCount = 0;
2.26 - int currentRowCount = 0;
2.27 + int newRowCount = 0;
2.28 + int currentRowCount = 0;
2.29 + try {
2.30 CachedRowSetXImpl rowset = new CachedRowSetXImpl();
2.31 Beans beans = new Beans();
2.32 beans.setDesignTime(true);
2.33 @@ -185,7 +194,7 @@
2.34 PreparedStatement insert = conn.prepareStatement(
2.35 "INSERT INTO " + TABLENAME + " VALUES(?, ?, ?)");
2.36
2.37 - for (int i = 1; i <= NUMROWS; i++) {
2.38 + for (int i = 10; i <= NUMROWS; i++) {
2.39 insert.setInt(1, i);
2.40 insert.setString(2, "col1_" + i);
2.41 insert.setString(3, "col2_" + i);
2.42 @@ -194,12 +203,16 @@
2.43 }
2.44
2.45 newRowCount = getRowCount(rowset);
2.46 - assertEquals(newRowCount, currentRowCount + 1);
2.47 +
2.48 } catch (ClassNotFoundException ex) {
2.49 LOGGER.log(Level.FINE, null, ex);
2.50 } catch (SQLException sqle) {
2.51 LOGGER.log(Level.FINE, null, sqle);
2.52 }
2.53 +
2.54 + assert(newRowCount > 0);
2.55 + assertEquals(newRowCount, currentRowCount + 1);
2.56 + assertEquals(currentRowCount, 3);
2.57
2.58 }
2.59