This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 125248 - ResultSetTableModelSupportTest failing
Summary: ResultSetTableModelSupportTest failing
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: Macintosh Solaris
: P2 blocker (vote)
Assignee: David Vancouvering
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-14 22:41 UTC by David Vancouvering
Modified: 2008-01-18 21:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Vancouvering 2008-01-14 22:41:56 UTC
See attached stack trace.  Looks like tests are now being run with Java 6, which has the new JDBC 4 ROWID type.
Comment 1 David Vancouvering 2008-01-14 22:42:36 UTC
Making it a P2 because it's a unit test, and failing unit tests makes it very hard to unit test new changes.
Comment 2 David Vancouvering 2008-01-14 22:43:34 UTC
Stack trace copied from automated test web site

junit.framework.AssertionFailedError: No ColumnTypeDef for java.Types.ROWID
	at junit.framework.Assert.fail(Assert.java:47)
	at org.netbeans.modules.db.sql.execute.ResultSetTableModelSupportTest.testAllTypes(ResultSetTableModelSupportTest.java:75)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at junit.framework.TestCase.runTest(TestCase.java:164)
	at org.netbeans.junit.NbTestCase.access$200(NbTestCase.java:83)
	at org.netbeans.junit.NbTestCase$2.doSomething(NbTestCase.java:314)
	at org.netbeans.junit.NbTestCase$1Guard.run(NbTestCase.java:252)
	at org.netbeans.junit.NbTestCase.runBare(NbTestCase.java:330)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:120)
	at org.netbeans.junit.NbTestCase.run(NbTestCase.java:192)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at org.netbeans.xtest.testrunner.JUnitTestRunner.runTests(JUnitTestRunner.java:191)
	at org.netbeans.xtest.testrunner.JUnitTestRunner.runTests(JUnitTestRunner.java:146)
	at org.netbeans.xtest.plugin.jvm.JUnitTestRunnerLauncher.main(JUnitTestRunnerLauncher.java:82)
Comment 3 David Vancouvering 2008-01-17 21:12:53 UTC
The cause of this is because ROWID is a new type for JDBC 4 / JDK 6.   We don't have a ColumnTypeDef for ROWID, so the
test fails.

It's not immediately clear how to solve this.   If I were to add a ColumnTypeDef for ROWID, then the test would not
compile under JDK 5, because Types.ROWID does not exist.

What I need to do is create an extension of ColumnTypeDef, ColumnTypeDef6, which adds support for ROWID, and find a good
way to at runtime load the right definition of ColumnTypeDef depending upon the version of the VM we're running in.  Sigh...
Comment 4 David Vancouvering 2008-01-18 21:46:03 UTC
Checking in ResultSetTableModelSupport.java;
/cvs/db/core/src/org/netbeans/modules/db/sql/execute/ResultSetTableModelSupport.java,v  <--  ResultSetTableModelSupport.java
new revision: 1.14; previous revision: 1.13

Add support for new JDBC4 types.  This had to be done using the hardcoded integer values for the new types, otherwise
the code would not compile under JDK 5.  This can be fixed once we no longer build on JDK 5...