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, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, emptyStatementCache, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, 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, usingEmbeddedalarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isJava8, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemProperty, sleep, sleepAtLeastOneTick, traceitassertEquals, 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, toStringprivate 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.SQLExceptionpublic void testTruncateWithDeleteTrigger()
throws java.lang.Exception
java.lang.Exceptionpublic void testTruncateWithForeignKey()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSelfReferencing()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testPerms()
throws java.lang.Exception
java.lang.Exceptionpublic void testCursor()
throws java.lang.Exception
java.lang.Exceptionprivate void cursorMinion(java.sql.Connection cursorConnection,
java.sql.Connection truncatorConnection,
java.lang.String tableName,
java.lang.String truncationStub)
throws java.lang.Exception
java.lang.Exceptionpublic void testConcurrentInvalidation()
throws java.lang.Exception
java.lang.ExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.