public class BasicInMemoryDbTest extends BaseJDBCTestCase
| Modifier and Type | Field and Description |
|---|---|
private static MemoryDbManager |
dbm
Helper for dealing with memory databases.
|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE| Constructor and Description |
|---|
BasicInMemoryDbTest(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getString(int length,
CharAlphabet alphabet)
Generates a string.
|
private void |
loadDriver()
Helper method to make sure the driver is loaded.
|
static junit.framework.Test |
suite() |
void |
tearDown()
Closes all opened statements and connections that are known, and also
deletes all known in-memory databases.
|
void |
testBootSameDbDifferentSubSubProtocol()
Verify that booting two databases with the same name but with different
subsubprotocols doesn't result in two connections to the same database.
|
void |
testCreateBackupBootRestore()
Performs a cycle to test that the in-memory db is compatible with the
deafult directory protocol.
|
void |
testDelete()
Test deletion of an in-memory database:
- create database
- delete database
- try to connection to database, should fail
- recreate and delete again
|
void |
testDeleteWhenInUse()
Deletes the database when in use by a different connection.
|
void |
testEnginehutdown()
Makes sure shutting down the Derby engine with an in-memory database
already booted works.
|
void |
testFunctionalityPresent()
Tries to connect to a non-existing database with the in-memory protocol,
expecting an error saying the database doesn't exist.
|
void |
testShutdown()
Makes sure shutting down an in-memory database works.
|
void |
testShutdownWhenInUse()
Shuts down the database when in use by a different connection.
|
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, 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 MemoryDbManager dbm
public void tearDown()
throws java.lang.Exception
tearDown in class BaseJDBCTestCasejava.lang.Exception - if something goes wrongprivate void loadDriver()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testFunctionalityPresent()
public void testCreateBackupBootRestore()
throws java.io.IOException,
java.sql.SQLException
java.io.IOException - if something goes wrongjava.sql.SQLException - if something goes wrongpublic void testShutdown()
throws java.sql.SQLException
java.sql.SQLException - if something goes wrongpublic void testEnginehutdown()
throws java.sql.SQLException
Related to DERBY-4093
java.sql.SQLException - if something goes wrongpublic void testBootSameDbDifferentSubSubProtocol()
throws java.sql.SQLException
java.sql.SQLException - if something goes wrongpublic void testDelete()
throws java.sql.SQLException
java.sql.SQLException - if something else goes wrongpublic void testDeleteWhenInUse()
throws java.io.IOException,
java.sql.SQLException
The expected outcome is that the first connection will be closed when the second one deletes the database.
java.io.IOException - if something goes wrongjava.sql.SQLException - if something goes wrongpublic void testShutdownWhenInUse()
throws java.io.IOException,
java.sql.SQLException
The expected outcome is that the first connection will be closed when the second one shuts down the database.
java.io.IOException - if something goes wrongjava.sql.SQLException - if something goes wrongpublic static junit.framework.Test suite()
public static java.lang.String getString(int length,
CharAlphabet alphabet)
throws java.io.IOException
length - length of the stringalphabet - the alphabet to use for the contentjava.io.IOException - if reading from the source stream failsApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.