|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.derbyTesting.junit.BaseTestCase
org.apache.derbyTesting.junit.BaseJDBCTestCase
org.apache.derbyTesting.functionTests.tests.jdbcapi.CallableTest
public class CallableTest
Test the CallableStatement interface.
This test converts the old derbynet/callable.java test to JUnit. It exercises the CallableStatement interface with various combinations of IN, OUT and INOUT registered parameters, SQL functions and procedures, and different data types.
| Field Summary | |
|---|---|
private static java.lang.String |
NOT_IMPLEMENTED
|
private static java.lang.String[] |
ROUTINES
Routines that should be created before the tests are run and dropped when the tests have finished. |
private static java.lang.String[][] |
TABLES
Tables that should be created before the tests are run and dropped when the tests have finished. |
| Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase |
|---|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE |
| Constructor Summary | |
|---|---|
CallableTest(java.lang.String name)
Creates a new CallableTest instance. |
|
| Method Summary | |
|---|---|
void |
assertDecimalSameValue(java.lang.String message,
java.lang.String expected_s,
java.math.BigDecimal actual)
Wrapper for BigDecimal compareTo. |
private static junit.framework.Test |
baseSuite(java.lang.String name)
|
static void |
batchUpdateProc(int id,
int id_newval)
External code for the BATCH_UPDATE_PROC SQL procedure, which updates data in a table for a given id. |
static void |
bigDecimalInAndOutProc(java.math.BigDecimal bd1,
java.math.BigDecimal[] bdr1,
java.math.BigDecimal bd2,
java.math.BigDecimal[] bdr2,
java.math.BigDecimal[] bdr3,
java.math.BigDecimal[] bdr4,
java.math.BigDecimal[] bdr5,
java.math.BigDecimal[] bdr6,
java.math.BigDecimal[] bdr7)
External code for the BIGDECIMAL_IN_AND_OUT_PROC SQL procedure, which tests INT and OUT parameters with the BigDecimal data type. |
static void |
manyTypesInAndOutProc(java.sql.Date dt,
java.sql.Time t,
java.sql.Timestamp ts,
byte[] ba,
java.sql.Date[] dtr,
java.sql.Time[] tr,
java.sql.Timestamp[] tsr,
byte[][] bar)
External code for the NON_NUMERIC_TYPES_IN_AND_OUT_PROC SQL procedure, which tests IN / OUT parameters with many non-numeric types. |
static void |
manyTypesInAndOutProc(short s,
int i,
long l,
float f,
double d,
java.math.BigDecimal bd,
short[] sr,
int[] ir,
long[] lr,
float[] fr,
double[] dr,
java.math.BigDecimal[] bdr)
External code for the NUMERIC_TYPES_IN_AND_OUT_PROC SQL procedure, which tests IN and OUT parameters with many numeric types. |
static void |
manyTypesInoutProc(short s1,
short[] s2,
int p1,
int[] p2,
long l1,
long[] l2,
float f1,
float[] f2,
double d1,
double[] d2,
java.sql.Time t1,
java.sql.Time[] t2)
External code for the MANY_TYPES_INOUT_PROC SQL procedure, which tests INOUT parameters with many types. |
static int |
noInOneOutFunc()
External code for the NO_IN_ONE_OUT_FUNC SQL function, which takes no parameters and returns the value 55. |
void |
norun_testSystemOutPrintlnProc()
Calls a SQL procedure that outputs a message with System.out.println. |
static void |
numericBoundariesProc(java.math.BigDecimal[] param1,
java.math.BigDecimal[] param2,
java.math.BigDecimal[] param3)
External code for the NUMERIC_BOUNDARIES_PROC SQL procedure, which fetches max, min, and null values from a table with numeric columns. |
static int |
oneInOneOutFunc(int p1)
External code for the ONE_IN_ONE_OUT_FUNC SQL function, which squares the value of the input arg, then adds the input arg to that result. |
void |
setUp()
Sets up the connection for a test case and clears all tables used in the test cases. |
static junit.framework.Test |
suite()
|
static void |
systemOutPrintlnProc()
External code for the SYSTEM_OUT_PRINTLN_PROC SQL procedure, which outputs a message to System out. |
void |
testIsolationLevelChangeAfterFunctionCall()
|
void |
testManyTypesInoutProc()
Calls a SQL procedure that takes INOUT parameters of various types. |
void |
testNoInOneOutFunc()
Calls a SQL function that takes no input parameter and returns one output. |
void |
testNonNumericTypesInAndOutProc()
Calls a SQL procedure that takes non-numeric IN and OUT parameters. |
void |
testOneInOneOutFunc()
Calls a SQL function with one input parameter and one output. |
void |
testTwoInOneOutProc()
Calls a SQL procedure with two input parameters and one output. |
static void |
twoInOneOutProc(int p1,
int p2,
int[] p3)
External code for the TWO_IN_ONE_OUT_PROC SQL procedure, which sets the value of the third arg to the sum of the first two. |
static void |
updateLongVarbinaryProc(byte[] in_param)
External code for the UPDATE_LONGVARBINARY_PROC SQL procedure, which sets the value of the Long varbinary column in the LONGVARBINARY_TABLE table given the input parameter. |
void |
xtestBatchUpdate()
Batches up calls to a SQL procedure that updates a value in a table. |
void |
xtestBatchUpdateError()
Batches up many calls to a SQL procedure that updates a value in a table. |
void |
xtestBigDecimalInAndOutProc()
Calls a SQL procedure with BigDecimal IN and OUT parameters. |
void |
xtestNumericBoundariesProc()
Calls a SQL procedure that populates OUT parameters with minimum, maximum, and null values fetched from a table with numeric columns. |
void |
xtestNumericTypesInAndOutProc()
Calls a SQL procedure that takes numeric IN and OUT parameters. |
void |
xtestRegUserDefOutParameterError()
Tries to register a user-defined OUT parameter, which isn't supported and is expected to throw a "not implemented" exception. |
void |
xtestUpdateLongBinaryProc()
Calls a SQL procedure that updates a long varbinary column. |
| Methods inherited from class org.apache.derbyTesting.junit.BaseTestCase |
|---|
alarm, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertSecurityManager, assertThrowableEquals, execJavaCmd, fail, getFailureFolder, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeSystemProperty, runBare, setSystemProperty, traceit |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, 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 |
| Field Detail |
|---|
private static final java.lang.String NOT_IMPLEMENTED
private static final java.lang.String[] ROUTINES
private static final java.lang.String[][] TABLES
| Constructor Detail |
|---|
public CallableTest(java.lang.String name)
CallableTest instance.
name - name of the test| Method Detail |
|---|
public static junit.framework.Test suite()
private static junit.framework.Test baseSuite(java.lang.String name)
public void setUp()
throws java.sql.SQLException
setUp in class junit.framework.TestCasejava.sql.SQLException
public void testTwoInOneOutProc()
throws java.sql.SQLException
java.sql.SQLException
public void testOneInOneOutFunc()
throws java.sql.SQLException
java.sql.SQLException
public void testNoInOneOutFunc()
throws java.sql.SQLException
java.sql.SQLException
public void testIsolationLevelChangeAfterFunctionCall()
throws java.sql.SQLException
java.sql.SQLException
public void norun_testSystemOutPrintlnProc()
throws java.sql.SQLException
java.sql.SQLException
public void xtestNumericTypesInAndOutProc()
throws java.sql.SQLException
java.sql.SQLException
public void testNonNumericTypesInAndOutProc()
throws java.sql.SQLException
java.sql.SQLException
public void testManyTypesInoutProc()
throws java.sql.SQLException
java.sql.SQLException
public void xtestRegUserDefOutParameterError()
throws java.sql.SQLException
java.sql.SQLException
public void xtestUpdateLongBinaryProc()
throws java.sql.SQLException
java.sql.SQLException
public void xtestBatchUpdate()
throws java.sql.SQLException
java.sql.SQLException
public void xtestBatchUpdateError()
throws java.sql.SQLException
java.sql.SQLException
public void xtestNumericBoundariesProc()
throws java.sql.SQLException
java.sql.SQLException
public void xtestBigDecimalInAndOutProc()
throws java.sql.SQLException
java.sql.SQLException
public void assertDecimalSameValue(java.lang.String message,
java.lang.String expected_s,
java.math.BigDecimal actual)
public static int oneInOneOutFunc(int p1)
p1 - integer input argument to be used in calculation
public static void twoInOneOutProc(int p1,
int p2,
int[] p3)
p1 - integer input parameter to be used in calculationp2 - integer input parameter to be used in calculationp3 - integer output parameter that stores result of the calculationpublic static int noInOneOutFunc()
public static void systemOutPrintlnProc()
public static void updateLongVarbinaryProc(byte[] in_param)
throws java.sql.SQLException
in_param - input parameter to be used for database update
java.sql.SQLException - if a database error occurs
public static void numericBoundariesProc(java.math.BigDecimal[] param1,
java.math.BigDecimal[] param2,
java.math.BigDecimal[] param3)
throws java.sql.SQLException
param1 - output parameter that returns maxcol valueparam2 - output parameter that returns mincol valueparam3 - output parameter that returns nulcol value
java.sql.SQLException - if a database error occurs
public static void bigDecimalInAndOutProc(java.math.BigDecimal bd1,
java.math.BigDecimal[] bdr1,
java.math.BigDecimal bd2,
java.math.BigDecimal[] bdr2,
java.math.BigDecimal[] bdr3,
java.math.BigDecimal[] bdr4,
java.math.BigDecimal[] bdr5,
java.math.BigDecimal[] bdr6,
java.math.BigDecimal[] bdr7)
bd1 - input parameterbdr1 - output parameter set to bd1 * bd2bd2 - input parameterbdr2 - output parameter set to bd1 + bd2bdr3 - output parameter set to a fixed valuebdr4 - output parameter set to a fixed valuebdr5 - output parameter set to a fixed valuebdr6 - output parameter set to a fixed valuebdr7 - output parameter set to a fixed value
public static void manyTypesInAndOutProc(short s,
int i,
long l,
float f,
double d,
java.math.BigDecimal bd,
short[] sr,
int[] ir,
long[] lr,
float[] fr,
double[] dr,
java.math.BigDecimal[] bdr)
s - short input parameteri - int input parameterl - long input parameterf - float input parameterd - double input parameterbd - BigDecimal input parametersr - short output parameterir - int output parameterlr - long output parameterfr - float output parameterdr - double output parameterbdr - BigDecimal output parameter
public static void manyTypesInAndOutProc(java.sql.Date dt,
java.sql.Time t,
java.sql.Timestamp ts,
byte[] ba,
java.sql.Date[] dtr,
java.sql.Time[] tr,
java.sql.Timestamp[] tsr,
byte[][] bar)
dt - date input parametert - time input parameterts - timestamp input parameterba - byte input parameterdtr - date output parametertr - time output parametertsr - timestamp output parameterbar - byte output parameter
public static void manyTypesInoutProc(short s1,
short[] s2,
int p1,
int[] p2,
long l1,
long[] l2,
float f1,
float[] f2,
double d1,
double[] d2,
java.sql.Time t1,
java.sql.Time[] t2)
s1 - short input parameters2 - short output parameterp1 - int input parameterp2 - int output parameterl1 - long input parameterl2 - long output parameterf1 - float input parameterf2 - float output parameterd1 - double input parameterd2 - double output parametert1 - time input parametert2 - time output parameter
public static void batchUpdateProc(int id,
int id_newval)
throws java.sql.SQLException
id - Id to be updatedid_newval - New value to which the id should be updated
java.sql.SQLException - if a database error occurs
|
Built on Wed 2009-11-25 18:43:31-0800, from revision 884373 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||