Search in sources :

Example 1 with TestPolicy

use of util.TestPolicy in project jdk8u_jdk by JetBrains.

the class DriverManagerPermissionsTests method test8.

/*
     * Validate that deregisterDriver succeeds if
     * SQLPermission("deregisterDriver") has been granted
     */
@Test
public void test8() throws SQLException {
    setPolicy(new TestPolicy("deregisterDriver"));
    DriverManager.deregisterDriver(new StubDriver());
}
Also used : TestPolicy(util.TestPolicy) StubDriver(util.StubDriver) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 2 with TestPolicy

use of util.TestPolicy in project jdk8u_jdk by JetBrains.

the class DriverManagerPermissionsTests method test2.

/*
     * Validate that setLogStream succeeds if AllPermissions has been granted
     */
@Test
public void test2() {
    setPolicy(new TestPolicy("all"));
    DriverManager.setLogStream(null);
}
Also used : TestPolicy(util.TestPolicy) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 3 with TestPolicy

use of util.TestPolicy in project jdk8u_jdk by JetBrains.

the class DriverManagerPermissionsTests method test1.

/*
     * Validate that setLogStream succeeds if SQLPermission("setLog") has been
     * granted
     */
@Test
public void test1() {
    Policy.setPolicy(new TestPolicy("setLog"));
    DriverManager.setLogStream(null);
}
Also used : TestPolicy(util.TestPolicy) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 4 with TestPolicy

use of util.TestPolicy in project jdk8u_jdk by JetBrains.

the class SyncFactoryPermissionsTests method setUpClass.

/*
     * Install a SeeurityManager along with a base Policy to allow testNG to run
     */
@BeforeClass
public static void setUpClass() throws Exception {
    setPolicy(new TestPolicy());
    System.setSecurityManager(new SecurityManager());
}
Also used : TestPolicy(util.TestPolicy) BeforeClass(org.testng.annotations.BeforeClass)

Example 5 with TestPolicy

use of util.TestPolicy in project jdk8u_jdk by JetBrains.

the class SyncFactoryPermissionsTests method test05.

/*
     * Validate that setLogger succeeds if AllPermissions has been granted
     */
@Test
public void test05() throws Exception {
    setPolicy(new TestPolicy("all"));
    SyncFactory.setLogger(alogger);
}
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