use of org.apache.derbyTesting.junit.SecurityManagerSetup in project derby by apache.
the class derbyrunjartest method suite.
public static Test suite() {
Class cl = derbyrunjartest.class;
BaseTestSuite suite = new BaseTestSuite(cl);
// the network server.
if (Derby.hasServer()) {
suite.addTest(new derbyrunjartest("xtestServer"));
}
return new SecurityManagerSetup(suite, cl.getName().replace('.', '/') + ".policy", true);
}
use of org.apache.derbyTesting.junit.SecurityManagerSetup in project derby by apache.
the class MissingPermissionsTest method makeTest.
private static Test makeTest(String fixture, String policy) {
Test t = new MissingPermissionsTest(fixture);
t = new SecurityManagerSetup(t, policy);
final Properties props = new Properties();
props.setProperty("derby.connection.requireAuthentication", "true");
props.setProperty("derby.database.sqlAuthorization", "true");
props.setProperty("derby.authentication.provider", "BUILTIN");
props.setProperty("derby.user.APP", "APPPW");
t = new SystemPropertyTestSetup(t, props, true);
t = TestConfiguration.changeUserDecorator(t, "APP", "APPPW");
t = TestConfiguration.singleUseDatabaseDecorator(t);
return t;
}
use of org.apache.derbyTesting.junit.SecurityManagerSetup in project derby by apache.
the class AbortTest method baseSuite.
public static Test baseSuite(boolean hasSecurityManager) {
AbortTest abortTest = new AbortTest("test_basic", hasSecurityManager);
Test test = new CleanDatabaseTestSetup(abortTest) {
protected void decorateSQL(Statement s) throws SQLException {
s.execute("create table abort_table( a int )");
}
};
if (hasSecurityManager) {
return new SecurityManagerSetup(test, "org/apache/derbyTesting/functionTests/tests/jdbc4/noAbortPermission.policy");
} else {
return SecurityManagerSetup.noSecurityManager(test);
}
}
use of org.apache.derbyTesting.junit.SecurityManagerSetup in project derby by apache.
the class NewOptimizerOverridesTest method suite.
// /////////////////////////////////////////////////////////////////////////////////
//
// JUnit BEHAVIOR
//
// /////////////////////////////////////////////////////////////////////////////////
/**
* Construct top level suite in this JUnit test
*/
public static Test suite() {
BaseTestSuite suite = new BaseTestSuite("NewOptimizerOverridesTest");
suite.addTest(TestConfiguration.embeddedSuite(NewOptimizerOverridesTest.class));
// use a policy file which allows the xml-based plan reader to access fields in the ResultSet graph
return new SecurityManagerSetup(suite, "org/apache/derbyTesting/functionTests/tests/lang/resultSetReader.policy");
}
use of org.apache.derbyTesting.junit.SecurityManagerSetup in project derby by apache.
the class LDAPAuthenticationTest method suite.
public static Test suite() {
if (JDBC.vmSupportsJSR169())
return new BaseTestSuite("cannot run with JSR169 - missing functionality" + " for org.apache.derby.iapi.jdbc.AuthenticationService");
ldapUser = getSystemProperty("derbyTesting.ldapUser");
if (ldapUser == null || ldapUser.length() < 1)
return new BaseTestSuite("LDAPAuthenticationTest requires property " + "derbyTesting.ldapUser set to a valid user set up on the " + "ldapServer, eg: -DderbyTesting.ldapUser=CharliesPwd. In addition," + "test requires a user 'kathy', pwd 'kathyS' to be set up");
ldapPassword = getSystemProperty("derbyTesting.ldapPassword");
if (ldapPassword == null || ldapPassword.length() < 1)
return new BaseTestSuite("LDAPAuthenticationTest requires property " + "derbyTesting.ldapPassword set the password of a valid user set" + " up on the ldapServer, eg: -DderbyTesting.ldapPassword=Charlie");
ldapServer = getSystemProperty("derbyTesting.ldapServer");
if (ldapServer == null || ldapServer.length() < 1)
return new BaseTestSuite("LDAPAuthenticationTest requires property " + "derbyTesting.ldapServer set, eg: " + "-DderbyTesting.ldapServer=myldapserver.myorg.org");
ldapPort = getSystemProperty("derbyTesting.ldapPort");
if (ldapPort == null || ldapPort.length() < 1)
return new BaseTestSuite("LDAPAuthenticationTest requires property " + "derbyTesting.ldapPort set, eg: -DderbyTesting.ldapPort=333");
dnString = getSystemProperty("derbyTesting.dnString");
if (dnString == null || dnString.length() < 1)
return new BaseTestSuite("LDAPAuthenticationTest requires property " + "derbyTesting.dnString for setting o=, eg: " + "-DderbyTesting.dnString=myJNDIstring");
ldapContextFactory = getSystemProperty("derbyTesting.ldapContextFactory");
BaseTestSuite suite = new BaseTestSuite("LDAPAuthenticationTest");
suite.addTest(baseSuite("LDAPAuthenticationTest:embedded", "testLDAPConnection"));
suite.addTest(TestConfiguration.clientServerDecorator(baseSuite("LDAPAuthenticationTest:client", "testLDAPConnection")));
// resolve/connect for the LDAP server identified with the property.
return new SecurityManagerSetup(suite, POLICY_FILE_NAME);
}
Aggregations