postgresql-jdbc.git / summary / log / commit / refs

commit    fe463bceb3d6449443bd5e6abf2929516effccff
Author:   AlexElin <alexey.elin@list.ru>
Commit:   Dave Cramer <davecramer@gmail.com>
Date:     Fri Jan 19 13:12:50 2018 +0000

    test: check if url is not for PostgreSQL (#1077)


pgjdbc/src/test/java/org/postgresql/test/jdbc2/DriverTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pgjdbc/src/test/java/org/postgresql/test/jdbc2/DriverTest.java b/pgjdbc/src/test/java/org/postgresql/test/jdbc2/DriverTest.java index b4c0fe5d..317f4374 100644 --- a/pgjdbc/src/test/java/org/postgresql/test/jdbc2/DriverTest.java +++ b/pgjdbc/src/test/java/org/postgresql/test/jdbc2/DriverTest.java @@ -8,6 +8,7 @@ package org.postgresql.test.jdbc2; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -23,6 +24,7 @@ import java.io.PrintWriter; import java.lang.reflect.Method; import java.sql.Connection; import java.sql.DriverManager; +import java.sql.SQLException; import java.util.ArrayList; import java.util.Collections; import java.util.Properties; @@ -35,6 +37,13 @@ import java.util.logging.Logger; */ public class DriverTest { + @Test + public void urlIsNotForPostgreSQL() throws SQLException { + Driver driver = new Driver(); + + assertNull(driver.connect("jdbc:otherdb:database", new Properties())); + } + /* * This tests the acceptsURL() method with a couple of well and poorly formed jdbc urls. */ [parent: dcbf70bc071f]