org.apache.derbyTesting.functionTests.tests.upgradeTests
Class Changes10_4

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.upgradeTests.UpgradeChange
                      extended by org.apache.derbyTesting.functionTests.tests.upgradeTests.Changes10_4
All Implemented Interfaces:
junit.framework.Test

public class Changes10_4
extends UpgradeChange

Upgrade test cases for 10.4. If the old version is 10.4 or later then these tests will not be run.
10.4 Upgrade issues


Field Summary
 
Fields inherited from class org.apache.derbyTesting.functionTests.tests.upgradeTests.UpgradeChange
oldVersion, PH_CREATE, PH_HARD_UPGRADE, PH_POST_HARD_UPGRADE, PH_POST_SOFT_UPGRADE, PH_SOFT_UPGRADE, phase, PHASES, SQLSTATE_NEED_UPGRADE
 
Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
 
Constructor Summary
Changes10_4(java.lang.String name)
           
 
Method Summary
private  void createTablesForIndexTesting(java.sql.Statement s, java.lang.String prefix)
          Creates tables to test indexes during and after soft and hard upgrades
private  void prepareTable()
          Generates error messages and stores in a table.
static junit.framework.Test suite(int phase)
          Return the suite of tests to test the changes made in 10.4.
 void testAlterColumnOfUniqueConstraint()
          Tests if alter column works for a column in unique constraint.
 void testErrorMessage()
          check if error message generated during soft upgrade is same as privious version.
 void testIndexes()
          Test index created before upgrades to insure their behaviour remains same after soft and hard upgrades.
private  void testIndexes(java.sql.Statement s, java.lang.String tableName, int val, boolean nulls, boolean duplicate)
          Tests whether or not indexes are exibiting their expected behaviour.
 void testMetaDataQueryRunInSYScompilationSchema()
          Check that even though we have set schema to a user schema, the metadata queries get run with compilation schema as SYS.
 void testRoutineParameters()
          Test that routine parameters and return types are handled correctly with 10.4 creating a procedure in soft-upgrade. 10.4 simplified the stored format of the types by ensuring the catalog type was written.
 void testTableFunctionDeclaration()
          Check that you must be hard-upgraded to 10.4 or later in order to declare table functions.
 void testUniqueConstraint()
          Tests Unique constraint in soft and hard upgrade enviornment.
private  void verifyError()
          Verifies error messages priviously generated.
 
Methods inherited from class org.apache.derbyTesting.functionTests.tests.upgradeTests.UpgradeChange
getOldMajor, getOldMinor, getPhase, oldAtLeast, oldIs
 
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
 

Constructor Detail

Changes10_4

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

suite

public static junit.framework.Test suite(int phase)
Return the suite of tests to test the changes made in 10.4.

Parameters:
phase - an integer that indicates the current phase in the upgrade test.
Returns:
the test suite created.

testMetaDataQueryRunInSYScompilationSchema

public void testMetaDataQueryRunInSYScompilationSchema()
                                                throws java.sql.SQLException
Check that even though we have set schema to a user schema, the metadata queries get run with compilation schema as SYS. DERBY-2946 Test added for 10.4.

Throws:
java.sql.SQLException

testTableFunctionDeclaration

public void testTableFunctionDeclaration()
                                  throws java.sql.SQLException
Check that you must be hard-upgraded to 10.4 or later in order to declare table functions.

Throws:
java.sql.SQLException

testRoutineParameters

public void testRoutineParameters()
                           throws java.sql.SQLException
Test that routine parameters and return types are handled correctly with 10.4 creating a procedure in soft-upgrade. 10.4 simplified the stored format of the types by ensuring the catalog type was written. See DERBY-2917 for details.

Throws:
java.sql.SQLException

testIndexes

private void testIndexes(java.sql.Statement s,
                         java.lang.String tableName,
                         int val,
                         boolean nulls,
                         boolean duplicate)
                  throws java.lang.Exception
Tests whether or not indexes are exibiting their expected behaviour.

Parameters:
s - Statement
tableName - table name to be used for testing
val - value to be used for insertion
nulls - if nulls are allowed
duplicate - if duplicates are allowed
Throws:
java.lang.Exception

createTablesForIndexTesting

private void createTablesForIndexTesting(java.sql.Statement s,
                                         java.lang.String prefix)
                                  throws java.lang.Exception
Creates tables to test indexes during and after soft and hard upgrades

Parameters:
s - Statement
prefix - prefix for table names
Throws:
java.lang.Exception

testIndexes

public void testIndexes()
                 throws java.lang.Exception
Test index created before upgrades to insure their behaviour remains same after soft and hard upgrades. This is an index test and does not apply to constraint behavior.

Throws:
java.lang.Exception

testUniqueConstraint

public void testUniqueConstraint()
                          throws java.sql.SQLException
Tests Unique constraint in soft and hard upgrade enviornment. Under soft upgrade environment creation of unique constrant over nullable columns and setting columns from unique constraint to null should fail. Also the constraint created during soft upgrade run should work fine when running under previous version.

Throws:
java.sql.SQLException - at any unexpected failure.

verifyError

private void verifyError()
                  throws java.sql.SQLException
Verifies error messages priviously generated.

Throws:
java.sql.SQLException

prepareTable

private void prepareTable()
                   throws java.sql.SQLException
Generates error messages and stores in a table.

Throws:
java.sql.SQLException

testErrorMessage

public void testErrorMessage()
                      throws java.lang.Exception
check if error message generated during soft upgrade is same as privious version.

Throws:
java.lang.Exception

testAlterColumnOfUniqueConstraint

public void testAlterColumnOfUniqueConstraint()
                                       throws java.lang.Exception
Tests if alter column works for a column in unique constraint.

Throws:
java.lang.Exception

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.