public class TriggerTests extends BaseJDBCTestCase
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
isDerby1482Fixed |
(package private) int |
lobsize |
(package private) boolean |
testWithLargeDataInLOB |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
TriggerTests(java.lang.String name)
Insert trigger tests
****************
1)test1InsertAfterTrigger
This test creates an AFTER INSERT trigger which inserts non-lob
columns into another table.
****************
2)test1InsertAfterTriggerStoredProc
The test case is exactly like test1InsertAfterTrigger except that the
trigger action is a stored procedure call.
|
Modifier and Type | Method and Description |
---|---|
void |
basicSetup()
Create the basic tables and data expected by almost all the tests.
|
static void |
proc_test1_DeleteAfterTrigger_update_table(int p1)
The is the stored procedure which gets called by the after delete
trigger action for the test test1DeleteAfterTriggerStoredProc
|
static void |
proc_test1_DeleteBeforeTrigger_select_table(int p1)
The is the stored procedure which gets called by the before delete
trigger action for the test test1DeleteBeforeTriggerStoredProc
|
static void |
proc_test1_InsertAfterTrigger_update_table(int p1)
The is the stored procedure which gets called by the after insert
trigger action for the test test1InsertAfterTriggerStoredProc
|
static void |
proc_test1_InsertBeforeTrigger_select_table(int p1)
The is the stored procedure which gets called by the before insert
trigger action for the test test1InsertBeforeTriggerStoredProc
|
static void |
proc_test1_UpdateAfterTrigger_update_table(int p1)
The is the stored procedure which gets called by the after update
trigger action for the test test1UpdateAfterTriggerStoredProc
|
static void |
proc_test1_UpdateBeforeTrigger_select_table(int p1)
The is the stored procedure which gets called by the before update
trigger action for the test test1UpdateBeforeTriggerStoredProc
|
static void |
proc_test3_UpdateAfterTrigger_update_table(int p1,
int p2)
The is the stored procedure which gets called by the after delete
trigger action for the test test3UpdateAfterTriggerStoredProc
|
static void |
proc_test3_UpdateBeforeTrigger_select_table(int p1)
The is the stored procedure which gets called by the before delete
trigger action for the test test3UpdateBeforeTriggerStoredProc
|
void |
runDeleteTriggerTest()
Following will delete a row from table1 which will cause delete
trigger to fire.
|
void |
runtest1InsertTriggerTest()
Following will do an insert into table1 which will cause insert
trigger to fire.
|
void |
runtest1UpdateTrigger()
Following will update a row in table1 which will cause update
trigger to fire.
|
void |
runtest2InsertTriggerTest()
Following will do an insert into table1 which will cause insert
trigger to fire.
|
void |
runtest2UpdateTrigger()
Following will update a row in table1 which will cause update
trigger to fire.
|
void |
runtest3UpdateTrigger()
Following will update a row in table1 which will cause update
trigger to fire.
|
static junit.framework.Test |
suite() |
void |
test1DeleteAfterTrigger()
This test creates an AFTER DELETE trigger which delets from another
table using non-lob from the triggering table in the where clause.
|
void |
test1DeleteAfterTriggerStoredProc()
The test case is exactly like test1DeleteAfterTrigger except that the
trigger action is a stored procedure call.
|
void |
test1DeleteBeforeTrigger()
This test creates a BEFORE DELETE trigger which selects
columns from another table using "new" non-lob column for
join clause.
|
void |
test1DeleteBeforeTriggerStoredProc()
The test case is exactly like test1DeleteBeforeTrigger except that the
trigger action is a stored procedure call.
|
void |
test1InsertAfterTrigger()
This test creates an AFTER INSERT trigger which inserts non-lob
columns into another table.
|
void |
test1InsertAfterTriggerStoredProc()
The test case is exactly like test1InsertAfterTrigger except that the
trigger action is a stored procedure call.
|
void |
test1InsertBeforeTrigger()
This test creates a BEFORE INSERT trigger which selects
columns from another table using "new" non-lob column for
join clause.
|
void |
test1InsertBeforeTriggerStoredProc()
The test case is exactly like test1InsertBeforeTrigger except that the
trigger action is a stored procedure call.
|
void |
test1UpdateAfterTrigger()
This test creates an AFTER UPDATE trigger which is declared on a
non-LOB column.
|
void |
test1UpdateAfterTriggerStoredProc()
The test case is exactly like test1UpdateAfterTrigger except that the
trigger action is a stored procedure call.
|
void |
test1UpdateBeforeTrigger()
This test creates a BEFORE UPDATE trigger which is declared
on a non-LOB column.
|
void |
test1UpdateBeforeTriggerStoredProc()
The test case is exactly like test1UpdateBeforeTrigger except that the
trigger action is a stored procedure call.
|
void |
test2DeleteAfterTriggerAccessLOB()
This test creates an AFTER DELETE trigger which in it's trigger action
deletes row from another table using triggering table's "new" LOB value
in the join clause.
|
void |
test2DeleteBeforeTriggerAccessLOB()
This test creates a BEFORE DELETE trigger which selects "old"
lob column from just deleted row.
|
void |
test2InsertAfterTriggerAccessLOB()
This test creates an AFTER INSERT trigger which in it's trigger action
inserts lob columns from triggering table into another table.
|
void |
test2InsertAfterTriggerUpdatedLOB()
This test creates an AFTER INSERT trigger which in it's trigger action
updates a lob column from the row just inserted.
|
void |
test2InsertBeforeTriggerAccessLOB()
This test creates a BEFORE INSERT trigger which selects "new"
lob column from just inserted row.
|
void |
test2UpdateAfterTriggerAccessLOB()
The after update trigger on non-LOB column but the LOB column is
referenced in the trigger action.
|
void |
test2UpdateAfterTriggerUpdatedLOB()
This test creates an AFTER UPDATE trigger which in it's trigger action
updates a lob column from the row that just got updated.
|
void |
test2UpdateBeforeTriggerAccessLOB()
This test creates a BEFORE UPDATE trigger which selects "new"
lob column from just updated row.
|
void |
test3UpdateAfterTrigger()
The after update trigger is defined on LOB column but the LOB column
is not referenced in the trigger action.
|
void |
test3UpdateAfterTriggerStoredProc()
The test case is exactly like test3UpdateAfterTrigger except that the
trigger action is a stored procedure call.
|
void |
test3UpdateBeforeTrigger()
This test creates a BEFORE UPDATE trigger which selects a row
from another table using "new" non-LOB column from the triggering
table.
|
void |
test3UpdateBeforeTriggerStoredProc()
The test case is exactly like test3UpdateBeforeTrigger except that the
trigger action is a stored procedure call.
|
void |
test4UpdateAfterTriggerAccessLOB()
The after update trigger on LOB column but the LOB column is referenced
in the trigger action.
|
void |
test4UpdateAfterTriggerUpdatedLOB()
The after update trigger on LOB column which then gets updated in the
trigger action.
|
void |
test4UpdateBeforeTrigger()
This test creates a BEFORE UPDATE trigger on LOB column and
the trigger action selects "new" lob column from just updated
row.
|
void |
test5DeleteAfterTriggerNoReferencingClause()
This test creates an AFTER DELETE trigger but has no REFERENCING
clause, meaning that before and after values are not available to
the trigger action.
|
void |
test5DeleteBeforeTriggerNoReferencingClause()
This test creates an BEFORE DELETE trigger but has no REFERENCING
clause, meaning that before and after values are not available to
the trigger action.
|
void |
test5InsertAfterTriggerNoReferencingClause()
This test creates an AFTER INSERT trigger but has no REFERENCING
clause, meaning that before and after values are not available to
the trigger action.
|
void |
test5InsertBeforeTriggerNoReferencingClause()
This test creates an BEFORE INSERT trigger but has no REFERENCING
clause, meaning that before and after values are not available to
the trigger action.
|
void |
test5UpdateAfterTriggerNoReferencingClause()
This test creates an AFTER UPDATE trigger but has no REFERENCING
clause, meaning that before and after values are not available to
the trigger action.
|
void |
test5UpdateBeforeTriggerNoReferencingClause()
This test creates an BEFORE UPDATE trigger but has no REFERENCING
clause, meaning that before and after values are not available to
the trigger action.
|
void |
test6UpdateAfterTriggerNoTriggerColumn()
This test create an AFTER UPDATE trigger but does not identify any
trigger columns.
|
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
final int lobsize
boolean testWithLargeDataInLOB
boolean isDerby1482Fixed
public TriggerTests(java.lang.String name)
public static junit.framework.Test suite()
public void basicSetup() throws java.sql.SQLException
java.sql.SQLException
public void test1InsertAfterTrigger() throws java.sql.SQLException
java.sql.SQLException
public void test1InsertAfterTriggerStoredProc() throws java.sql.SQLException
java.sql.SQLException
public static void proc_test1_InsertAfterTrigger_update_table(int p1) throws java.sql.SQLException
p1
- new value of table1.id after the row gets insertedjava.sql.SQLException
public void test1DeleteAfterTrigger() throws java.sql.SQLException
java.sql.SQLException
public void test1DeleteAfterTriggerStoredProc() throws java.sql.SQLException
java.sql.SQLException
public static void proc_test1_DeleteAfterTrigger_update_table(int p1) throws java.sql.SQLException
p1
- old value of table1.id before the row gets deletedjava.sql.SQLException
public void test1UpdateAfterTrigger() throws java.sql.SQLException
java.sql.SQLException
public void test1UpdateAfterTriggerStoredProc() throws java.sql.SQLException
java.sql.SQLException
public static void proc_test1_UpdateAfterTrigger_update_table(int p1) throws java.sql.SQLException
p1
- new value of table1.id after the row gets updatedjava.sql.SQLException
public void test1InsertBeforeTrigger() throws java.sql.SQLException
java.sql.SQLException
public void test1InsertBeforeTriggerStoredProc() throws java.sql.SQLException
java.sql.SQLException
public static void proc_test1_InsertBeforeTrigger_select_table(int p1) throws java.sql.SQLException
p1
- new value of table1.id after the row gets insertedjava.sql.SQLException
public void test1DeleteBeforeTrigger() throws java.sql.SQLException
java.sql.SQLException
public void test1DeleteBeforeTriggerStoredProc() throws java.sql.SQLException
java.sql.SQLException
public static void proc_test1_DeleteBeforeTrigger_select_table(int p1) throws java.sql.SQLException
p1
- old value of table1.id before the row gets deletedjava.sql.SQLException
public void test1UpdateBeforeTrigger() throws java.sql.SQLException
java.sql.SQLException
public void test1UpdateBeforeTriggerStoredProc() throws java.sql.SQLException
java.sql.SQLException
public static void proc_test1_UpdateBeforeTrigger_select_table(int p1) throws java.sql.SQLException
p1
- new value of table1.id after the row gets updatedjava.sql.SQLException
public void test2InsertAfterTriggerAccessLOB() throws java.sql.SQLException
java.sql.SQLException
public void test2DeleteAfterTriggerAccessLOB() throws java.sql.SQLException
java.sql.SQLException
public void test2UpdateAfterTriggerAccessLOB() throws java.sql.SQLException
java.sql.SQLException
public void test2InsertAfterTriggerUpdatedLOB() throws java.sql.SQLException
java.sql.SQLException
public void test2UpdateAfterTriggerUpdatedLOB() throws java.sql.SQLException
java.sql.SQLException
public void test2InsertBeforeTriggerAccessLOB() throws java.sql.SQLException
java.sql.SQLException
public void test2DeleteBeforeTriggerAccessLOB() throws java.sql.SQLException
java.sql.SQLException
public void test2UpdateBeforeTriggerAccessLOB() throws java.sql.SQLException
java.sql.SQLException
public void test3UpdateAfterTrigger() throws java.sql.SQLException
java.sql.SQLException
public void test3UpdateAfterTriggerStoredProc() throws java.sql.SQLException
java.sql.SQLException
public static void proc_test3_UpdateAfterTrigger_update_table(int p1, int p2) throws java.sql.SQLException
p1
- new value of table1.status after the row gets insertedp2
- new value of table1.id after the row gets insertedjava.sql.SQLException
public void test3UpdateBeforeTrigger() throws java.sql.SQLException
java.sql.SQLException
public void test3UpdateBeforeTriggerStoredProc() throws java.sql.SQLException
java.sql.SQLException
public static void proc_test3_UpdateBeforeTrigger_select_table(int p1) throws java.sql.SQLException
p1
- new value of table1.id after the row gets insertedjava.sql.SQLException
public void test4UpdateAfterTriggerAccessLOB() throws java.sql.SQLException
java.sql.SQLException
public void test4UpdateAfterTriggerUpdatedLOB() throws java.sql.SQLException
java.sql.SQLException
public void test4UpdateBeforeTrigger() throws java.sql.SQLException
java.sql.SQLException
public void test5InsertAfterTriggerNoReferencingClause() throws java.sql.SQLException
java.sql.SQLException
public void test5InsertBeforeTriggerNoReferencingClause() throws java.sql.SQLException
java.sql.SQLException
public void test5DeleteAfterTriggerNoReferencingClause() throws java.sql.SQLException
java.sql.SQLException
public void test5DeleteBeforeTriggerNoReferencingClause() throws java.sql.SQLException
java.sql.SQLException
public void test5UpdateAfterTriggerNoReferencingClause() throws java.sql.SQLException
java.sql.SQLException
public void test5UpdateBeforeTriggerNoReferencingClause() throws java.sql.SQLException
java.sql.SQLException
public void test6UpdateAfterTriggerNoTriggerColumn() throws java.sql.SQLException
java.sql.SQLException
public void runtest1InsertTriggerTest() throws java.sql.SQLException
java.sql.SQLException
public void runtest2InsertTriggerTest() throws java.sql.SQLException
java.sql.SQLException
public void runtest1UpdateTrigger() throws java.sql.SQLException
java.sql.SQLException
public void runtest2UpdateTrigger() throws java.sql.SQLException
java.sql.SQLException
public void runtest3UpdateTrigger() throws java.sql.SQLException
java.sql.SQLException
public void runDeleteTriggerTest() throws java.sql.SQLException
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.