Search in sources :

Example 6 with StubDriver

use of util.StubDriver in project jdk8u_jdk by JetBrains.

the class DriverManagerTests method test12.

/**
     * Validate that a non-null Driver is returned by getDriver when a valid URL
     * is specified
     */
@Test
public void test12() throws Exception {
    DriverManager.registerDriver(new StubDriver());
    assertTrue(DriverManager.getDriver(StubDriverURL) != null);
}
Also used : StubDriver(util.StubDriver) Test(org.testng.annotations.Test)

Example 7 with StubDriver

use of util.StubDriver in project jdk8u_jdk by JetBrains.

the class DriverManagerPermissionsTests method test7.

/*
     * Validate that AccessControlException is thrown if
     * SQLPermission("deregisterDriver") has not been granted
     */
@Test(expectedExceptions = AccessControlException.class)
public void test7() throws SQLException {
    setPolicy(new TestPolicy());
    DriverManager.deregisterDriver(new StubDriver());
}
Also used : TestPolicy(util.TestPolicy) StubDriver(util.StubDriver) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Aggregations

Test (org.testng.annotations.Test)7 StubDriver (util.StubDriver)7 BaseTest (util.BaseTest)3 TestPolicy (util.TestPolicy)3 Driver (java.sql.Driver)1 Properties (java.util.Properties)1