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 |
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 |
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, assertCommitError, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertResults, assertResults, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, chattyPrepare, chattyPrepareCall, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, dumpRs, dumpRs, emptyStatementCache, executeQuery, expectCompilationError, expectCompilationError, expectExecutionError, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, goodStatement, goodUpdate, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, usingDB2Client, usingDerbyNetClient, usingEmbedded
alarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSameNullness, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, newAssertionFailedError, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemErr, setSystemOut, setSystemProperty, sleep, sleepAtLeastOneTick, traceit, vmAtLeast
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, setUp, toString
private static final java.lang.String POLICY_FILE_NAME
private int[] portsSoFar
private int basePort
public static junit.framework.Test suite()
public void tearDown() throws java.lang.Exception
BaseJDBCTestCase
tearDown
in class BaseJDBCTestCase
java.lang.Exception
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 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.SQLException
private java.lang.String shutdownServer(int port, boolean specifyPort) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String startServer(int port, boolean specifyPort) throws java.sql.SQLException
java.sql.SQLException
public 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.InterruptedException
java.io.IOException
public void ttestSetPortPriority() throws java.sql.SQLException, java.lang.InterruptedException, java.io.IOException
java.sql.SQLException
java.lang.InterruptedException
java.io.IOException
public void ttestDefaultProperties() throws java.sql.SQLException
java.sql.SQLException
public void testToggleTrace() throws java.sql.SQLException, java.io.IOException, java.lang.InterruptedException
java.sql.SQLException
java.io.IOException
java.lang.InterruptedException
public void testToggleLogConnections() throws java.sql.SQLException, java.io.IOException, java.lang.InterruptedException
java.sql.SQLException
java.io.IOException
java.lang.InterruptedException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.