|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjunit.framework.Assert
junit.extensions.TestDecorator
junit.extensions.TestSetup
org.apache.derbyTesting.junit.BaseTestSetup
org.apache.derbyTesting.junit.BaseJDBCTestSetup
org.apache.derbyTesting.functionTests.tests.jdbc4.CallableStatementTestSetup
public class CallableStatementTestSetup
Create the necessary tables, function and procedures for running the CallableStatement tests under JDK 1.6. Java methods used as functions and procedures are also implemented here, along with helper methods that returns CallableStatements for the various functions and procedures.
| Field Summary | |
|---|---|
private static java.lang.String[] |
FUNCTION_DROPS
List of functions to drop on tear-down. |
private static java.lang.String[] |
PROCEDURE_DROPS
List of procedures to drop on tear-down. |
private static java.lang.String |
SOURCECLASS
|
static int |
SQL_NULL_ID
Id for row with SQL NULL values. |
static java.lang.String |
STRING_BYTES
String converted to bytes in UTF-16BE representation. |
static int |
STRING_BYTES_ID
Id for row with byte representation of a string. |
private static java.lang.String[] |
TABLE_DROPS
List of tables to drop on tear-down |
| Fields inherited from class junit.extensions.TestDecorator |
|---|
fTest |
| Constructor Summary | |
|---|---|
CallableStatementTestSetup(junit.framework.Test test)
Create a new test setup for the CallableStatementTest. |
|
| Method Summary | |
|---|---|
static void |
getBinaryDirect(java.lang.String inputString,
byte[][] outputByte)
Procedure creating a byte representation of a string. |
static java.sql.CallableStatement |
getBinaryDirectProcedure(java.sql.Connection con)
Return statement for calling procedure that converts a string to a byte array (UTF-16BE charset). |
static byte[] |
getBinaryFromDb(int id)
Function fetching binary data from the database. |
static java.sql.CallableStatement |
getBinaryFromDbFunction(java.sql.Connection con)
Return statement for calling getBinaryFromDb function. |
static java.sql.CallableStatement |
getIntToStringFunction(java.sql.Connection con)
Return function converting an integer to a string. |
static java.lang.String |
getVarcharFromDb(int id)
Function fetching character data from the database. |
static java.sql.CallableStatement |
getVarcharFromDbFunction(java.sql.Connection con)
Return statement for calling getVarcharFromDb function. |
protected void |
setUp()
|
protected void |
tearDown()
Tear down this fixture, sub-classes should call super.tearDown(). |
| Methods inherited from class org.apache.derbyTesting.junit.BaseJDBCTestSetup |
|---|
getConnection, getTestConfiguration, println |
| Methods inherited from class org.apache.derbyTesting.junit.BaseTestSetup |
|---|
run |
| Methods inherited from class junit.extensions.TestDecorator |
|---|
basicRun, countTestCases, getTest, 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 |
| Field Detail |
|---|
private static final java.lang.String SOURCECLASS
private static final java.lang.String[] TABLE_DROPS
private static final java.lang.String[] FUNCTION_DROPS
private static final java.lang.String[] PROCEDURE_DROPS
public static final int STRING_BYTES_ID
public static final java.lang.String STRING_BYTES
public static final int SQL_NULL_ID
| Constructor Detail |
|---|
public CallableStatementTestSetup(junit.framework.Test test)
test - the test/suite to provide setup for.| Method Detail |
|---|
protected void setUp()
throws java.sql.SQLException
setUp in class junit.extensions.TestSetupjava.sql.SQLException
protected void tearDown()
throws java.lang.Exception
BaseJDBCTestSetup
tearDown in class BaseJDBCTestSetupjava.lang.Exception
public static java.sql.CallableStatement getIntToStringFunction(java.sql.Connection con)
throws java.sql.SQLException
java.sql.SQLException
public static java.sql.CallableStatement getBinaryDirectProcedure(java.sql.Connection con)
throws java.sql.SQLException
java.sql.SQLException
public static java.sql.CallableStatement getBinaryFromDbFunction(java.sql.Connection con)
throws java.sql.SQLException
con - database connection.
java.sql.SQLException
public static java.sql.CallableStatement getVarcharFromDbFunction(java.sql.Connection con)
throws java.sql.SQLException
con - database connection.
java.sql.SQLException
public static void getBinaryDirect(java.lang.String inputString,
byte[][] outputByte)
inputString - a string.outputByte - string returned as UTF-16BE byte representation.
public static byte[] getBinaryFromDb(int id)
throws java.lang.Exception
id - id of row to fetch.
java.lang.Exception
public static java.lang.String getVarcharFromDb(int id)
throws java.lang.Exception
id - id of row to fetch.
java.lang.Exception
|
Built on Sat 2009-11-28 18:44:18-0800, from revision 885187 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||