use of util.TestPolicy in project jdk8u_jdk by JetBrains.
the class SyncFactoryPermissionsTests method test01.
/*
* Validate that setJNDIContext succeeds if SQLPermission("setSyncFactory")
* has been granted
*/
@Test
public void test01() throws Exception {
setPolicy(new TestPolicy("setSyncFactory"));
SyncFactory.setJNDIContext(ctx);
}
use of util.TestPolicy in project jdk8u_jdk by JetBrains.
the class SyncFactoryPermissionsTests method test08.
/*
* Validate that setLogger succeeds if SQLPermission("setSyncFactory")
* has been granted
*/
@Test
public void test08() throws Exception {
setPolicy(new TestPolicy("setSyncFactoryLogger"));
SyncFactory.setLogger(alogger, Level.INFO);
}
use of util.TestPolicy in project jdk8u_jdk by JetBrains.
the class SyncFactoryPermissionsTests method test02.
/*
* Validate that setJNDIContext succeeds if AllPermissions has been granted
*/
@Test
public void test02() throws Exception {
setPolicy(new TestPolicy("all"));
SyncFactory.setJNDIContext(ctx);
}
use of util.TestPolicy in project jdk8u_jdk by JetBrains.
the class SyncFactoryPermissionsTests method test04.
/*
* Validate that setLogger succeeds if SQLPermission("setSyncFactory")
* has been granted
*/
@Test
public void test04() throws Exception {
setPolicy(new TestPolicy("setSyncFactory"));
SyncFactory.setLogger(alogger);
}
use of util.TestPolicy in project jdk8u_jdk by JetBrains.
the class SyncFactoryPermissionsTests method test06.
/*
* Validate that AccessControlException is thrown if
* SQLPermission("setSyncFactory") has not been granted
*/
@Test(expectedExceptions = AccessControlException.class)
public void test06() throws Exception {
setPolicy(new TestPolicy());
SyncFactory.setLogger(alogger, Level.INFO);
}
Aggregations