public class Derby5866TriggerOrderTest extends BaseJDBCTestCase
Test that triggers for a specific event execute in the order in which they were defined. This is a regression test case for DERBY-5866, where triggers were seen to fire in a nondeterministic order if the system clock was too coarse-grained and gave the triggers identical creation time stamps. It also tests that triggers fire in the correct order when the triggers are created in different time zones, or right before or after daylight saving.
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
OVERRIDE_TIME_PROP |
private static java.util.TimeZone |
TIMEZONE |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
Derby5866TriggerOrderTest(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
private void |
overrideTriggerCreationTime(java.sql.Timestamp ts)
Set a system property that makes the next CREATE TRIGGER operation
use the specified timestamp instead of the current time when
constructing the creation timestamp.
|
static junit.framework.Test |
suite() |
protected void |
tearDown()
Tear down this fixture, sub-classes should call
super.tearDown().
|
void |
testCrossDaylightSaving()
Test that triggers fire in the correct order if they are created around
the daylight saving time switchover.
|
void |
testEqualTimestamps()
Test that triggers fire in the correct order if the clock shows the
same creation time for all the triggers.
|
void |
testPreEpoch()
Test that triggers created before the epoch (Jan 1 1970) fire in the
correct order.
|
void |
testReversedTimestamps()
Test that the triggers fire in creation order even if the clock goes
backwards.
|
private void |
testSpecificTimestamps(java.sql.Timestamp... timestamps)
Helper method that creates triggers with the specified creation
timestamps and verifies that they fire in creation order.
|
void |
testTimeZoneChange()
Test that triggers fire in the correct order if the time zone changes
between two CREATE TRIGGER operations in a way that makes it look like
the second trigger was created before the first trigger.
|
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, 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 static final java.util.TimeZone TIMEZONE
private static final java.lang.String OVERRIDE_TIME_PROP
public Derby5866TriggerOrderTest(java.lang.String name)
public static junit.framework.Test suite()
protected void tearDown() throws java.lang.Exception
BaseJDBCTestCase
tearDown
in class BaseJDBCTestCase
java.lang.Exception
public void testTimeZoneChange() throws java.sql.SQLException
java.sql.SQLException
public void testEqualTimestamps() throws java.sql.SQLException
java.sql.SQLException
public void testReversedTimestamps() throws java.sql.SQLException
java.sql.SQLException
public void testCrossDaylightSaving() throws java.sql.SQLException
java.sql.SQLException
public void testPreEpoch() throws java.sql.SQLException
java.sql.SQLException
private void testSpecificTimestamps(java.sql.Timestamp... timestamps) throws java.sql.SQLException
java.sql.SQLException
private void overrideTriggerCreationTime(java.sql.Timestamp ts)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.