net.sf.farrago.test
Class FarragoJdbcTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.eigenbase.test.DiffTestCase
              extended by net.sf.farrago.test.ResultSetTestCase
                  extended by net.sf.farrago.test.FarragoJdbcTest
All Implemented Interfaces:
Test

public class FarragoJdbcTest
extends ResultSetTestCase

FarragoJdbcTest tests specifics of the Farrago implementation of the JDBC API. See also unitsql/jdbc/*.sql.

TODO: test:

  1. string too long for char/varchar field
  2. value which converted to char/varchar is too long
  3. various numeric values out of range, e.g. put 65537 in a tinyint
  4. assign boolean to integer columns (becomes 0/1)
  5. assign numerics to boolean (a) small enough, (b)out of range (not 0 or 1)
  6. assign string to everything (a) invalid string format to boolean, numerics (b) valid datetime string to date, time, timestamp
  7. casting betwen incompatible types
  8. set null for nonnullable columns
  9. invalid parameter index

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/test/FarragoJdbcTest.java#72 $
Author:
Tim Leung, John V. Sichi

Nested Class Summary
 class FarragoJdbcTest.FarragoJdbcTester
           
static interface FarragoJdbcTest.JdbcTester
           
protected static class FarragoJdbcTest.TestJavaType
          Defines a Java type.
private static class FarragoJdbcTest.TestSqlApproxType
          Defines class for testing approximate sql type
private static class FarragoJdbcTest.TestSqlDecimalType
          Defines class for testing decimal sql type
private static class FarragoJdbcTest.TestSqlIntegralType
          Defines class for testing integral sql type
private static class FarragoJdbcTest.TestSqlType
          Defines a SQL type, and a corresponding column in the datatypes table, and some operations particular to each type.
 
Field Summary
private static BigDecimal bigDecimalValue
           
private static int BIGINT
           
private static Long bigIntObj
           
private static int BINARY
           
private static int BOOLEAN
           
private static Boolean boolObj
           
private static boolean boolValue
           
private static byte[] bytes
           
private static int CHAR
           
private static String charObj
           
private static String[] columnNames
           
protected static String columnStr
           
protected static String columnTypeStr
           
protected  Connection connection
          JDBC connection to Farrago database.
private static Date date
           
private static int DATE
           
private static Date dateNoTime
           
private static String dateStr
           
private static int DECIMAL
           
private static int DECIMAL73
           
private static BigDecimal decimal73Obj
           
private static BigDecimal decimalObj
           
private static int DOUBLE
           
private static Double doubleObj
           
private static double doubleValue1
           
private static double doubleValue2
           
private static int FLOAT
           
private static Float floatObj
           
private static float floatValue1
           
private static float floatValue2
           
private static int INTEGER
           
private static Integer integerObj
           
private static byte maxByte
           
private static double maxDouble
           
private static float maxFloat
           
private static int maxInt
           
private static long maxLong
           
private static short maxShort
           
private static byte minByte
           
private static double minDouble
           
private static float minFloat
           
private static int minInt
           
private static long minLong
           
private static short minShort
           
protected static String paramStr
           
protected  PreparedStatement preparedStmt
          PreparedStatement for processing queries.
private static int REAL
           
protected static boolean schemaExists
           
private static int SMALLINT
           
private static Short smallIntObj
           
protected  Statement stmt
          Statement for processing queries.
private static String stringValue
           
private static Calendar sydneyCal
          A point of time in Sydney, Australia.
private  FarragoJdbcTest.JdbcTester tester
          Tester to use
private static Time time
           
private static int TIME
           
private static Time timeNoDate
           
private static Timestamp timestamp
           
private static int TIMESTAMP
           
private static Timestamp timestampNoPrec
           
private static String timestampStr
           
private static String timeStr
           
private static int TINYINT
           
private static Byte tinyIntObj
           
private static boolean todo
           
protected static Logger tracer
          Logger to use for test tracing.
protected  Object[] values
           
private static int VARBINARY
           
private static int VARCHAR
           
private static String varcharObj
           
 
Fields inherited from class net.sf.farrago.test.ResultSetTestCase
resultSet
 
Fields inherited from class org.eigenbase.test.DiffTestCase
logFile, logOutputStream, refFile
 
Constructor Summary
FarragoJdbcTest(String testName)
          Creates a new FarragoJdbcTest object.
 
Method Summary
protected static void assertContains(String expected, String actual)
          Asserts that a given string contains a given substring.
static void assertEquals(String message, Object expected, Object actual)
          Overrides Assert.assertEquals(String,Object,Object) to handle byte arrays correctly.
static void assertExceptionMatches(Throwable e, String expectedPattern)
           
private  void assertTimestampBecomes(String expected)
           
protected  boolean checkCancelException(SQLException ex)
           
 void checkPreparedStmtDataTypes(String query)
           
protected  void checkResults(FarragoJdbcTest.TestJavaType javaType)
           
protected  int checkResults(ResultSet resultSet, FarragoJdbcTest.TestJavaType javaType)
           
private  void checkSet(FarragoJdbcTest.TestJavaType javaType, FarragoJdbcTest.TestSqlType[] types, Object value)
           
private  void checkSet(FarragoJdbcTest.TestJavaType javaType, FarragoJdbcTest.TestSqlType sqlType, Object value)
           
private  void checkSetBigDecimal()
           
private  void checkSetBooleanFalse()
           
private  void checkSetByteMax()
           
private  void checkSetByteMin()
           
private  void checkSetBytes()
           
private  void checkSetDate()
           
private  void checkSetDoubleMax()
           
private  void checkSetDoubleMin()
           
private  void checkSetFloat()
           
private  void checkSetFloatMax()
           
private  void checkSetFloatMin()
           
private  void checkSetIntMax()
           
private  void checkSetIntMin()
           
private  void checkSetInvalidIndex(int column)
           
private  void checkSetLongMax()
           
private  void checkSetLongMin()
           
private  void checkSetNull()
           
private  void checkSetObject()
           
private  void checkSetShortMax()
           
private  void checkSetShortMin()
           
private  void checkSetString()
           
private  void checkSetTime()
           
private  void checkSetTimestamp()
           
private  boolean checkThrowable(String error, String expectedPattern, Throwable throwable)
           
private  void doEmpInsert(String name, int i)
           
private  void executeAndCancel(String sql, int waitMillis)
           
protected  FarragoJdbcTest.JdbcTester getTester(String name)
           
protected  File getTestlogRoot()
           
 void insertDataTypes()
           
private static Calendar makeCalendar(String tz, int year, int month, int date, int hour, int minute, int second, int millis)
          Creates a calendar.
private  void prepareAndCancel(String sql, int waitMillis)
           
protected  void queryCancel(boolean synchronous, String executorType)
           
protected  void queryCancel(int waitMillis, String executorType, boolean subquery)
           
protected  void quietlyDropSchema(String schemaName)
           
private  void repeatQuery(boolean flushCache)
           
protected  void setUp()
           
private  void setValidateOnPrepare(boolean currSetting, boolean newSetting)
           
static Test suite()
           
protected  void tearDown()
           
 void testCachedQuery()
          Tests re-execution of an unprepared query.
 void testChar()
          Tests char and varchar Data Type in JDBC.
 void testCheckParametersSet()
           
 void testCreateView()
           
 void testCreateViewNegative()
          Tests that a DDL statement fails because we have not specified a target schema.
 void testDataTypes()
           
 void testDateTimeSql()
          Tests sql Date/Time to java.sql Date/Time translations.
 void testDdlNoValidateOnPrepare()
          Verifies that DDL statements are not validated at prepare time, but at execution time
 void testDdlValidateOnPrepare()
          Verifies that DDL statements are validated at prepare time, not just execution time.
 void testDynamicParameter()
          Tests valid usage of a dynamic parameter and retrieval of associated metadata.
 void testDynamicParameterExecuteImmediate()
          Tests invalid attempt to execute a statement with a dynamic parameter without preparation.
 void testDynamicParameterInUpdate()
          Tests metadata for dynamic parameter in an UPDATE statement.
 void testEarlyCancel()
           
 void testFennelQueryAsynchronousCancel()
           
 void testFennelQuerySynchronousCancel()
           
 void testFoo()
           
 void testInteger()
          Tests integer Data Type in JDBC.
 void testInvalidDynamicParameter()
          Tests invalid usage of a dynamic parameter.
 void testJavaQueryAsynchronousCancel()
           
 void testJavaQueryAsynchronousCancelRepeated()
           
 void testJavaQuerySynchronousCancel()
           
 void testMaxRows()
          Tests Statement.setMaxRows(int).
 void testMultipleDynamicParameters1()
          Tests valid usage of multiple dynamic parameters.
 void testMultipleDynamicParameters2()
          Tests valid usage of multiple dynamic parameters, including the fix for FRG-72.
 void testOrphans()
          Tests orphan statement and resultset cleanup.
 void testPlannerCancel()
           
 void testPreparedMetaData()
          Tests retrieval of ResultSetMetaData without actually executing query.
 void testPreparedQuery()
          Tests re-execution of a prepared query.
 void testPreparedStmtDataTypes()
           
 void testSetTimestamp()
          Tests inserting timestamp values via a dynamic parameter with and without a calendar object.
 void testSubqueryCancel()
           
 void testTimeout()
          Tests setQueryTimeout.
 void testUdxAsynchronousCancel()
           
 void testUdxSynchronousCancel()
           
 void testUncachedQuery()
          Tests re-execution of an unprepared query with statement caching disabled.
private  String toString(Object o)
           
protected  String toStringThreadInfo(Thread thread)
          Returns string representation of thread info.
private  boolean tryExecuteQuery(PreparedStatement stmt)
          attempts executeQuery on a PreparedStatement.
private  boolean tryExecuteQuery(Statement stmt, String sql)
          attempts executeQuery on a plain Statement.
private  boolean tryResultSet(ResultSet rset)
          attempts to use a ResultSet.
protected  void udxCancel(boolean synchronous)
           
protected  void udxCancel(int waitMillis)
           
 
Methods inherited from class net.sf.farrago.test.ResultSetTestCase
compareResultList, compareResultLists, compareResultSet, compareResultSetWithDelta, compareResultSetWithPattern, getResultSetCount
 
Methods inherited from class org.eigenbase.test.DiffTestCase
addDiffMask, addIgnorePattern, diffFile, diffLines, diffTestLog, fileContents, openTestLog, openTestLogOutputStream, setGC, setRefFileDiffMasks, setVerbose
 
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, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tracer

protected static final Logger tracer
Logger to use for test tracing.


minByte

private static final byte minByte
See Also:
Constant Field Values

maxByte

private static final byte maxByte
See Also:
Constant Field Values

minShort

private static final short minShort
See Also:
Constant Field Values

maxShort

private static final short maxShort
See Also:
Constant Field Values

minInt

private static final int minInt
See Also:
Constant Field Values

maxInt

private static final int maxInt
See Also:
Constant Field Values

minLong

private static final long minLong
See Also:
Constant Field Values

maxLong

private static final long maxLong
See Also:
Constant Field Values

minFloat

private static final float minFloat
See Also:
Constant Field Values

maxFloat

private static final float maxFloat
See Also:
Constant Field Values

floatValue1

private static final float floatValue1
See Also:
Constant Field Values

floatValue2

private static final float floatValue2
See Also:
Constant Field Values

minDouble

private static final double minDouble
See Also:
Constant Field Values

maxDouble

private static final double maxDouble
See Also:
Constant Field Values

doubleValue1

private static final double doubleValue1
See Also:
Constant Field Values

doubleValue2

private static final double doubleValue2
See Also:
Constant Field Values

boolValue

private static final boolean boolValue
See Also:
Constant Field Values

bigDecimalValue

private static final BigDecimal bigDecimalValue

stringValue

private static final String stringValue
See Also:
Constant Field Values

bytes

private static final byte[] bytes

sydneyCal

private static final Calendar sydneyCal
A point of time in Sydney, Australia. (The timezone is deliberately not PST, where the test is likely to be run, or GMT, and should be in daylight-savings time in December.) 4:22:33.456 PM on 21st December 2004 Japan (GMT+9) is 9 hours earlier in GMT, namely 7:22:33.456 AM on 21st December 2004 GMT and is another 8 hours earlier in PST: 11:22:33.456 PM on 20th December 2004 PST (GMT-8)


time

private static final Time time

date

private static final Date date

timestamp

private static final Timestamp timestamp

dateStr

private static final String dateStr

timeStr

private static final String timeStr

timestampStr

private static final String timestampStr

timeNoDate

private static final Time timeNoDate

dateNoTime

private static final Date dateNoTime

timestampNoPrec

private static final Timestamp timestampNoPrec

tinyIntObj

private static final Byte tinyIntObj

smallIntObj

private static final Short smallIntObj

integerObj

private static final Integer integerObj

bigIntObj

private static final Long bigIntObj

floatObj

private static final Float floatObj

doubleObj

private static final Double doubleObj

boolObj

private static final Boolean boolObj

decimalObj

private static final BigDecimal decimalObj

decimal73Obj

private static final BigDecimal decimal73Obj

charObj

private static final String charObj
See Also:
Constant Field Values

varcharObj

private static final String varcharObj
See Also:
Constant Field Values

TINYINT

private static final int TINYINT
See Also:
Constant Field Values

SMALLINT

private static final int SMALLINT
See Also:
Constant Field Values

INTEGER

private static final int INTEGER
See Also:
Constant Field Values

BIGINT

private static final int BIGINT
See Also:
Constant Field Values

REAL

private static final int REAL
See Also:
Constant Field Values

FLOAT

private static final int FLOAT
See Also:
Constant Field Values

DOUBLE

private static final int DOUBLE
See Also:
Constant Field Values

BOOLEAN

private static final int BOOLEAN
See Also:
Constant Field Values

CHAR

private static final int CHAR
See Also:
Constant Field Values

VARCHAR

private static final int VARCHAR
See Also:
Constant Field Values

BINARY

private static final int BINARY
See Also:
Constant Field Values

VARBINARY

private static final int VARBINARY
See Also:
Constant Field Values

TIME

private static final int TIME
See Also:
Constant Field Values

DATE

private static final int DATE
See Also:
Constant Field Values

TIMESTAMP

private static final int TIMESTAMP
See Also:
Constant Field Values

DECIMAL

private static final int DECIMAL
See Also:
Constant Field Values

DECIMAL73

private static final int DECIMAL73
See Also:
Constant Field Values

schemaExists

protected static boolean schemaExists

columnNames

private static final String[] columnNames

columnTypeStr

protected static String columnTypeStr

columnStr

protected static String columnStr

paramStr

protected static String paramStr

todo

private static final boolean todo
See Also:
Constant Field Values

values

protected Object[] values

tester

private FarragoJdbcTest.JdbcTester tester
Tester to use


connection

protected Connection connection
JDBC connection to Farrago database.


preparedStmt

protected PreparedStatement preparedStmt
PreparedStatement for processing queries.


stmt

protected Statement stmt
Statement for processing queries.

Constructor Detail

FarragoJdbcTest

public FarragoJdbcTest(String testName)
                throws Exception
Creates a new FarragoJdbcTest object.

Throws:
Exception
Method Detail

getTester

protected FarragoJdbcTest.JdbcTester getTester(String name)
                                        throws Exception
Throws:
Exception

getTestlogRoot

protected File getTestlogRoot()
                       throws Exception
Specified by:
getTestlogRoot in class DiffTestCase
Returns:
the root under which testlogs should be written
Throws:
Exception

suite

public static Test suite()

makeCalendar

private static Calendar makeCalendar(String tz,
                                     int year,
                                     int month,
                                     int date,
                                     int hour,
                                     int minute,
                                     int second,
                                     int millis)
Creates a calendar.


testJavaQuerySynchronousCancel

public void testJavaQuerySynchronousCancel()
                                    throws Exception
Throws:
Exception

testJavaQueryAsynchronousCancel

public void testJavaQueryAsynchronousCancel()
                                     throws Exception
Throws:
Exception

testJavaQueryAsynchronousCancelRepeated

public void testJavaQueryAsynchronousCancelRepeated()
                                             throws Exception
Throws:
Exception

testFennelQuerySynchronousCancel

public void testFennelQuerySynchronousCancel()
                                      throws Exception
Throws:
Exception

testFennelQueryAsynchronousCancel

public void testFennelQueryAsynchronousCancel()
                                       throws Exception
Throws:
Exception

testUdxSynchronousCancel

public void testUdxSynchronousCancel()
                              throws Exception
Throws:
Exception

testUdxAsynchronousCancel

public void testUdxAsynchronousCancel()
                               throws Exception
Throws:
Exception

testSubqueryCancel

public void testSubqueryCancel()
                        throws Exception
Throws:
Exception

testPlannerCancel

public void testPlannerCancel()
                       throws Exception
Throws:
Exception

testEarlyCancel

public void testEarlyCancel()
                     throws Exception
Throws:
Exception

queryCancel

protected void queryCancel(boolean synchronous,
                           String executorType)
                    throws Exception
Throws:
Exception

queryCancel

protected void queryCancel(int waitMillis,
                           String executorType,
                           boolean subquery)
                    throws Exception
Throws:
Exception

udxCancel

protected void udxCancel(boolean synchronous)
                  throws Exception
Throws:
Exception

udxCancel

protected void udxCancel(int waitMillis)
                  throws Exception
Throws:
Exception

checkCancelException

protected boolean checkCancelException(SQLException ex)

executeAndCancel

private void executeAndCancel(String sql,
                              int waitMillis)
                       throws SQLException
Throws:
SQLException

prepareAndCancel

private void prepareAndCancel(String sql,
                              int waitMillis)
                       throws SQLException
Throws:
SQLException

testCheckParametersSet

public void testCheckParametersSet()
                            throws Exception
Throws:
Exception

testPreparedStmtDataTypes

public void testPreparedStmtDataTypes()
                               throws Exception
Throws:
Exception

checkPreparedStmtDataTypes

public void checkPreparedStmtDataTypes(String query)
                                throws Exception
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class DiffTestCase
Throws:
Exception

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class DiffTestCase
Throws:
Exception

checkSetObject

private void checkSetObject()
                     throws SQLException
Throws:
SQLException

checkSetTimestamp

private void checkSetTimestamp()
                        throws Exception
Throws:
Exception

checkSetTime

private void checkSetTime()
                   throws Exception
Throws:
Exception

checkSetDate

private void checkSetDate()
                   throws Exception
Throws:
Exception

checkSetBytes

private void checkSetBytes()
                    throws Exception
Throws:
Exception

checkSetBigDecimal

private void checkSetBigDecimal()
                         throws Exception
Throws:
Exception

checkSetBooleanFalse

private void checkSetBooleanFalse()
                           throws Exception
Throws:
Exception

checkSetDoubleMax

private void checkSetDoubleMax()
                        throws Exception
Throws:
Exception

checkSetDoubleMin

private void checkSetDoubleMin()
                        throws Exception
Throws:
Exception

checkSetFloatMax

private void checkSetFloatMax()
                       throws Exception
Throws:
Exception

checkSetFloat

private void checkSetFloat()
                    throws Exception
Throws:
Exception

checkSetFloatMin

private void checkSetFloatMin()
                       throws Exception
Throws:
Exception

checkSetLongMax

private void checkSetLongMax()
                      throws Exception
Throws:
Exception

checkSetLongMin

private void checkSetLongMin()
                      throws Exception
Throws:
Exception

checkSetIntMax

private void checkSetIntMax()
                     throws Exception
Throws:
Exception

checkSetIntMin

private void checkSetIntMin()
                     throws Exception
Throws:
Exception

checkSetShortMax

private void checkSetShortMax()
                       throws Exception
Throws:
Exception

checkSetShortMin

private void checkSetShortMin()
                       throws Exception
Throws:
Exception

checkSetByteMax

private void checkSetByteMax()
                      throws Exception
Throws:
Exception

checkSetByteMin

private void checkSetByteMin()
                      throws Exception
Throws:
Exception

checkSetNull

private void checkSetNull()
                   throws Exception
Throws:
Exception

checkSetString

private void checkSetString()
                     throws Exception
Throws:
Exception

checkResults

protected int checkResults(ResultSet resultSet,
                           FarragoJdbcTest.TestJavaType javaType)
                    throws SQLException
Throws:
SQLException

checkResults

protected void checkResults(FarragoJdbcTest.TestJavaType javaType)
                     throws SQLException
Throws:
SQLException

assertEquals

public static void assertEquals(String message,
                                Object expected,
                                Object actual)
Overrides Assert.assertEquals(String,Object,Object) to handle byte arrays correctly.


toString

private String toString(Object o)

toStringThreadInfo

protected String toStringThreadInfo(Thread thread)
Returns string representation of thread info.


checkSet

private void checkSet(FarragoJdbcTest.TestJavaType javaType,
                      FarragoJdbcTest.TestSqlType[] types,
                      Object value)
               throws Exception
Throws:
Exception

checkThrowable

private boolean checkThrowable(String error,
                               String expectedPattern,
                               Throwable throwable)

checkSet

private void checkSet(FarragoJdbcTest.TestJavaType javaType,
                      FarragoJdbcTest.TestSqlType sqlType,
                      Object value)
               throws Exception
Throws:
Exception

checkSetInvalidIndex

private void checkSetInvalidIndex(int column)
                           throws Exception
Throws:
Exception

insertDataTypes

public void insertDataTypes()
                     throws Exception
Throws:
Exception

testDataTypes

public void testDataTypes()
                   throws Exception
Throws:
Exception

testDateTimeSql

public void testDateTimeSql()
                     throws Exception
Tests sql Date/Time to java.sql Date/Time translations.

Throws:
Exception

testTimeout

public void testTimeout()
                 throws Exception
Tests setQueryTimeout.

Throws:
Exception - .

testOrphans

public void testOrphans()
                 throws Exception
Tests orphan statement and resultset cleanup. REVIEW: test ALL Statement methods?

Throws:
Exception

testChar

public void testChar()
              throws Exception
Tests char and varchar Data Type in JDBC.

Throws:
Exception - .

assertExceptionMatches

public static void assertExceptionMatches(Throwable e,
                                          String expectedPattern)

doEmpInsert

private void doEmpInsert(String name,
                         int i)
                  throws SQLException
Throws:
SQLException

testInteger

public void testInteger()
                 throws Exception
Tests integer Data Type in JDBC.

Throws:
Exception - .

testPreparedQuery

public void testPreparedQuery()
                       throws Exception
Tests re-execution of a prepared query.

Throws:
Exception - .

testCachedQuery

public void testCachedQuery()
                     throws Exception
Tests re-execution of an unprepared query. There's no black-box way to verify that caching is working, but if it is, this will at least exercise it.

Throws:
Exception - .

testUncachedQuery

public void testUncachedQuery()
                       throws Exception
Tests re-execution of an unprepared query with statement caching disabled.

Throws:
Exception - .

repeatQuery

private void repeatQuery(boolean flushCache)
                  throws Exception
Throws:
Exception

testPreparedMetaData

public void testPreparedMetaData()
                          throws Exception
Tests retrieval of ResultSetMetaData without actually executing query.

Throws:
Exception

testDdlValidateOnPrepare

public void testDdlValidateOnPrepare()
Verifies that DDL statements are validated at prepare time, not just execution time.


testDdlNoValidateOnPrepare

public void testDdlNoValidateOnPrepare()
Verifies that DDL statements are not validated at prepare time, but at execution time


setValidateOnPrepare

private void setValidateOnPrepare(boolean currSetting,
                                  boolean newSetting)

testDynamicParameter

public void testDynamicParameter()
                          throws Exception
Tests valid usage of a dynamic parameter and retrieval of associated metadata.

Throws:
Exception

testMultipleDynamicParameters1

public void testMultipleDynamicParameters1()
                                    throws Exception
Tests valid usage of multiple dynamic parameters.

Throws:
Exception

testMultipleDynamicParameters2

public void testMultipleDynamicParameters2()
                                    throws Exception
Tests valid usage of multiple dynamic parameters, including the fix for FRG-72.

Throws:
Exception

testDynamicParameterInUpdate

public void testDynamicParameterInUpdate()
                                  throws Exception
Tests metadata for dynamic parameter in an UPDATE statement.

Throws:
Exception

testInvalidDynamicParameter

public void testInvalidDynamicParameter()
                                 throws Exception
Tests invalid usage of a dynamic parameter.

Throws:
Exception

testDynamicParameterExecuteImmediate

public void testDynamicParameterExecuteImmediate()
                                          throws Exception
Tests invalid attempt to execute a statement with a dynamic parameter without preparation.

Throws:
Exception

testMaxRows

public void testMaxRows()
                 throws Exception
Tests Statement.setMaxRows(int).

Throws:
Exception

quietlyDropSchema

protected void quietlyDropSchema(String schemaName)

testFoo

public void testFoo()
             throws SQLException
Throws:
SQLException

testCreateView

public void testCreateView()
                    throws SQLException
Throws:
SQLException

testCreateViewNegative

public void testCreateViewNegative()
                            throws SQLException
Tests that a DDL statement fails because we have not specified a target schema.

Throws:
SQLException

assertContains

protected static void assertContains(String expected,
                                     String actual)
Asserts that a given string contains a given substring. Throws AssertionFailedError if not.

Parameters:
expected - Expected substring
actual - String

tryExecuteQuery

private boolean tryExecuteQuery(Statement stmt,
                                String sql)
attempts executeQuery on a plain Statement.


tryExecuteQuery

private boolean tryExecuteQuery(PreparedStatement stmt)
attempts executeQuery on a PreparedStatement.


tryResultSet

private boolean tryResultSet(ResultSet rset)
attempts to use a ResultSet.


testSetTimestamp

public void testSetTimestamp()
                      throws SQLException
Tests inserting timestamp values via a dynamic parameter with and without a calendar object.

Throws:
SQLException
See Also:
PreparedStatement.setTimestamp(int, java.sql.Timestamp), PreparedStatement.setTimestamp(int, java.sql.Timestamp, java.util.Calendar)

assertTimestampBecomes

private void assertTimestampBecomes(String expected)
                             throws SQLException
Throws:
SQLException