public class DatabasePropertyTestSetup extends BaseJDBCTestSetup
Modifier and Type | Field and Description |
---|---|
private java.util.Properties |
newValues |
private java.util.Properties |
oldValues |
private boolean |
staticProperties |
Constructor and Description |
---|
DatabasePropertyTestSetup(junit.framework.Test test,
java.util.Properties newValues)
Create a test decorator that sets and restores the passed
in properties.
|
DatabasePropertyTestSetup(junit.framework.Test test,
java.util.Properties newValues,
boolean staticProperties)
Create a test decorator that sets and restores the passed
in properties.
|
Modifier and Type | Method and Description |
---|---|
private void |
attemptSetProperties(java.util.Properties values,
java.sql.Connection coonn) |
static junit.framework.Test |
builtinAuthentication(junit.framework.Test test,
java.lang.String[] users,
java.lang.String passwordToken)
Decorate a test so that the database has authentication enabled
using the BUILTIN provider and the set of users passed in.
|
static junit.framework.Test |
builtinAuthenticationNoTeardown(junit.framework.Test test,
java.lang.String[] users,
java.lang.String passwordToken)
Decorate a test so that the database has authentication enabled
using the BUILTIN provider and the set of users passed in.
|
private void |
clearProperties(java.sql.Connection conn) |
(package private) static DatabasePropertyTestSetup |
getNoTeardownInstance(junit.framework.Test test,
java.util.Properties p,
boolean staticp) |
static junit.framework.Test |
setLockTimeouts(junit.framework.Test test,
int deadlockTime,
int waitTime)
Decorator to change the lock time outs.
|
private void |
setProperties(java.util.Properties values) |
protected void |
setUp()
For each property store the current value and
replace it with the new value, unless there is no change.
|
static junit.framework.Test |
singleProperty(junit.framework.Test test,
java.lang.String property,
java.lang.String value)
Decorate a test so that it sets a single database property
at setUp and resets it at tearDown.
|
static junit.framework.Test |
singleProperty(junit.framework.Test test,
java.lang.String property,
java.lang.String value,
boolean reboot)
Decorate a test so that it sets a single database property
at setUp and resets it at tearDown.
|
protected void |
tearDown()
Revert the properties to their values prior to the setUp call.
|
clearConnection, getConnection, getTestConfiguration, println
run
basicRun, countTestCases, getTest, toString
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, failNotEquals, failNotSame, failSame, format
private java.util.Properties newValues
private java.util.Properties oldValues
private final boolean staticProperties
public DatabasePropertyTestSetup(junit.framework.Test test, java.util.Properties newValues)
test
- test to be decoratednewValues
- properties to be setpublic DatabasePropertyTestSetup(junit.framework.Test test, java.util.Properties newValues, boolean staticProperties)
test
- test to be decoratednewValues
- properties to be setstaticProperties
- True if database needs to be shutdown after
setting properties in setUp() and tearDown method().public static junit.framework.Test setLockTimeouts(junit.framework.Test test, int deadlockTime, int waitTime)
test
- Test to decoratedeadlockTime
- Time in seconds for derby.locks.deadlockTimeout.waitTime
- Time in seconds for derby.locks.waitTimeoutpublic static junit.framework.Test builtinAuthentication(junit.framework.Test test, java.lang.String[] users, java.lang.String passwordToken)
Assumption is that no authentication was enabled upon entry.
Current user is set to the first user in the list users[0].
The authentication is removed by the decorator's tearDown method.
test
- Test to be decorated.users
- Set of users for authentication.public static junit.framework.Test builtinAuthenticationNoTeardown(junit.framework.Test test, java.lang.String[] users, java.lang.String passwordToken)
Assumption is that no authentication was enabled upon entry.
Current user is set to the first user in the list users[0].
In contrast to plain builtinAuthentication, here the authentication nor users are *NOT* removed by the decorator's tearDown method.
test
- Test to be decorated.users
- Set of users for authentication.static DatabasePropertyTestSetup getNoTeardownInstance(junit.framework.Test test, java.util.Properties p, boolean staticp)
public static junit.framework.Test singleProperty(junit.framework.Test test, java.lang.String property, java.lang.String value)
public static junit.framework.Test singleProperty(junit.framework.Test test, java.lang.String property, java.lang.String value, boolean reboot)
protected void setUp() throws java.lang.Exception
setUp
in class junit.extensions.TestSetup
java.lang.Exception
protected void tearDown() throws java.lang.Exception
tearDown
in class BaseJDBCTestSetup
java.lang.Exception
private void clearProperties(java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
private void setProperties(java.util.Properties values) throws java.sql.SQLException
java.sql.SQLException
private void attemptSetProperties(java.util.Properties values, java.sql.Connection coonn) throws java.sql.SQLException
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.