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

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.CaseExpressionTest
All Implemented Interfaces:
junit.framework.Test

public class CaseExpressionTest
extends BaseJDBCTestCase


Field Summary
private static java.lang.String[][] columnReferenceResults
           
private static java.lang.String[][] nullValueResults
           
 
Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
 
Constructor Summary
CaseExpressionTest(java.lang.String name)
           
 
Method Summary
static junit.framework.Test suite()
          Runs the test fixtures in embedded.
 void testAllDatatypesCombinationsForCaseExpressions()
           
private  void testCaseExpressionQuery(java.sql.Statement st, java.lang.String[][] expRS, java.lang.String caseExprBegin, java.lang.String caseExprEnd)
          Execute the received caseExpression on the received Statement and check the results against the receieved expected array.
 void testDerby3032()
          Test fix for DERBY-3032.
 void testMultipleWhens()
          Test a query that has many WHEN conditions in it.
 void testWhenNonBoolean()
          Test various statements that
 
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

columnReferenceResults

private static java.lang.String[][] columnReferenceResults

nullValueResults

private static java.lang.String[][] nullValueResults
Constructor Detail

CaseExpressionTest

public CaseExpressionTest(java.lang.String name)
Method Detail

testWhenNonBoolean

public void testWhenNonBoolean()
Test various statements that


testAllDatatypesCombinationsForCaseExpressions

public void testAllDatatypesCombinationsForCaseExpressions()
                                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

testMultipleWhens

public void testMultipleWhens()
                       throws java.sql.SQLException
Test a query that has many WHEN conditions in it. This is mostly checking for the performance regression filed as DERBY-2986. That regression may not be noticeable in the scope of the full regression suite, but if this test is run standalone then this fixture could still be useful.

Throws:
java.sql.SQLException

suite

public static junit.framework.Test suite()
Runs the test fixtures in embedded.

Returns:
test suite

testCaseExpressionQuery

private void testCaseExpressionQuery(java.sql.Statement st,
                                     java.lang.String[][] expRS,
                                     java.lang.String caseExprBegin,
                                     java.lang.String caseExprEnd)
                              throws java.sql.SQLException
Execute the received caseExpression on the received Statement and check the results against the receieved expected array.

Throws:
java.sql.SQLException

testDerby3032

public void testDerby3032()
                   throws java.sql.SQLException
Test fix for DERBY-3032. Fix ClassCastException if SQL NULL is returned from conditional.

Throws:
java.sql.SQLException

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.