final class PhaseChanger extends BaseTestSetup
| Modifier and Type | Field and Description |
|---|---|
private java.lang.ClassLoader |
loader |
private int |
phase |
private java.lang.ClassLoader |
previousLoader |
private boolean |
trace |
private java.lang.String |
upgradeAttributes |
private int[] |
version |
| Constructor and Description |
|---|
PhaseChanger(junit.framework.Test test,
int phase,
java.lang.ClassLoader loader,
int[] version,
boolean useCreateOnUpgrade) |
| Modifier and Type | Method and Description |
|---|---|
private void |
clearDerby23ThreadLocals(java.lang.Object contextService)
Clear some fields in ContextService to allow the engine to be garbage
collected.
|
private void |
clearDerby4895ThreadLocal()
Clear a static ThreadLocal field in TableDescriptor so that the engine
classes can be garbage collected when they are no longer used.
|
private static void |
clearField(java.lang.Class cls,
java.lang.String name,
java.lang.Object instance)
Clear a field that is possibly private or final.
|
private void |
deregisterDriver()
Make sure the JDBC driver in the class loader associated with this
version is deregistered.
|
private java.lang.Object |
getDerby23ContextService()
Get a handle to the ContextService in the old engine if the version
is affected by DERBY-23.
|
protected void |
setUp()
Set the phase and boot the database, creating it
or upgrading it as required.
|
protected void |
tearDown()
Shutdown the database engine and reset the class loader.
|
runbasicRun, countTestCases, getTest, toStringassertEquals, 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, fail, fail, failNotEquals, failNotSame, failSame, formatprivate final int phase
private final int[] version
private java.lang.ClassLoader loader
private java.lang.ClassLoader previousLoader
private boolean trace
private java.lang.String upgradeAttributes
public PhaseChanger(junit.framework.Test test,
int phase,
java.lang.ClassLoader loader,
int[] version,
boolean useCreateOnUpgrade)
protected void setUp()
throws java.sql.SQLException
setUp in class junit.extensions.TestSetupjava.sql.SQLExceptionprotected void tearDown()
throws java.lang.Exception
tearDown in class junit.extensions.TestSetupjava.sql.SQLException - if the engine couldn't be stoppedjava.lang.Exceptionprivate void deregisterDriver()
throws java.lang.Exception
java.lang.Exceptionprivate void clearDerby4895ThreadLocal()
throws java.lang.Exception
java.lang.Exceptionprivate static void clearField(java.lang.Class cls,
java.lang.String name,
java.lang.Object instance)
throws java.lang.Exception
cls - the class in which the field livesname - the name of the field to clearinstance - the instance whose field should be cleared,
or null if the field is staticjava.lang.Exceptionprivate java.lang.Object getDerby23ContextService()
throws java.lang.Exception
java.lang.Exceptionprivate void clearDerby23ThreadLocals(java.lang.Object contextService)
throws java.lang.Exception
contextService - the context service for an engine that has been
shut down, or null if this version of the engine doesn't suffer from
DERBY-23java.lang.ExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.