Properties p = new Properties();
p.put("derby.storage.useDefaultFilePermissions", "false");
p.put("derby.stream.error.file", derbyDotLog);
totalSuite.addTest(
new SystemPropertyTestSetup(
TestConfiguration.singleUseDatabaseDecorator(
new SupportFilesSetup(
new BaseTestSuite(
RestrictiveFilePermissionsTest.class,
"haveWeGotAllCreatedFilesSuite"),
new String[] {"functionTests/tests/lang/dcl_id.jar"}),
dbName),
p,
true));
// Next, test deployment modes, since default settings depend on them
// For server started from command line, we should still get secure
// permissions.
if (Derby.hasServer()) {
totalSuite.addTest(
new NetworkServerTestSetup(
new RestrictiveFilePermissionsTest(
"doTestCliServerIsRestrictive"),
new String[]{}, // system properties
new String[]{}, // non-default start up arguments
true));
}
// For server started from API, we should see lax permissions.
//
if (supportsLaxTesting) {
totalSuite.addTest(
TestConfiguration.clientServerDecorator(
new RestrictiveFilePermissionsTest(
"doTestNonCliServerIsLax")));
// For embedded, we should see lax permissions also.
//
p = new Properties();
p.put("derby.stream.error.file", derbyDotLog + ".lax");
totalSuite.addTest(
new SystemPropertyTestSetup(
new RestrictiveFilePermissionsTest("dotestEmbeddedIsLax"),
p,
true));
}