org.apache.derbyTesting.functionTests.tests.lang
Class AnsiSignaturesTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.derbyTesting.junit.BaseTestCase
              extended by org.apache.derbyTesting.junit.BaseJDBCTestCase
                  extended by org.apache.derbyTesting.functionTests.tests.lang.AnsiSignaturesTest
All Implemented Interfaces:
junit.framework.Test

public class AnsiSignaturesTest
extends BaseJDBCTestCase

Test that Derby resolves routines according to the ANSI method resolution rules. Those rules are summarized in DERBY-3652.


Field Summary
static java.lang.String AMBIGUOUS
           
static java.lang.String MISSING_METHOD_SQLSTATE
           
static java.lang.String TRIED_ALL_COMBINATIONS
           
 
Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
 
Constructor Summary
AnsiSignaturesTest(java.lang.String name)
          Create a new instance.
 
Method Summary
private  void declareAndFailFunction(java.lang.String name, java.lang.String returnType, java.lang.String[] argTypes, java.lang.String args, java.lang.String result, java.lang.String sqlstate)
           Declare and run a function and expect the function to fail.
private  void declareAndRunFunction(java.lang.String name, java.lang.String returnType, java.lang.String[] argTypes, java.lang.String args, java.lang.String result)
           Declare and run a function.
private  void declareFunction(java.sql.Connection conn, java.lang.String name, java.lang.String returnType, java.lang.String[] argTypes)
           Declare a function with the given name, return type, and argument type.
private  java.lang.String doubleQuote(java.lang.String raw)
           
private  void runFunction(java.sql.Connection conn, java.lang.String name, java.lang.String args, java.lang.String result, java.lang.String sqlstate)
           Run a function.
static junit.framework.Test suite()
          Construct top level suite in this JUnit test
 void test_bigint__smallint_int_bigint_real_double()
           
 void test_bigint_amb_byte_long()
           
 void test_bigint_amb_long_long()
           
 void test_bigint_amb_Long_long()
           
 void test_bigint_badreturn_byte_long()
           
 void test_bigint_long_long()
           
 void test_bigint_long_Long()
           
 void test_bigint_Long_long()
           
 void test_bigint_Long_Long()
           
 void test_bigint_unres_long()
           
 void test_bigint_unres_Long()
           
 void test_binary_badreturn_bytes_bytes()
           
 void test_binary_bytes_bytes()
           
 void test_binary_bytes_int()
           
 void test_blob_Blob_String()
           
 void test_char_String_String()
           
 void test_clob_Clob_String()
           
 void test_date_Date_Date()
           
 void test_decimal_BigDecimal_BigDecimal()
           
 void test_double_amb_byte_double()
           
 void test_double_amb_double_double()
           
 void test_double_amb_Double_double()
           
 void test_double_badreturn_byte_double()
           
 void test_double_double_double()
           
 void test_double_double_Double()
           
 void test_double_Double_double()
           
 void test_double_Double_Double()
           
 void test_double_unres_double()
           
 void test_double_unres_Double()
           
 void test_flipped_bigint__smallint_int_bigint_real_double()
           
 void test_integer_amb_byte_int()
           
 void test_integer_amb_int_int()
           
 void test_integer_amb_Integer_int()
           
 void test_integer_badreturn_byte_int()
           
 void test_integer_int_int()
           
 void test_integer_int_Integer()
           
 void test_integer_Integer_int()
           
 void test_integer_Integer_Integer()
           
 void test_integer_unres_int()
           
 void test_integer_unres_Integer()
           
 void test_longvarbinary_badreturn_bytes_bytes()
           
 void test_longvarbinary_bytes_bytes()
           
 void test_longvarbinary_bytes_int()
           
 void test_longvarchar_String_String()
           
 void test_numeric_BigDecimal_BigDecimal()
           
 void test_real_amb_byte_float()
           
 void test_real_amb_float_float()
           
 void test_real_amb_Float_float()
           
 void test_real_badreturn_byte_float()
           
 void test_real_float_float()
           
 void test_real_float_Float()
           
 void test_real_Float_float()
           
 void test_real_Float_Float()
           
 void test_real_unres_float()
           
 void test_real_unres_Float()
           
 void test_smallint_amb_byte_short()
           
 void test_smallint_amb_Integer_short()
           
 void test_smallint_amb_short_short()
           
 void test_smallint_bad_short_Short()
           
 void test_smallint_bad_Short_short()
           
 void test_smallint_bad_Short_Short()
           
 void test_smallint_badreturn_byte_short()
           
 void test_smallint_Integer_Integer()
           
 void test_smallint_Integer_short()
           
 void test_smallint_short_Integer()
           
 void test_smallint_short_short()
           
 void test_smallint_unres_short()
           
 void test_smallint_unres_Short()
           
 void test_time_Time_Time()
           
 void test_timestamp_Timestamp_Timestamp()
           
 void test_varbinary_badreturn_bytes_bytes()
           
 void test_varbinary_bytes_bytes()
           
 void test_varbinary_bytes_int()
           
 void test_varchar_String_String()
           
 
