List:Commits« Previous MessageNext Message »
From:mmatthews Date:December 20 2005 7:46pm
Subject:Connector/J commit: r4718 - branches/branch_3_1/connector-j/src/testsuite/regression
View as plain text  
Modified:
   branches/branch_3_1/connector-j/src/testsuite/regression/CachedRowsetTest.java
Log:
Removed execution of test for BUG#15346 - will add back in once Sun fixes the rowset implementation.

Modified: branches/branch_3_1/connector-j/src/testsuite/regression/CachedRowsetTest.java
===================================================================
--- branches/branch_3_1/connector-j/src/testsuite/regression/CachedRowsetTest.java	2005-12-20 19:39:12 UTC (rev 4717)
+++ branches/branch_3_1/connector-j/src/testsuite/regression/CachedRowsetTest.java	2005-12-20 19:46:18 UTC (rev 4718)
@@ -26,9 +26,14 @@
 
 import java.lang.reflect.Method;
 import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
 
 import javax.sql.RowSet;
+import javax.sql.rowset.spi.SyncProviderException;
+import javax.sql.rowset.spi.SyncResolver;
 
+import com.sun.rowset.CachedRowSetImpl;
+
 import testsuite.BaseTestCase;
 
 /**
@@ -103,4 +108,57 @@
 			this.stmt.executeUpdate("DROP TABLE IF EXISTS testBug5188");
 		}
 	}
+	
+	public void testBug15346() throws Exception {
+		if (true) {
+			return; // disabled - bug in Sun's ROWSET RI
+		}
+		
+		String implClass = "com.sun.rowset.CachedRowSetImpl";
+		Class c;
+		
+		try {
+			c = Class.forName(implClass);
+		} catch (ClassNotFoundException e) {
+			System.out.println("skipping testBug15346. Requires: " + implClass);
+			return;
+		}
+		
+		createTable("testBug15346", "(" + "item_id SMALLINT AUTO_INCREMENT,"
+				+ "name VARCHAR(100) NOT NULL," + "phases TINYINT NOT NULL,"
+				+ "feed_from SMALLINT," + "PRIMARY KEY (item_id)" + ")");
+
+		this.stmt.executeUpdate("insert into testBug15346 (name, "
+				+ "phases, feed_from)" + "values" + "('test string', 3, 1),"
+				+ "('Level 6A DB', 3, 1)");
+
+		CachedRowSetImpl rowSet = (CachedRowSetImpl)c.newInstance();
+
+		rowSet.setUrl(dbUrl);
+		
+		rowSet.setCommand("select * from testBug15346"); // set query
+		rowSet.execute();
+
+		rowSet.beforeFirst();
+		assertTrue(rowSet.next());
+		assertEquals(3, rowSet.getInt("phases"));
+		assertEquals(1, rowSet.getInt("feed_from"));
+		assertTrue(rowSet.next());
+		assertEquals(3, rowSet.getInt("phases"));
+		assertEquals(1, rowSet.getInt("feed_from"));
+
+		for (int i = 0; i < 4; i++) {
+
+			rowSet.first();
+			
+			rowSet.updateInt(3, i);
+
+			rowSet.updateRow();
+
+			rowSet.acceptChanges();
+		}
+
+		rowSet.close();
+
+	}
 }
\ No newline at end of file

Thread
Connector/J commit: r4718 - branches/branch_3_1/connector-j/src/testsuite/regressionmmatthews20 Dec