public class ServerPropertiesTest extends BaseJDBCTestCase
| Modifier and Type | Field and Description |
|---|---|
private int |
basePort |
private static java.lang.String |
POLICY_FILE_NAME |
private int[] |
portsSoFar |
private static java.lang.String |
TARGET_POLICY_FILE_NAME |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE| Constructor and Description |
|---|
ServerPropertiesTest(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
private static void |
assertPropertyValueCorrect(java.util.Properties p,
java.lang.String expectedPropAndValue) |
private void |
assertSuccessfulCmd(java.lang.String expectedString,
java.lang.String[] Cmd)
Execute command and verify that it completes successfully
|
private boolean |
canPingServer(int port,
boolean expectServerUp)
Ping for the server to be up - or down.
|
void |
checkWhetherNeedToShutdown(int[] ports,
java.lang.String failReason) |
private static junit.framework.Test |
decorateTest(java.lang.String testName,
java.lang.String[] startupProperties,
java.lang.String[] startupArgs,
boolean startServer)
Compose the required decorators to bring up the server in the correct
configuration.
|
private static junit.framework.Test |
decorateWithPolicy(junit.framework.Test test) |
private static java.util.Properties |
getTheProperties() |
private java.lang.String |
makeServerPolicyName()
Construct the name of the server policy file.
|
private java.lang.String |
shutdownServer(int port,
boolean specifyPort) |
java.lang.String |
startServer(int port,
boolean specifyPort) |
static junit.framework.Test |
suite() |
void |
tearDown()
Tear down this fixture, sub-classes should call
super.tearDown().
|
void |
testToggleLogConnections()
Test logconnections on
|
void |
testToggleTrace()
Test trace command on - property traceAll should get set
|
void |
ttestDefaultProperties()
Test start server specifying system properties without values
|
void |
ttestSetPortPriority()
Test port setting priority
|
private static void |
verifyProperties(java.lang.String expectedPropAndValue) |
private static void |
verifyProperties(java.lang.String[] expectedValues) |
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 java.lang.String POLICY_FILE_NAME
private static java.lang.String TARGET_POLICY_FILE_NAME
private int[] portsSoFar
private int basePort
public static junit.framework.Test suite()
public void tearDown()
throws java.lang.Exception
BaseJDBCTestCasetearDown in class BaseJDBCTestCasejava.lang.Exceptionprivate static junit.framework.Test decorateTest(java.lang.String testName,
java.lang.String[] startupProperties,
java.lang.String[] startupArgs,
boolean startServer)
Compose the required decorators to bring up the server in the correct configuration.
private java.lang.String makeServerPolicyName()
private static junit.framework.Test decorateWithPolicy(junit.framework.Test test)
private static java.util.Properties getTheProperties()
private static void verifyProperties(java.lang.String expectedPropAndValue)
private static void verifyProperties(java.lang.String[] expectedValues)
private static void assertPropertyValueCorrect(java.util.Properties p,
java.lang.String expectedPropAndValue)
private boolean canPingServer(int port,
boolean expectServerUp)
throws java.sql.SQLException
port - port number to be used in the pingexpectServerUp - indicator whether the server is expected to be upjava.sql.SQLExceptionprivate java.lang.String shutdownServer(int port,
boolean specifyPort)
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.lang.String startServer(int port,
boolean specifyPort)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void checkWhetherNeedToShutdown(int[] ports,
java.lang.String failReason)
private void assertSuccessfulCmd(java.lang.String expectedString,
java.lang.String[] Cmd)
throws java.lang.InterruptedException,
java.io.IOException
Cmd - array of java arguments for commandjava.lang.InterruptedExceptionjava.io.IOExceptionpublic void ttestSetPortPriority()
throws java.sql.SQLException,
java.lang.InterruptedException,
java.io.IOException
java.sql.SQLExceptionjava.lang.InterruptedExceptionjava.io.IOExceptionpublic void ttestDefaultProperties()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testToggleTrace()
throws java.sql.SQLException,
java.io.IOException,
java.lang.InterruptedException
java.sql.SQLExceptionjava.io.IOExceptionjava.lang.InterruptedExceptionpublic void testToggleLogConnections()
throws java.sql.SQLException,
java.io.IOException,
java.lang.InterruptedException
java.sql.SQLExceptionjava.io.IOExceptionjava.lang.InterruptedExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.