public class DynamicDriverTest
extends junit.framework.TestCase
implements java.sql.Driver
Title: Test the dynamic driver class. Includes a mock driver to support the testing
Description:
Copyright: Copyright (c) 2006-2014
Company:
Modifier and Type | Field and Description |
---|---|
private DynamicDriver |
driver
The dynamic driver instance to test
|
Constructor and Description |
---|
DynamicDriverTest()
Setup the test case instance
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsURL(java.lang.String url)
Return true for accepts connections
|
java.sql.Connection |
connect(java.lang.String url,
java.util.Properties prop)
Return null for the connection
|
int |
getMajorVersion()
Return 1 for the major version
|
int |
getMinorVersion()
Return 0 for the minor version
|
java.sql.DriverPropertyInfo[] |
getPropertyInfo(java.lang.String url,
java.util.Properties props)
Create a driver property array with one property having the given URL
|
boolean |
jdbcCompliant()
Return true for JDBC compliant
|
void |
setUp()
Setup the test
|
void |
testAcceptsURL()
Test the accepts URLs method
|
void |
testConnect()
Test the connect method
|
void |
testGetMajorVersion()
Test the get major version method
|
void |
testGetMinorVersion()
Test the get minor version method
|
void |
testGetPropertyInfo()
Test the get property info method
|
void |
testJDBCCompliant()
Test the JDBC compliant method
|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
private DynamicDriver driver
public void setUp()
setUp
in class junit.framework.TestCase
public void testAcceptsURL()
public void testConnect()
public void testGetPropertyInfo()
public void testGetMajorVersion()
public void testGetMinorVersion()
public void testJDBCCompliant()
public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties props)
getPropertyInfo
in interface java.sql.Driver
url
- The URLprops
- The properties for the driverpublic java.sql.Connection connect(java.lang.String url, java.util.Properties prop) throws java.sql.SQLException
connect
in interface java.sql.Driver
url
- The url to connect toprop
- The properties for the connectionjava.sql.SQLException
- If an error occurspublic boolean acceptsURL(java.lang.String url) throws java.sql.SQLException
acceptsURL
in interface java.sql.Driver
url
- The URL to connect tojava.sql.SQLException
- If an error occurspublic boolean jdbcCompliant()
jdbcCompliant
in interface java.sql.Driver
public int getMajorVersion()
getMajorVersion
in interface java.sql.Driver
public int getMinorVersion()
getMinorVersion
in interface java.sql.Driver