Methods inherited from class org.apache.derbyTesting.junit.BaseJDBCTestCase
assertCallError, assertCheckTable, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertGetIntError, assertNextError, assertPreparedStatementError, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertTableRowCount, assertUpdateCount, assertUpdateCount, checkAllConsistency, checkEstimatedRowCount, commit, createStatement, createStatement, createStatement, dropTable, dropTable, getConnection, getDatabaseProperty, getLastSQLException, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runScript, runScript, runSQLCommands, setAutoCommit, tearDown, usingDB2Client, usingDerbyNetClient, usingEmbedded
 
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, setUp, 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

MISSING_METHOD_SQLSTATE

public static final java.lang.String MISSING_METHOD_SQLSTATE
See Also:
Constant Field Values

TRIED_ALL_COMBINATIONS

public static final java.lang.String TRIED_ALL_COMBINATIONS
See Also:
Constant Field Values

AMBIGUOUS

public static final java.lang.String AMBIGUOUS
See Also:
Constant Field Values
Constructor Detail

AnsiSignaturesTest

public AnsiSignaturesTest(java.lang.String name)
Create a new instance.

Method Detail

suite

public static junit.framework.Test suite()
Construct top level suite in this JUnit test


test_smallint_short_short

public void test_smallint_short_short()
                               throws java.lang.Exception
Throws:
java.lang.Exception

test_smallint_short_Integer

public void test_smallint_short_Integer()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

test_smallint_Integer_short

public void test_smallint_Integer_short()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

test_smallint_Integer_Integer

public void test_smallint_Integer_Integer()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

test_integer_int_int

public void test_integer_int_int()
                          throws java.lang.Exception
Throws:
java.lang.Exception

test_integer_int_Integer

public void test_integer_int_Integer()
                              throws java.lang.Exception
Throws:
java.lang.Exception

test_integer_Integer_int

public void test_integer_Integer_int()
                              throws java.lang.Exception
Throws:
java.lang.Exception

test_integer_Integer_Integer

public void test_integer_Integer_Integer()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

test_bigint_long_long

public void test_bigint_long_long()
                           throws java.lang.Exception
Throws:
java.lang.Exception

test_bigint_long_Long

public void test_bigint_long_Long()
                           throws java.lang.Exception
Throws:
java.lang.Exception

test_bigint_Long_long

public void test_bigint_Long_long()
                           throws java.lang.Exception
Throws:
java.lang.Exception

test_bigint_Long_Long

public void test_bigint_Long_Long()
                           throws java.lang.Exception
Throws:
java.lang.Exception

test_real_float_float

public void test_real_float_float()
                           throws java.lang.Exception
Throws:
java.lang.Exception

test_real_float_Float

public void test_real_float_Float()
                           throws java.lang.Exception
Throws:
java.lang.Exception

test_real_Float_float

public void test_real_Float_float()
                           throws java.lang.Exception
Throws:
java.lang.Exception

test_real_Float_Float

public void test_real_Float_Float()
                           throws java.lang.Exception
Throws:
java.lang.Exception

test_double_double_double

public void test_double_double_double()
                               throws java.lang.Exception
Throws:
java.lang.Exception

test_double_double_Double

public void test_double_double_Double()
                               throws java.lang.Exception
Throws:
java.lang.Exception

test_double_Double_double

public void test_double_Double_double()
                               throws java.lang.Exception
Throws:
java.lang.Exception

test_double_Double_Double

public void test_double_Double_Double()
                               throws java.lang.Exception
