public class LoginTimeoutTest extends BaseJDBCTestCase
Modifier and Type | Class and Description |
---|---|
static interface |
LoginTimeoutTest.Connector
Behavior shared by DataSource and DriverManager
|
static class |
LoginTimeoutTest.DataSourceConnector |
static class |
LoginTimeoutTest.DriverManagerConnector |
static class |
LoginTimeoutTest.SluggishAuthenticator
User authenticator which sleeps for a while
|
Modifier and Type | Field and Description |
---|---|
private static boolean |
FAIL |
private static java.lang.String |
LOGIN_FAILED |
private static java.lang.String |
LOGIN_TIMEOUT |
private static int |
LONG_TIMEOUT |
private static java.lang.String |
RUTH |
private static java.lang.String |
RUTH_PASSWORD |
private static boolean |
SUCCEED |
private static java.lang.String[][] |
SYSTEM_PROPERTIES |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
LoginTimeoutTest(java.lang.String name)
Create a test with the given name.
|
Modifier and Type | Method and Description |
---|---|
static void |
setAuthenticatorSleep(int seconds)
Routine to set the SluggishAuthenticator Sleep
time on the server
|
static void |
setLoginTimeout(int seconds)
Routine to set the DriverManager login timeout on the server
|
private void |
setServerAuthenticatorSleep(java.sql.Connection conn,
int seconds) |
private void |
setServerTimeout(java.sql.Connection conn,
int seconds) |
static junit.framework.Test |
suite()
Return suite with all tests of the class.
|
private static java.util.Properties |
systemProperties() |
private static java.lang.String[] |
systemPropertiesArray() |
void |
testBasic()
Basic test of login timeouts.
|
private void |
tryTimeout(LoginTimeoutTest.Connector connector,
boolean shouldSucceed) |
private void |
tryTimeout(LoginTimeoutTest.Connector connector,
int timeout,
boolean shouldSucceed) |
private void |
vetConnector(LoginTimeoutTest.Connector connector,
boolean shouldSucceed) |
private void |
vetExceptionPassthrough() |
private void |
vetServerTimeout(java.sql.Connection controlConnection,
LoginTimeoutTest.Connector connector,
int serverTimeout,
boolean shouldSucceed) |
private void |
vetServerTimeouts() |
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, tearDown, 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[][] SYSTEM_PROPERTIES
private static final boolean SUCCEED
private static final boolean FAIL
private static final int LONG_TIMEOUT
private static final java.lang.String RUTH
private static final java.lang.String RUTH_PASSWORD
private static final java.lang.String LOGIN_TIMEOUT
private static final java.lang.String LOGIN_FAILED
public LoginTimeoutTest(java.lang.String name)
public static junit.framework.Test suite()
private static java.util.Properties systemProperties()
private static java.lang.String[] systemPropertiesArray()
public void testBasic() throws java.lang.Exception
java.lang.Exception
private void vetConnector(LoginTimeoutTest.Connector connector, boolean shouldSucceed) throws java.lang.Exception
java.lang.Exception
private void tryTimeout(LoginTimeoutTest.Connector connector, int timeout, boolean shouldSucceed) throws java.lang.Exception
java.lang.Exception
private void tryTimeout(LoginTimeoutTest.Connector connector, boolean shouldSucceed) throws java.lang.Exception
java.lang.Exception
private void vetExceptionPassthrough() throws java.lang.Exception
java.lang.Exception
private void vetServerTimeouts() throws java.lang.Exception
java.lang.Exception
private void vetServerTimeout(java.sql.Connection controlConnection, LoginTimeoutTest.Connector connector, int serverTimeout, boolean shouldSucceed) throws java.lang.Exception
java.lang.Exception
private void setServerTimeout(java.sql.Connection conn, int seconds) throws java.lang.Exception
java.lang.Exception
private void setServerAuthenticatorSleep(java.sql.Connection conn, int seconds) throws java.lang.Exception
java.lang.Exception
public static void setLoginTimeout(int seconds) throws java.lang.Exception
java.lang.Exception
public static void setAuthenticatorSleep(int seconds) throws java.lang.Exception
java.lang.Exception
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.