net.sourceforge.jtds.jdbc
Class SunTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bynet.sourceforge.jtds.jdbc.TestBase
              extended bynet.sourceforge.jtds.jdbc.DatabaseTestCase
                  extended bynet.sourceforge.jtds.jdbc.SunTest
All Implemented Interfaces:
junit.framework.Test

public class SunTest
extends DatabaseTestCase

Test case to illustrate errors reported by SUN JBDC compatibility test suite.

Version:
1.0

Field Summary
 
Fields inherited from class net.sourceforge.jtds.jdbc.DatabaseTestCase
 
Fields inherited from class net.sourceforge.jtds.jdbc.TestBase
con, props
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
SunTest(java.lang.String name)
           
 
Method Summary
static void main(java.lang.String[] args)
           
static junit.framework.Test suite()
           
 void testCharToLong()
          Generic test for SUN bugs: bigint null parameter values sent as integer size.
 void testCharToReal()
          Generic test for errors caused by promotion out parameters of Float to Double by driver.
 void testConversionToLongvarchar()
          Test conversion of various types to LONGVARCHAR.
 void testDateTime()
          Generic Tests for SUN bugs such as Can't convert VARCHAR to Timestamp Can't convert VARCHAR to Time Can't convert VARCHAR to Date Internal time representation causes equals to fail
 void testDateTimeFn()
          Test for bug [ 1008126 ] Metadata getTimeDateFunctions() wrong
 void testGetFloatObject()
          Generic test for SUN bug where Float was promoted to Double by driver leading to ClassCastExceptions in the tests.
 void testGetMetaData()
          Test for SUN bug [ PrepStmt1.getMetaData() ] Driver loops if select contains commas.
 void testGetProcedures()
          Test for SUN bug [ dbMeta8.testGetProcedures ] The wrong column names are returned by getProcedures().
 void testNestedEscapes()
          Test nested escapes
 void testPrepStmtError()
          Test for bug [ 1012301 ] 0.9-rc1: Prepared statement execution error.
 void testSetDateObject()
          Test for bug [ 1012307 ] PreparedStatement.setObject(java.util.Date) not working.
 void testSetFetchDirectiion()
          Test for SUN bug [ stmt2.testSetFetchDirection04 ] fetch direction constant not validated.
 void testSetFetchSize()
          Test for SUN bug [ resultSet1.testSetFetchSize02 ] attempt to set non zero fetch size rejected.
 void testSqlComments()
          Test for bug [ 1011650 ] 0.9-rc1: comments get parsed
 void testStringFn()
          Test for scalar string functions.
 
Methods inherited from class net.sourceforge.jtds.jdbc.DatabaseTestCase
compareBytes, getLongString, getLongString, getType, getTypemap
 
Methods inherited from class net.sourceforge.jtds.jdbc.TestBase
compareInputStreams, compareReaders, connect, dropDatabase, dropFunction, dropProcedure, dropTable, dropTrigger, dropType, dropView, dump, dump, dumpAll, dumpKeys, dumpRow, dumpRow, getConnection, getConnection, makeObjects, makeTestTables, setUp, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SunTest

public SunTest(java.lang.String name)
Method Detail

suite

public static junit.framework.Test suite()

testGetMetaData

public void testGetMetaData()
                     throws java.lang.Exception
Test for SUN bug [ PrepStmt1.getMetaData() ] Driver loops if select contains commas.

Throws:
java.lang.Exception

testDateTime

public void testDateTime()
                  throws java.lang.Exception
Generic Tests for SUN bugs such as
  1. Can't convert VARCHAR to Timestamp
  2. Can't convert VARCHAR to Time
  3. Can't convert VARCHAR to Date
  4. Internal time representation causes equals to fail

Throws:
java.lang.Exception

testCharToReal

public void testCharToReal()
                    throws java.lang.Exception
Generic test for errors caused by promotion out parameters of Float to Double by driver. eg [ callStmt4.testGetObject34 ] Class cast exception Float.

Throws:
java.lang.Exception

testCharToLong

public void testCharToLong()
                    throws java.lang.Exception
Generic test for SUN bugs: bigint null parameter values sent as integer size.

Throws:
java.lang.Exception

testGetProcedures

public void testGetProcedures()
                       throws java.lang.Exception
Test for SUN bug [ dbMeta8.testGetProcedures ] The wrong column names are returned by getProcedures().

Throws:
java.lang.Exception

testGetFloatObject

public void testGetFloatObject()
                        throws java.lang.Exception
Generic test for SUN bug where Float was promoted to Double by driver leading to ClassCastExceptions in the tests. Example [ prepStmt4.testSetObject16 ]

Throws:
java.lang.Exception

testSetFetchSize

public void testSetFetchSize()
                      throws java.lang.Exception
Test for SUN bug [ resultSet1.testSetFetchSize02 ] attempt to set non zero fetch size rejected.

Throws:
java.lang.Exception

testSetFetchDirectiion

public void testSetFetchDirectiion()
                            throws java.lang.Exception
Test for SUN bug [ stmt2.testSetFetchDirection04 ] fetch direction constant not validated.

Throws:
java.lang.Exception

testSetDateObject

public void testSetDateObject()
                       throws java.lang.Exception
Test for bug [ 1012307 ] PreparedStatement.setObject(java.util.Date) not working. The driver should throw an exception if the object is not of a valid type according to table

Throws:
java.lang.Exception

testPrepStmtError

public void testPrepStmtError()
                       throws java.lang.Exception
Test for bug [ 1012301 ] 0.9-rc1: Prepared statement execution error.

Throws:
java.lang.Exception

testSqlComments

public void testSqlComments()
                     throws java.lang.Exception
Test for bug [ 1011650 ] 0.9-rc1: comments get parsed

Throws:
java.lang.Exception

testDateTimeFn

public void testDateTimeFn()
                    throws java.lang.Exception
Test for bug [ 1008126 ] Metadata getTimeDateFunctions() wrong

Throws:
java.lang.Exception

testStringFn

public void testStringFn()
                  throws java.lang.Exception
Test for scalar string functions.

Throws:
java.lang.Exception

testNestedEscapes

public void testNestedEscapes()
                       throws java.lang.Exception
Test nested escapes

Throws:
java.lang.Exception

testConversionToLongvarchar

public void testConversionToLongvarchar()
                                 throws java.sql.SQLException
Test conversion of various types to LONGVARCHAR. This functionality was broken in 0.9 because changes were made to handle LONGVARCHAR internally as Clob rather than String (but these did not take into consideration all possible cases.

Throws:
java.sql.SQLException

main

public static void main(java.lang.String[] args)


Generated on October 27 2012