Search in sources :

Example 6 with TestPolicy

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

Example 7 with TestPolicy

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

Example 8 with TestPolicy

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

Example 9 with TestPolicy

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

Example 10 with TestPolicy

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);
}
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