public class SAfeTest extends DatabaseTestCase
| Constructor and Description | 
|---|
| SAfeTest(java.lang.String name) | 
| Modifier and Type | Method and Description | 
|---|---|
| private static void | insertBigDecimal(java.sql.PreparedStatement stmt,
                double val,
                boolean scaleFlag)Helper method for  testBigDecimal0007. | 
| static void | main(java.lang.String[] args) | 
| void | testBatchUpdates0015()Test batch updates for both plain and prepared statements. | 
| void | testBigDecimal0007()Test  BigDecimals created from double values (i.e with very
 large scales). | 
| void | testBigDecimal1()Test for bug [939206] TdsException: can't sent this BigDecimal | 
| void | testBitFields0005()Check that values returned from bit fields are correct (not just 0) (bug #841670). | 
| void | testBytesToString()Test that getString() on a varbinary column returns a hex string. | 
| void | testCallableStatement0006()Test that  CallableStatements with return values work correctly. | 
| void | testCallableStatementVarchar0010()Test VARCHAR output parameters returned by CallableStatements. | 
| void | testCancel0001()Test cancelling. | 
| void | testCancel0002()Test cancelling. | 
| void | testCancel0003() Test for bug #343, Statement hangs in socket read after  Statement.cancel(). | 
| void | testCursorResultSetConcurrency0003() Test  CursorResultSetconcurrency. | 
| void | testCursorResultSetEmpty0004()Check that meta data information is fetched even for empty cursor-based result sets (bug #613199). | 
| void | testDataTruncException()Test  DataTruncationexception. | 
| void | testDatetimeRounding1()Test for bug [983561] getDatetimeValue truncates fractional milliseconds | 
| void | testDeleteRow0009()Test  ResultSet.deleteRow()on updateable result sets. | 
| void | testExecuteUpdateSelect()Tests that  executeUpdate("SELECT ...") | 
| void | testFloat1()Test for bug [963799] float values change when written to the database | 
| void | testFnEscape()Test for bug related with [1368058] Calling StoredProcedure with
 functions ({fn} escape can't handle special characters, e.g. underscore). | 
| void | testFnEscapeNesting()Test for bug #1116046 {fn } escape can't handle nested functions. | 
| void | testGetMultiScrollRs()Test return of multiple scrollable result sets from one execute. | 
| void | testInsertRow0012()Test  ResultSet.insertRow()on updateable result sets. | 
| void | testLongToVarchar0008()Test writing  longvalues to VARCHAR fields. | 
| void | testMaxFieldSize()Test  Statement.setMaxFieldSize(). | 
| void | testNestedFunctions() Regression test for bug #615, the SQL parser doesn't correctly handle
 {fn } escapes containing nested (unescaped) functions. | 
| void | testNullLengthStrings0001()Test whether NULL values, 0-length strings and single space strings
 are treated right. | 
| void | testNullOutputParameters()Test that  nulloutput parameters are handled correctly. | 
| void | testOldDates0016()Test that dates prior to 06/15/1940 0:00:00 are stored and retrieved
 correctly. | 
| void | testOutOfOrderClose0013()Test how an "out-of-order" close behaves (e.g close the
  Connectionfirst, then theStatementanf
 finally theResultSet). | 
| void | testPlainResultSetPosition0004()Check that the  isBeforeFirst,isAfterLast,isFirstandisLastmethods work for
 forward-only, read-only result sets (bug [1039876] MS SQL
 JtdsResultSet.isAfterLast() always returns false). | 
| void | testPreparedAndCallableCursors0014()Test cursor-based  ResultSets obtained fromPreparedStatements andCallableStatements. | 
| void | testQueryTimeout()Test for bug [1222199] Delayed exception thrown in statement close. | 
| void | testSocketConcurrency1() | 
| void | testSocketConcurrency2() | 
| void | testSocketConcurrency3() | 
| void | testSocketConcurrency4()Test running SELECT queries on one  Statementat the same
 time ascancel()is called on a concurrentStatement. | 
| void | testTableParsing()Test that the SQL parser doesn't try to parse the table name unless
 necessary (or that it is able to parse function calls if it does). | 
| void | testThreadInterrupt()Test for bug #507, executeQuery absorbs thread interrupt status | 
| void | testUnterminatedCommentParsing()Test for bug [1187927] Driver Hangs on Statement.execute(). | 
| void | testUpdateRow0011()Test  ResultSet.updateRow()on updateable result sets. | 
compareBytes, 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 static void main(java.lang.String[] args)
public void testNullLengthStrings0001()
                               throws java.lang.Exception
java.lang.Exceptionpublic void testCancel0001()
                    throws java.lang.Exception
java.lang.Exceptionpublic void testCancel0002()
                    throws java.lang.Exception
java.lang.Exceptionpublic void testCancel0003()
                    throws java.lang.Exception
 Test for bug #343, Statement hangs in socket read after Statement.cancel(). 
In 1.0.1 and earlier versions network packets consisting of a single TDS_DONE packet with the CANCEL flag set were ignored and a new read() was attempted, essentially causing a deadlock.
Because it relies on a particular succession of events this test will not always work as expected, i.e. the cancel might be executed too early or too late, but it won't fail in this situation.
java.lang.Exceptionpublic void testQueryTimeout()
                      throws java.lang.Exception
java.lang.Exceptionpublic void testCursorResultSetConcurrency0003()
                                        throws java.lang.Exception
 Test CursorResultSet concurrency. Create a number of threads
 that execute concurrent queries using scrollable result sets. All requests
 should be run on the same connection. 
java.lang.Exceptionpublic void testCursorResultSetEmpty0004()
                                  throws java.lang.Exception
java.lang.Exceptionpublic void testPlainResultSetPosition0004()
                                    throws java.lang.Exception
isBeforeFirst, isAfterLast,
 isFirst and isLast methods work for
 forward-only, read-only result sets (bug [1039876] MS SQL
 JtdsResultSet.isAfterLast() always returns false).java.lang.Exception - if an error condition occurspublic void testBitFields0005()
                       throws java.lang.Exception
java.lang.Exceptionpublic void testCallableStatement0006()
                               throws java.lang.Exception
CallableStatements with return values work correctly.java.lang.Exceptionprivate static void insertBigDecimal(java.sql.PreparedStatement stmt,
                    double val,
                    boolean scaleFlag)
                              throws java.lang.Exception
testBigDecimal0007. Inserts a BigDecimal
 value obtained from a double value.stmt - PreparedStatement instanceval - the double value to insertscaleFlag - if true scale the value to 4, otherwise
                  leave it as it isjava.lang.Exceptionpublic void testBigDecimal0007()
                        throws java.lang.Exception
BigDecimals created from double values (i.e with very
 large scales).java.lang.Exceptionpublic void testLongToVarchar0008()
                           throws java.lang.Exception
long values to VARCHAR fields. There was a
 regression introduced in release 0.6 that caused long
 fields to be sent with non-zero scale and appear with decimals when
 written into VARCHAR fields.java.lang.Exceptionpublic void testDeleteRow0009()
                       throws java.lang.Exception
ResultSet.deleteRow() on updateable result sets.java.lang.Exceptionpublic void testCallableStatementVarchar0010()
                                      throws java.lang.Exception
An issue existed, caused by the fact that the parameter was sent to SQL Server as a short VARCHAR (not XORed with 0x80) limiting its length to 255 characters. See bug [815348] for more details.
java.lang.Exceptionpublic void testUpdateRow0011()
                       throws java.lang.Exception
ResultSet.updateRow() on updateable result sets.java.lang.Exceptionpublic void testInsertRow0012()
                       throws java.lang.Exception
ResultSet.insertRow() on updateable result sets.java.lang.Exceptionpublic void testOutOfOrderClose0013()
                             throws java.lang.Exception
Connection first, then the Statement anf
 finally the ResultSet).java.lang.Exceptionpublic void testPreparedAndCallableCursors0014()
                                        throws java.lang.Exception
ResultSets obtained from
 PreparedStatements and CallableStatements.java.lang.Exceptionpublic void testBatchUpdates0015()
                          throws java.lang.Exception
java.lang.Exceptionpublic void testOldDates0016()
                      throws java.lang.Exception
java.lang.Exceptionpublic void testBigDecimal1()
                     throws java.lang.Exception
java.lang.Exceptionpublic void testFloat1()
                throws java.lang.Exception
java.lang.Exceptionpublic void testDatetimeRounding1()
                           throws java.lang.Exception
java.lang.Exceptionpublic void testSocketConcurrency1()
public void testSocketConcurrency2()
public void testSocketConcurrency3()
public void testSocketConcurrency4()
                            throws java.lang.Exception
Statement at the same
 time as cancel() is called on a concurrent
 Statement.java.lang.Exceptionpublic void testNullOutputParameters()
                              throws java.sql.SQLException
null output parameters are handled correctly.
 
 It seems that if a non-nullable type is sent as input value and the
 output value is NULL, SQL Server (not Sybase) gets confused and returns
 the same type but a single 0 byte as value instead of the equivalent
 nullable type (e.g. instead of returning an INTN with
 length 0, which means it's null, it returns an INT4
 followed by a single 0 byte). The output parameter packet length is also
 incorrect, which indicates that SQL Server is confused.
 
 Currently jTDS always sends RPC parameters as nullable types, but this
 test is necessary to ensure that it will always remain so.java.sql.SQLExceptionpublic void testTableParsing()
                      throws java.sql.SQLException
java.sql.SQLExceptionpublic void testFnEscape()
                  throws java.lang.Exception
java.lang.Exceptionpublic void testNestedFunctions()
                         throws java.lang.Exception
Regression test for bug #615, the SQL parser doesn't correctly handle {fn } escapes containing nested (unescaped) functions.
java.lang.Exceptionpublic void testFnEscapeNesting()
                         throws java.lang.Exception
java.lang.Exceptionpublic void testDataTruncException()
                            throws java.lang.Exception
DataTruncation exception.java.lang.Exceptionpublic void testMaxFieldSize()
                      throws java.lang.Exception
Statement.setMaxFieldSize().java.lang.Exceptionpublic void testGetMultiScrollRs()
                          throws java.lang.Exception
java.lang.Exceptionpublic void testUnterminatedCommentParsing()
                                    throws java.lang.Exception
java.lang.Exceptionpublic void testBytesToString()
                       throws java.lang.Exception
java.lang.Exceptionpublic void testExecuteUpdateSelect()
                             throws java.lang.Exception
executeUpdate("SELECT ...") fails.java.lang.Exceptionpublic void testThreadInterrupt()
                         throws java.lang.Exception
java.lang.ExceptionGenerated on June 8 2013