Throws:
java.lang.Exception

test_numeric_BigDecimal_BigDecimal

public void test_numeric_BigDecimal_BigDecimal()
                                        throws java.lang.Exception
Throws:
java.lang.Exception

test_decimal_BigDecimal_BigDecimal

public void test_decimal_BigDecimal_BigDecimal()
                                        throws java.lang.Exception
Throws:
java.lang.Exception

test_varchar_String_String

public void test_varchar_String_String()
                                throws java.lang.Exception
Throws:
java.lang.Exception

test_char_String_String

public void test_char_String_String()
                             throws java.lang.Exception
Throws:
java.lang.Exception

test_longvarchar_String_String

public void test_longvarchar_String_String()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

test_bigint__smallint_int_bigint_real_double

public void test_bigint__smallint_int_bigint_real_double()
                                                  throws java.lang.Exception
Throws:
java.lang.Exception

test_flipped_bigint__smallint_int_bigint_real_double

public void test_flipped_bigint__smallint_int_bigint_real_double()
                                                          throws java.lang.Exception
Throws:
java.lang.Exception

test_binary_bytes_bytes

public void test_binary_bytes_bytes()
                             throws java.lang.Exception
Throws:
java.lang.Exception

test_binary_bytes_int

public void test_binary_bytes_int()
                           throws java.lang.Exception
Throws:
java.lang.Exception

test_varbinary_bytes_bytes

public void test_varbinary_bytes_bytes()
                                throws java.lang.Exception
Throws:
java.lang.Exception

test_varbinary_bytes_int

public void test_varbinary_bytes_int()
                              throws java.lang.Exception
Throws:
java.lang.Exception

test_longvarbinary_bytes_bytes

public void test_longvarbinary_bytes_bytes()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

test_longvarbinary_bytes_int

public void test_longvarbinary_bytes_int()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

test_date_Date_Date

public void test_date_Date_Date()
                         throws java.lang.Exception
Throws:
java.lang.Exception

test_time_Time_Time

public void test_time_Time_Time()
                         throws java.lang.Exception
Throws:
java.lang.Exception

test_timestamp_Timestamp_Timestamp

public void test_timestamp_Timestamp_Timestamp()
                                        throws java.lang.Exception
Throws:
java.lang.Exception

test_clob_Clob_String

public void test_clob_Clob_String()
                           throws java.lang.Exception
Throws:
java.lang.Exception

test_blob_Blob_String

public void test_blob_Blob_String()
                           throws java.lang.Exception
Throws:
java.lang.Exception

test_smallint_bad_short_Short

public void test_smallint_bad_short_Short()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

test_smallint_bad_Short_short

public void test_smallint_bad_Short_short()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

test_smallint_bad_Short_Short

public void test_smallint_bad_Short_Short()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

test_smallint_badreturn_byte_short

public void test_smallint_badreturn_byte_short()
                                        throws java.lang.Exception
Throws:
java.lang.Exception

test_integer_badreturn_byte_int

public void test_integer_badreturn_byte_int()
                                     throws java.lang.Exception
Throws:
java.lang.Exception

test_bigint_badreturn_byte_long

public void test_bigint_badreturn_byte_long()
                                     throws java.lang.Exception
Throws:
java.lang.Exception

test_real_badreturn_byte_float

public void test_real_badreturn_byte_float()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

test_double_badreturn_byte_double

public void test_double_badreturn_byte_double()
                                       throws java.lang.Exception
Throws:
java.lang.Exception

test_binary_badreturn_bytes_bytes

public void test_binary_badreturn_bytes_bytes()
                                       throws java.lang.Exception
Throws:
java.lang.Exception

test_varbinary_badreturn_bytes_bytes

public void test_varbinary_badreturn_bytes_bytes()
                                          throws java.lang.Exception
Throws:
java.lang.Exception

test_longvarbinary_badreturn_bytes_bytes

public void test_longvarbinary_badreturn_bytes_bytes()
                                              throws java.lang.Exception
Throws:
java.lang.Exception

test_smallint_amb_short_short

public void test_smallint_amb_short_short()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

test_smallint_amb_Integer_short

public void test_smallint_amb_Integer_short()
                                     throws java.lang.Exception
Throws:
java.lang.Exception

test_smallint_amb_byte_short

