Search in sources :

Example 16 with TestPolicy

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);
}
Also used : TestPolicy(util.TestPolicy) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 17 with TestPolicy

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);
}
Also used : TestPolicy(util.TestPolicy) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 18 with TestPolicy

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);
}
Also used : TestPolicy(util.TestPolicy) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 19 with TestPolicy

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);
}
Also used : TestPolicy(util.TestPolicy) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 20 with TestPolicy

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);
}
Also used : TestPolicy(util.TestPolicy) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Aggregations

TestPolicy (util.TestPolicy)21 Test (org.testng.annotations.Test)19 BaseTest (util.BaseTest)19 StubDriver (util.StubDriver)3 BeforeClass (org.testng.annotations.BeforeClass)2