public class SecurityPolicyReloadingTest extends BaseJDBCTestCase
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
NON_DBO_USER |
private static java.lang.String |
PASSWORD_TOKEN |
private static java.lang.String |
RELOADABLE_INITIAL_SOURCE_POLICY |
private static java.lang.String |
RELOADABLE_MODIFIED_SOURCE_POLICY |
private static java.lang.String |
TARGET_POLICY |
private static java.lang.String |
UNRELOADABLE_SOURCE_POLICY |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE| Constructor and Description |
|---|
SecurityPolicyReloadingTest() |
| Modifier and Type | Method and Description |
|---|---|
private boolean |
canReadProperty()
Return true if we have sufficient privilege to read a special property.
|
private void |
changePolicyFile(java.sql.Connection conn,
java.lang.String newPolicyFileName,
boolean shouldSucceed,
java.lang.String expectedSQLState)
Try to change the policy file.
|
private void |
dbaTest()
Verify that the DBA has the power to reload the security policy file.
|
private static junit.framework.Test |
decorateTest()
Add decorators to a test run.
|
private void |
doPolicyReloadingIsGranted()
Verify that the DBA has the power to reload the security policy file and
that a non-DBA does not have this power.
|
private void |
doPolicyReloadingIsNotGranted()
Verify that even the DBA can't reload the policy file if getPolicy() has
not been granted.
|
private static java.lang.String |
getSourcePolicy()
Get the source file which has the correct permissions.
|
private static java.lang.String |
makeServerPolicyName()
Construct the name of the server policy file.
|
private static java.lang.String |
makeTargetPolicyStub()
Get the stub name (no directory spec) for the server policy file we create.
|
private void |
nonDbaTest()
Verify that the non-DBA does not have the power to reload the security policy file.
|
static junit.framework.Test |
suite() |
void |
testPolicyReloading()
Verify that policy file reloading is allowed and forbidden as expected.
|
java.lang.String |
toString() |
private void |
writePolicyFile(java.lang.String newPolicyFileName)
Write a new policy file.
|
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, usingEmbeddedalarm, 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, vmAtLeastassertEquals, 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, setUpprivate static final java.lang.String RELOADABLE_INITIAL_SOURCE_POLICY
private static final java.lang.String RELOADABLE_MODIFIED_SOURCE_POLICY
private static final java.lang.String UNRELOADABLE_SOURCE_POLICY
private static final java.lang.String TARGET_POLICY
private static final java.lang.String NON_DBO_USER
private static final java.lang.String PASSWORD_TOKEN
public static junit.framework.Test suite()
private static junit.framework.Test decorateTest()
public void testPolicyReloading()
throws java.lang.Exception
java.lang.Exceptionprivate void doPolicyReloadingIsGranted()
throws java.lang.Exception
java.lang.Exceptionprivate void dbaTest()
throws java.lang.Exception
java.lang.Exceptionprivate void nonDbaTest()
throws java.lang.Exception
java.lang.Exceptionprivate void doPolicyReloadingIsNotGranted()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String toString()
toString in class junit.framework.TestCaseprivate boolean canReadProperty()
throws java.lang.Exception
java.lang.Exceptionprivate void changePolicyFile(java.sql.Connection conn,
java.lang.String newPolicyFileName,
boolean shouldSucceed,
java.lang.String expectedSQLState)
throws java.lang.Exception
java.lang.Exceptionprivate void writePolicyFile(java.lang.String newPolicyFileName)
throws java.lang.Exception
java.lang.Exceptionprivate static java.lang.String makeServerPolicyName()
private static java.lang.String makeTargetPolicyStub()
private static java.lang.String getSourcePolicy()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.