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