|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.derbyTesting.junit.BaseTestCase
org.apache.derbyTesting.junit.BaseJDBCTestCase
org.apache.derbyTesting.functionTests.tests.jdbcapi.AutoloadTest
public class AutoloadTest
This JUnit test verifies the autoloading of the jdbc driver. A driver may be autoloaded due to JDBC 4 autoloading from jar files or the driver's name is listed in the system property jdbc.drivers when DriverManager is first loaded. This test must be run in its own VM because we want to verify that the driver was not accidentally loaded by some other test.
| Field Summary |
|---|
| Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase |
|---|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE |
| Constructor Summary | |
|---|---|
AutoloadTest(java.lang.String name)
|
|
| Method Summary | |
|---|---|
private static junit.framework.Test |
baseAutoLoadSuite(java.lang.String which)
Return the ordered set of tests when autoloading is enabled. |
private void |
explicitLoad(boolean instanceOnly)
|
private boolean |
fullEngineAutoBoot()
Return true if a full auto-boot of the engine is expected due to jdbc.drivers containing the name of the embedded driver. |
private boolean |
hasDerbyThreadGroup()
Return true if a ThreadGroup exists that has a name starting with 'derby.'. |
private boolean |
isEmbeddedDriverRegistered()
Return true if there appears to be a Derby embedded driver registered with the DriverManager. |
void |
noloadTestNodriverLoaded()
Simple test when auto-loading is not expected. |
static junit.framework.Test |
suite()
Only run a test if the driver will be auto-loaded. |
void |
testAutoNetworkServerBoot()
Test that the auto-load of the network server is as expected. |
void |
testEmbeddedNotStarted()
Test indirect artifiacts through public apis that the embedded engine has not been started. |
void |
testEmbeddedStarted()
Check the test(s) we use to determine if the embedded driver is not up indicate the opposite once the driver has been fully booted. |
void |
testExplicitLoad()
Test an explict load of the driver works as well even though the drivers were loaded automatically. |
void |
testExplicitReload()
Test that an explicit reload of the driver works, typically after a shutdown. |
void |
testRegisteredDriver()
|
void |
testShutdownDeRegister()
Test that after a shutdown that no Derby embedded driver is left registered in the DriverManager. |
void |
testSuccessfulConnect()
Test we can connect successfully to a database. |
void |
testUnsuccessfulConnect()
Test the error code on an unsuccessful connect to ensure it is not one returned by DriverManager. |
| Methods inherited from class org.apache.derbyTesting.junit.BaseTestCase |
|---|
alarm, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertSecurityManager, assertThrowableEquals, execJavaCmd, fail, getFailureFolder, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeSystemProperty, runBare, setSystemProperty, traceit |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runTest, setName, setUp, toString |
| Methods inherited from class junit.framework.Assert |
|---|
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, fail, fail |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AutoloadTest(java.lang.String name)
| Method Detail |
|---|
public static junit.framework.Test suite()
private static junit.framework.Test baseAutoLoadSuite(java.lang.String which)
public void testRegisteredDriver()
throws java.sql.SQLException
java.sql.SQLException
public void testShutdownDeRegister()
throws java.sql.SQLException
java.sql.SQLException - failureprivate boolean isEmbeddedDriverRegistered()
public void testSuccessfulConnect()
throws java.sql.SQLException
java.sql.SQLException
public void testUnsuccessfulConnect()
throws java.sql.SQLException
java.sql.SQLException
public void testExplicitLoad()
throws java.lang.Exception
java.lang.Exception
public void testExplicitReload()
throws java.lang.Exception
java.lang.Exception
private void explicitLoad(boolean instanceOnly)
throws java.lang.Exception
java.lang.Exceptionpublic void noloadTestNodriverLoaded()
public void testAutoNetworkServerBoot()
throws java.lang.Exception
derby.drda.startNetworkServer=false or not set
network server should not auto boot.
derby.drda.startNetworkServer=true
If jdbc.drivers contains the name of the embedded driver
then the server must be booted.
Otherwise even if auto-loading the embedded driver due to JDBC 4
auto-loading the network server must not boot. This is because
the auto-loaded driver for JDBC 4 is a proxy driver that registers
a driver but does not boot the complete embedded engine.
java.lang.Exceptionprivate boolean fullEngineAutoBoot()
public void testEmbeddedNotStarted()
public void testEmbeddedStarted()
private boolean hasDerbyThreadGroup()
|
Built on Wed 2009-11-25 18:43:31-0800, from revision 884373 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||