public class DriverUnitTest extends UnitTestBase
Driver class.| Modifier and Type | Class and Description |
|---|---|
private static class |
DriverUnitTest.ParseURLTest |
static class |
DriverUnitTest.Test_Driver_getPropertyInfo
Class used to test
Driver.getPropertyInfo(String, Properties). |
static class |
DriverUnitTest.Test_Driver_setupConnectProperties
Class used to test
Driver.setupConnectProperties(String, java.util.Properties). |
| Constructor and Description |
|---|
DriverUnitTest(java.lang.String name)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addParseURLCorrectTests(TestSuite suite)
Creates tests for passing all variants of correct URLs.
|
private static java.util.Map<java.lang.String,java.util.Properties> |
generateAllURLVariants(java.lang.String[] serverTypes,
java.lang.String[] hosts,
java.lang.String[] ports,
java.lang.String[] databases,
java.lang.String[][][] properties) |
private static java.util.Properties |
invokeDriverParseURL(java.lang.String url,
java.util.Properties prop) |
private void |
loadDriverPropertyInfoMap(java.util.Map driverPropertyInfoMap)
Retrieve the
DriverPropertyInfo array from
Driver.getPropertyInfo(String, Properties) and convert it
into a Map using the name property for the keys. |
static Test |
suite()
Construct a test suite for this class.
|
void |
test_getPropertyInfo_Choices()
Tests that the
DriverPropertyInfo array returned from
Driver.getPropertyInfo(String, Properties) contains
the correct choices value on each of the objects. |
void |
test_getPropertyInfo_MatchesMessagesProperties()
Tests that the
DriverPropertyInfo array returned from
Driver.getPropertyInfo(String, Properties)
matches the list of properties defined in Messages.properties. |
void |
test_getPropertyInfo_Required()
Tests that the
DriverPropertyInfo array returned from
Driver.getPropertyInfo(String, Properties) contains
the correct required value on each of the objects. |
void |
test_getPropertyInfo_ThrowsSQLExceptionWithNonNullProperties()
Tests that passing in a non-null properties argument to
Driver.getPropertyInfo(String, Properties)
causes the url to be parsed, which then throws a SQLException. |
void |
test_getPropertyInfo_ThrowsSQLExceptionWithNullProperties()
Tests that passing in a null properties argument to
Driver.getPropertyInfo(String, Properties)
causes the url to be parsed, which then throws a SQLException. |
void |
testDriverVersion()
Test to ensure that the version reported by the driver matches the JAR
file's name.
|
assertEquals, invokeConstructor, invokeGetInstanceField, invokeInstanceMethod, invokeSetInstanceField, invokeStaticMethod, ucFirstcompareBytes, getLongString, getLongString, getType, getTypemapcompareInputStreams, compareReaders, connect, dropDatabase, dropFunction, dropProcedure, dropTable, dropTrigger, dropType, dropView, dump, dump, dumpAll, dumpKeys, dumpRow, dumpRow, getConnection, getConnection, makeObjects, makeTestTables, setUp, tearDownpublic DriverUnitTest(java.lang.String name)
name - The name of the test.public static Test suite()
DefaultPropertiesTestLibrary after creating
anonymous DefaultPropertiesTester objects.public void testDriverVersion()
throws java.lang.Exception
java.lang.Exceptionpublic void test_getPropertyInfo_ThrowsSQLExceptionWithNullProperties()
Driver.getPropertyInfo(String, Properties)
causes the url to be parsed, which then throws a SQLException.public void test_getPropertyInfo_ThrowsSQLExceptionWithNonNullProperties()
Driver.getPropertyInfo(String, Properties)
causes the url to be parsed, which then throws a SQLException.public void test_getPropertyInfo_MatchesMessagesProperties()
DriverPropertyInfo array returned from
Driver.getPropertyInfo(String, Properties)
matches the list of properties defined in Messages.properties.public void test_getPropertyInfo_Choices()
DriverPropertyInfo array returned from
Driver.getPropertyInfo(String, Properties) contains
the correct choices value on each of the objects.public void test_getPropertyInfo_Required()
DriverPropertyInfo array returned from
Driver.getPropertyInfo(String, Properties) contains
the correct required value on each of the objects.private void loadDriverPropertyInfoMap(java.util.Map driverPropertyInfoMap)
DriverPropertyInfo array from
Driver.getPropertyInfo(String, Properties) and convert it
into a Map using the name property for the keys.driverPropertyInfoMap - The map of DriverPropertyInfo objects to be populated.public static void addParseURLCorrectTests(TestSuite suite)
Driver.parseURL(String, Properties)private static java.util.Map<java.lang.String,java.util.Properties> generateAllURLVariants(java.lang.String[] serverTypes,
java.lang.String[] hosts,
java.lang.String[] ports,
java.lang.String[] databases,
java.lang.String[][][] properties)
private static java.util.Properties invokeDriverParseURL(java.lang.String url,
java.util.Properties prop)
Generated on June 8 2013