public final class ConglomerateSharingTest extends BaseJDBCTestCase
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
COUNT_TABLE_CONGLOMS |
private java.lang.String |
GET_CONSTRAINT_NAMES |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
ConglomerateSharingTest(java.lang.String name)
Public constructor required for running test as standalone JUnit.
|
Modifier and Type | Method and Description |
---|---|
private void |
checkStatementError(java.lang.String sqlState,
java.sql.Statement st,
java.lang.String query,
java.lang.String... violatedConstraints)
Execute the received statement and assert that:
1.
|
private void |
countConglomerates(java.lang.String tableName,
java.sql.PreparedStatement countCongloms,
int expected)
Count the number of physical conglomerates that exist for
the received table, and assert that the number found matches
the expected number.
|
static junit.framework.Test |
suite()
Create a suite of tests.
|
void |
testConstraintDrops()
Test various conditions in which a constraint can be dropped,
and verify that if the constraint's backing conglomerate is
shared, we do the right thing.
|
void |
testConversionToNonUnique()
If we have a unique constraint and a non-unique constraint
which a) reference the same columns and b) share a single
(unique) conglomerate, then test that dropping the unique
constraint will convert the physical conglomerate to be
non-unique.
|
void |
testUniqueConstraintWithNullsBackingIndex()
Test conglomerate sharing when a unique constraint having one or
more nullable columns is in play (possible as of DERBY-3330).
|
private void |
verifyConstraints(java.sql.Statement st,
java.sql.PreparedStatement constraintNames,
java.lang.String tName,
java.lang.String constraintName,
java.lang.String[][] remainingConstraints,
int numRowsExpected)
Do various checks to ensure that the constraint has truly
been dropped.
|
assertCallError, assertCheckTable, assertCommitError, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertResults, assertResults, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, chattyPrepare, chattyPrepareCall, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, dumpRs, dumpRs, emptyStatementCache, executeQuery, expectCompilationError, expectCompilationError, expectExecutionError, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, goodStatement, goodUpdate, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, tearDown, usingDB2Client, usingDerbyNetClient, usingEmbedded
alarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSameNullness, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, newAssertionFailedError, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemErr, setSystemOut, setSystemProperty, sleep, sleepAtLeastOneTick, traceit, vmAtLeast
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, setUp, toString
private final java.lang.String COUNT_TABLE_CONGLOMS
private final java.lang.String GET_CONSTRAINT_NAMES
public ConglomerateSharingTest(java.lang.String name)
public static junit.framework.Test suite()
public void testConversionToNonUnique() throws java.sql.SQLException
java.sql.SQLException
public void testConstraintDrops() throws java.sql.SQLException
java.sql.SQLException
public void testUniqueConstraintWithNullsBackingIndex() throws java.sql.SQLException
java.sql.SQLException
private void countConglomerates(java.lang.String tableName, java.sql.PreparedStatement countCongloms, int expected) throws java.sql.SQLException
java.sql.SQLException
private void checkStatementError(java.lang.String sqlState, java.sql.Statement st, java.lang.String query, java.lang.String... violatedConstraints) throws java.sql.SQLException
sqlState
- the expected SQLState of the errorst
- the statement to use for executionquery
- the SQL text to executeviolatedConstraints
- the constraints or indexes that are
violated by this statement; expect the error message to mention
at least one of themjava.sql.SQLException
private void verifyConstraints(java.sql.Statement st, java.sql.PreparedStatement constraintNames, java.lang.String tName, java.lang.String constraintName, java.lang.String[][] remainingConstraints, int numRowsExpected) throws java.sql.SQLException
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.