public class TruncateTableTest extends BaseJDBCTestCase
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ALICE |
private static java.lang.String[] |
LEGAL_USERS |
private static java.lang.String |
RUTH |
private static java.lang.String |
TEST_DBO |
private static java.lang.String |
UNAUTHORIZED_OPERATION |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
TruncateTableTest(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
private void |
cursorMinion(java.sql.Connection cursorConnection,
java.sql.Connection truncatorConnection,
java.lang.String tableName,
java.lang.String truncationStub) |
static junit.framework.Test |
suite() |
void |
testConcurrentInvalidation()
Test that statement invalidation works when TRUNCATE TABLE statements
and other statements accessing the same table execute concurrently.
|
void |
testCursor()
Test that TRUNCATE TABLE and DROP TABLE do not cause held cursors
to trip across an NPE.
|
void |
testPerms()
Test that dbo and owner can truncate table but no-one else can.
|
void |
testSelfReferencing()
Test that TRUNCATE TABLE is allowed on a referenced table if it's only
referenced by itself.
|
void |
testTruncateWithDeleteTrigger()
Test that TRUNCATE TABLE cannot be performed on a table with a
delete trigger.
|
void |
testTruncateWithForeignKey()
Test that TRUNCATE TABLE isn't allowed on a table referenced by a
foreign key constraint on another table.
|
void |
testTruncateWithIndex()
Test that TRUNCATE TABLE works when there is an index on one of the
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
private static final java.lang.String TEST_DBO
private static final java.lang.String RUTH
private static final java.lang.String ALICE
private static final java.lang.String[] LEGAL_USERS
private static final java.lang.String UNAUTHORIZED_OPERATION
public static junit.framework.Test suite()
public void testTruncateWithIndex() throws java.sql.SQLException
java.sql.SQLException
public void testTruncateWithDeleteTrigger() throws java.lang.Exception
java.lang.Exception
public void testTruncateWithForeignKey() throws java.sql.SQLException
java.sql.SQLException
public void testSelfReferencing() throws java.sql.SQLException
java.sql.SQLException
public void testPerms() throws java.lang.Exception
java.lang.Exception
public void testCursor() throws java.lang.Exception
java.lang.Exception
private void cursorMinion(java.sql.Connection cursorConnection, java.sql.Connection truncatorConnection, java.lang.String tableName, java.lang.String truncationStub) throws java.lang.Exception
java.lang.Exception
public void testConcurrentInvalidation() throws java.lang.Exception
java.lang.Exception
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.