public final class JdbcDriversConfigJUnitTest {
@Test
public void testSimpleConfiguration() {
try {
JdbcDriverDescriptor pgsql = new JdbcDriverDescriptor("PostgreSQL", "postgresql", "org.postgresql.Driver",
BeginEndQuote.POSTGRES);
Xml xml = new Xml();
xml.addDriver(pgsql, null);
JdbcDriversConfig config = JdbcDriversConfig.fromXml(xml.toXml());
List<JdbcDriverDescriptor> drivers = config.getRegisteredDrivers();
assertEquals(1, drivers.size());
JdbcDriverDescriptor driver = drivers.get(0);
assertEquals(pgsql.getName(), driver.getName());
assertEquals(pgsql.getSubprotocol(), driver.getSubprotocol());
assertEquals(pgsql.getClass(), driver.getClass());
assertNull(driver.getBeginEndQuotes());
} catch (Exception e) {
fail(e.getMessage());
}
}