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

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

public class Changes10_6
extends UpgradeChange

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


Field Summary
private static java.lang.String BAD_SYNTAX
           
private static java.lang.String CREATE_TYPE_DDL
           
private static java.lang.String DROP_TYPE_DDL
           
private static java.lang.String QUERY_4215
           
private static java.lang.String TABLE_DOES_NOT_EXIST
           
private static java.lang.String UPGRADE_REQUIRED
           
 
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_6(java.lang.String name)
           
 
Method Summary
private  int getJDBCTypeId(java.lang.Object typeDescriptor)
           
private  int getMaximumWidth(java.lang.Object typeDescriptor)
           
private  java.lang.Object getTypeDescriptor(java.lang.Object routineAliasDescriptor)
          We would like to just cast the alias descriptor to RoutineAliasDescriptor.
static junit.framework.Test suite(int phase)
          Return the suite of tests to test the changes made in 10.6.
 void testCLOBGETSUBSTRING()
          Make sure that SYSIBM.CLOBGETSUBSTRING has the correct return value.
 void testSetXplainStyleProcedure()
          Make sure that SYSCS_UTIL.SYSCS_SET_XPLAIN_STYLE can only be run in Derby 10.5 and higher.
 void testSYSCS_INPLACE_COMPRESS_TABLE()
          Make sure that SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE has the correct permissons granted to it.
 void testUDTs()
          Make sure that you can only create UDTs in a hard-upgraded database.
private  void vetDERBY_4215(java.sql.Statement s)
          Vet the permissions on SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE.
 
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
 

Field Detail

BAD_SYNTAX

private static final java.lang.String BAD_SYNTAX
See Also:
Constant Field Values

TABLE_DOES_NOT_EXIST

private static final java.lang.String TABLE_DOES_NOT_EXIST
See Also:
Constant Field Values

UPGRADE_REQUIRED

private static final java.lang.String UPGRADE_REQUIRED
See Also:
Constant Field Values

QUERY_4215

private static final java.lang.String QUERY_4215
See Also:
Constant Field Values

CREATE_TYPE_DDL

private static final java.lang.String CREATE_TYPE_DDL
See Also:
Constant Field Values

DROP_TYPE_DDL

private static final java.lang.String DROP_TYPE_DDL
See Also:
Constant Field Values
Constructor Detail

Changes10_6

public Changes10_6(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.6.

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

testSetXplainStyleProcedure

public void testSetXplainStyleProcedure()
                                 throws java.sql.SQLException
Make sure that SYSCS_UTIL.SYSCS_SET_XPLAIN_STYLE can only be run in Derby 10.5 and higher. DERBY-2487 Test added for 10.5.

Throws:
java.sql.SQLException

testCLOBGETSUBSTRING

public void testCLOBGETSUBSTRING()
                          throws java.lang.Exception
Make sure that SYSIBM.CLOBGETSUBSTRING has the correct return value. See https://issues.apache.org/jira/browse/DERBY-4214

Throws:
java.lang.Exception

testSYSCS_INPLACE_COMPRESS_TABLE

public void testSYSCS_INPLACE_COMPRESS_TABLE()
                                      throws java.lang.Exception
Make sure that SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE has the correct permissons granted to it. See https://issues.apache.org/jira/browse/DERBY-4215

Throws:
java.lang.Exception

vetDERBY_4215

private void vetDERBY_4215(java.sql.Statement s)
                    throws java.lang.Exception
Vet the permissions on SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE. There should be only one permissions tuple for this system procedure and the grantor should be APP.

Throws:
java.lang.Exception

testUDTs

public void testUDTs()
              throws java.lang.Exception
Make sure that you can only create UDTs in a hard-upgraded database. See https://issues.apache.org/jira/browse/DERBY-651

Throws:
java.lang.Exception

getTypeDescriptor

private java.lang.Object getTypeDescriptor(java.lang.Object routineAliasDescriptor)
                                    throws java.lang.Exception
We would like to just cast the alias descriptor to RoutineAliasDescriptor. However, this doesn't work if we are running on an old version because the descriptor comes from a different class loader. We use reflection to get the information we need.

Throws:
java.lang.Exception

getJDBCTypeId

private int getJDBCTypeId(java.lang.Object typeDescriptor)
                   throws java.lang.Exception
Throws:
java.lang.Exception

getMaximumWidth

private int getMaximumWidth(java.lang.Object typeDescriptor)
                     throws java.lang.Exception
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.