public class ConnectionTest extends UnitTestBase
JtdsConnection class.| Modifier and Type | Class and Description | 
|---|---|
| static class  | ConnectionTest.testTimerStopHelperHelper class for test for bug [2871274]. | 
| static class  | ConnectionTest.TestUnpackPropertiesClass used to test
  net.sourceforge.jtds.jdbc.JtdsConnection.unpackProperties(Properties). | 
| Constructor and Description | 
|---|
| ConnectionTest(java.lang.String name) Constructor. | 
| Modifier and Type | Method and Description | 
|---|---|
| private void | assertSQLExceptionForBadWholeNumberProperty(java.lang.String key)Assert that an SQLException is thrown when
  JtdsConnection.unpackProperties(Properties)is called with an
 invalid integer (or long) string set on a property. | 
| private java.sql.Connection | getConnectionOverrideProperties(java.util.Properties override)Creates a  Connection, overriding the default properties with
 the ones provided. | 
| static Test | suite() Construct a test suite for this class. | 
| void | testAutoCommit()Test for bug [1296482] setAutoCommit() behaviour. | 
| void | testBug673()Regression test for bug #673, function expansion causes buffer overflow. | 
| void | testBug701() | 
| void | testForceCharset1()Test correct behavior of the  charsetproperty. | 
| void | testForceCharset2()Test correct behavior of the  charsetproperty. | 
| void | testInvalidIntegerProperty()Test that an  SQLExceptionis thrown when parsing invalid
 integer (and long) properties. | 
| void | testSavepointRelease()Test that temporary procedures created within transactions with savepoints
 which are released are still kept in the procedure cache. | 
| void | testTimerStop()Test for bug [2871274], TimerThread prevents classloader from being GCed. | 
| void | testUnclosedSocket()Test for bug [1755448], login failure leaves unclosed sockets. | 
assertEquals, invokeConstructor, invokeGetInstanceField, invokeInstanceMethod, invokeSetInstanceField, invokeStaticMethod, ucFirstcompareBytes, getLongString, getLongString, getType, getTypemapcompareInputStreams, compareReaders, connect, dropDatabase, dropFunction, dropProcedure, dropTable, dropTrigger, dropType, dropView, dump, dump, dumpAll, dumpKeys, dumpRow, dumpRow, getConnection, getConnection, makeObjects, makeTestTables, setUp, tearDownpublic ConnectionTest(java.lang.String name)
Constructor.
name - name of the testpublic static Test suite()
Construct a test suite for this class.
The test suite includes the tests in this class, and adds tests fromDefaultPropertiesTestLibrary after creating an anonymous
 DefaultPropertiesTester object.public void testInvalidIntegerProperty()
SQLException is thrown when parsing invalid
 integer (and long) properties.public void testBug701()
                throws java.lang.Exception
java.lang.Exceptionpublic void testForceCharset1()
                       throws java.lang.Exception
charset property. Values should
 be stored and retrieved using the requested charset rather than the
 server's as long as Unicode is not used.java.lang.Exceptionpublic void testForceCharset2()
                       throws java.lang.Exception
charset property. Stored
 procedure output parameters should be decoded using the specified charset
 rather than the server's as long as they are non-Unicode.java.lang.Exceptionpublic void testAutoCommit()
                    throws java.lang.Exception
"If the value of auto-commit is changed in the middle of a transaction, the current transaction is committed."
java.lang.Exceptionpublic void testBug673()
                throws java.lang.Exception
java.lang.Exceptionpublic void testSavepointRelease()
                          throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUnclosedSocket()
public void testTimerStop()
                   throws java.lang.Throwable
java.lang.Throwableprivate void assertSQLExceptionForBadWholeNumberProperty(java.lang.String key)
JtdsConnection.unpackProperties(Properties) is called with an
 invalid integer (or long) string set on a property.
 
 Note that because Java 1.3 is still supported, the
 RuntimeException that is caught may not contain the original
 Throwable cause, only the original message.key - The message key used to retrieve the property name.private java.sql.Connection getConnectionOverrideProperties(java.util.Properties override)
                                                     throws java.lang.Exception
Connection, overriding the default properties with
 the ones provided.override - the overriding propertiesConnection objectjava.lang.ExceptionGenerated on June 8 2013