package testsuite.simple; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.util.ArrayList; import java.util.Properties; import testsuite.BaseTestCase; public class TestBug27916 extends BaseTestCase { public TestBug27916(String name) { super(name); // TODO Auto-generated constructor stub } /** * Tests for Bug#27916: DatabaseMetaData.getTypeInfo() does not return all the available data types * * .Loading JDBC driver 'com.mysql.jdbc.Driver' Done. Done. java.vm.version : 1.5.0_11-b03 java.vm.vendor : Sun Microsystems Inc. java.runtime.version : 1.5.0_11-b03 os.name : Windows XP os.version : 5.1 sun.management.compiler : HotSpot Client Compiler Connected to 5.0.38-log F Time: 0,672 There was 1 failure: 1) testBug27916(testsuite.simple.TestBug27916)junit.framework.AssertionFailedError: int unsigned at testsuite.simple.TestBug27916.testBug27916(TestBug27916.java:47) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at testsuite.simple.TestBug27916.main(TestBug27916.java:57) FAILURES!!! Tests run: 1, Failures: 1, Errors: 0 */ public void testBug27916() throws Exception { if (versionMeetsMinimum(5, 0)) { System.out.println("java.vm.version : " + System.getProperty("java.vm.version")); System.out.println("java.vm.vendor : " + System.getProperty("java.vm.vendor")); System.out.println("java.runtime.version : " + System.getProperty("java.runtime.version")); System.out.println("os.name : " + System.getProperty("os.name")); System.out.println("os.version : " + System.getProperty("os.version")); System.out.println("sun.management.compiler : " + System.getProperty("sun.management.compiler")); try { Properties props = new Properties(); props.setProperty("useInformationSchema","true"); Connection PropConn = getConnectionWithProps(props); ArrayList types = new ArrayList(); DatabaseMetaData dbmd = PropConn.getMetaData(); this.rs = dbmd.getTypeInfo(); while (this.rs.next()) { types.add(rs.getString("TYPE_NAME")); } this.rs = dbmd.getColumns("mysql",null,"time_zone_transition","%"); while (this.rs.next()) { String typeName = rs.getString("TYPE_NAME"); assertTrue(typeName, types.contains(typeName)); } } finally { closeMemberJDBCResources(); } } } public static void main(String[] args) { // TODO Auto-generated method stub junit.textui.TestRunner.run(TestBug27916.class); } }