use of util.TestPolicy in project jdk8u_jdk by JetBrains.
the class SyncFactoryPermissionsTests method test03.
/*
* Validate that AccessControlException is thrown if
* SQLPermission("setSyncFactory") has not been granted
*/
@Test(expectedExceptions = AccessControlException.class)
public void test03() throws Exception {
setPolicy(new TestPolicy());
SyncFactory.setLogger(alogger);
}
use of util.TestPolicy in project jdk8u_jdk by JetBrains.
the class SyncFactoryPermissionsTests method test09.
/*
* Validate that setLogger succeeds if AllPermissions has been granted
*/
@Test
public void test09() throws Exception {
setPolicy(new TestPolicy("all"));
SyncFactory.setLogger(alogger, Level.INFO);
}
use of util.TestPolicy in project jdk8u_jdk by JetBrains.
the class SyncFactoryPermissionsTests method test.
/*
* Validate that AccessControlException is thrown if
* SQLPermission("setSyncFactory") has not been granted
*/
@Test(expectedExceptions = AccessControlException.class)
public void test() throws Exception {
setPolicy(new TestPolicy());
SyncFactory.setJNDIContext(ctx);
}
use of util.TestPolicy in project jdk8u_jdk by JetBrains.
the class DriverManagerPermissionsTests method test4.
/*
* Validate that AccessControlException is thrown if SQLPermission("setLog")
* has not been granted
*/
@Test(expectedExceptions = AccessControlException.class)
public void test4() {
setPolicy(new TestPolicy());
DriverManager.setLogWriter(null);
}
use of util.TestPolicy in project jdk8u_jdk by JetBrains.
the class DriverManagerPermissionsTests method test.
/*
* Validate that AccessControlException is thrown if SQLPermission("setLog")
* has not been granted
*/
@Test(expectedExceptions = AccessControlException.class)
public void test() {
setPolicy(new TestPolicy());
DriverManager.setLogStream(null);
}
Aggregations