@Test public void testGetJdbcCompliant() throws SQLException { when(driver.jdbcCompliant()).thenReturn(true).thenReturn(false); assertTrue(lazyDelegatingDriver.acceptsURL(testUrl)); assertTrue(lazyDelegatingDriver.jdbcCompliant()); assertFalse(lazyDelegatingDriver.jdbcCompliant()); }
@Test public void testConnectMatch() throws SQLException { assertEquals(connection, lazyDelegatingDriver.connect(testUrl, null)); drivers.clear(); assertEquals(connection, lazyDelegatingDriver.connect(testUrl, null)); }
@Test public void testGetParentLoggerNotEmpty() throws SQLException { assertTrue(lazyDelegatingDriver.acceptsURL(testUrl)); assertEquals(logger, lazyDelegatingDriver.getParentLogger()); }
@Test public void testGetParentLoggerEmpty() throws SQLFeatureNotSupportedException { assertNull(lazyDelegatingDriver.getParentLogger()); }
@Test public void testGetMinorVersion() throws SQLException { assertTrue(lazyDelegatingDriver.acceptsURL(testUrl)); assertEquals(minorVersion, lazyDelegatingDriver.getMinorVersion()); }
@Test public void testGetMajorVersionEmpty() { assertEquals(0, lazyDelegatingDriver.getMajorVersion()); }
@Test public void testGetPropertyInfoNotEmpty() throws SQLException { assertTrue(lazyDelegatingDriver.acceptsURL(testUrl)); assertEquals(1, lazyDelegatingDriver.getPropertyInfo(testUrl, null).length); assertEquals(driverPropertyInfo, lazyDelegatingDriver.getPropertyInfo(testUrl, null)[0]); }
@Test public void testGetPropertyInfoEmpty() throws SQLException { assertEquals(0, lazyDelegatingDriver.getPropertyInfo(testUrl, null).length); }
@Test public void testAcceptsMatch() throws SQLException { assertTrue(lazyDelegatingDriver.acceptsURL(testUrl)); drivers.clear(); assertTrue(lazyDelegatingDriver.acceptsURL(testUrl)); }
@Test public void testConnectNoMatch() throws SQLException { assertNull(lazyDelegatingDriver.connect("badurl", null)); }