public void test_smallint_amb_byte_short()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

test_integer_amb_int_int

public void test_integer_amb_int_int()
                              throws java.lang.Exception
Throws:
java.lang.Exception

test_integer_amb_Integer_int

public void test_integer_amb_Integer_int()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

test_integer_amb_byte_int

public void test_integer_amb_byte_int()
                               throws java.lang.Exception
Throws:
java.lang.Exception

test_bigint_amb_long_long

public void test_bigint_amb_long_long()
                               throws java.lang.Exception
Throws:
java.lang.Exception

test_bigint_amb_Long_long

public void test_bigint_amb_Long_long()
                               throws java.lang.Exception
Throws:
java.lang.Exception

test_bigint_amb_byte_long

public void test_bigint_amb_byte_long()
                               throws java.lang.Exception
Throws:
java.lang.Exception

test_real_amb_float_float

public void test_real_amb_float_float()
                               throws java.lang.Exception
Throws:
java.lang.Exception

test_real_amb_Float_float

public void test_real_amb_Float_float()
                               throws java.lang.Exception
Throws:
java.lang.Exception

test_real_amb_byte_float

public void test_real_amb_byte_float()
                              throws java.lang.Exception
Throws:
java.lang.Exception

test_double_amb_double_double

public void test_double_amb_double_double()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

test_double_amb_Double_double

public void test_double_amb_Double_double()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

test_double_amb_byte_double

public void test_double_amb_byte_double()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

test_smallint_unres_short

public void test_smallint_unres_short()
                               throws java.lang.Exception
Throws:
java.lang.Exception

test_smallint_unres_Short

public void test_smallint_unres_Short()
                               throws java.lang.Exception
Throws:
java.lang.Exception

test_integer_unres_int

public void test_integer_unres_int()
                            throws java.lang.Exception
Throws:
java.lang.Exception

test_integer_unres_Integer

public void test_integer_unres_Integer()
                                throws java.lang.Exception
Throws:
java.lang.Exception

test_bigint_unres_long

public void test_bigint_unres_long()
                            throws java.lang.Exception
Throws:
java.lang.Exception

test_bigint_unres_Long

public void test_bigint_unres_Long()
                            throws java.lang.Exception
Throws:
java.lang.Exception

test_real_unres_float

public void test_real_unres_float()
                           throws java.lang.Exception
Throws:
java.lang.Exception

test_real_unres_Float

public void test_real_unres_Float()
                           throws java.lang.Exception
Throws:
java.lang.Exception

test_double_unres_double

public void test_double_unres_double()
                              throws java.lang.Exception
Throws:
java.lang.Exception

test_double_unres_Double

public void test_double_unres_Double()
                              throws java.lang.Exception
Throws:
java.lang.Exception

declareAndRunFunction

private void declareAndRunFunction(java.lang.String name,
                                   java.lang.String returnType,
                                   java.lang.String[] argTypes,
                                   java.lang.String args,
                                   java.lang.String result)
                            throws java.lang.Exception

Declare and run a function.

Throws:
java.lang.Exception

declareAndFailFunction

private void declareAndFailFunction(java.lang.String name,
                                    java.lang.String returnType,
                                    java.lang.String[] argTypes,
                                    java.lang.String args,
                                    java.lang.String result,
                                    java.lang.String sqlstate)
                             throws java.lang.Exception

Declare and run a function and expect the function to fail.

Throws:
java.lang.Exception

runFunction

private void runFunction(java.sql.Connection conn,
                         java.lang.String name,
                         java.lang.String args,
                         java.lang.String result,
                         java.lang.String sqlstate)
                  throws java.lang.Exception

Run a function. If sqlstate is not null, then we expect the run to fail.

Throws:
java.lang.Exception

declareFunction

private void declareFunction(java.sql.Connection conn,
                             java.lang.String name,
                             java.lang.String returnType,
                             java.lang.String[] argTypes)
                      throws java.lang.Exception

Declare a function with the given name, return type, and argument type.

Throws:
java.lang.Exception

doubleQuote

private java.lang.String doubleQuote(java.lang.String raw)

Built on Sat 2009-11-28 18:44:18-0800, from revision 885187

Apache Derby V10.6 Internals - Copyright © 2004,2008 The Apache Software Foundation. All Rights Reserved.