Permalink
Browse files

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

  • Loading branch information...
AlexElin authored and davecramer committed Jan 19, 2018
1 parent dcbf70b commit fe463bceb3d6449443bd5e6abf2929516effccff
Showing with 9 additions and 0 deletions.
  1. +9 −0 pgjdbc/src/test/java/org/postgresql/test/jdbc2/DriverTest.java
@@ -8,6 +8,7 @@
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.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 @@
*/
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.
*/

0 comments on commit fe463bc

Please sign in to comment.