@Test
public void testExtractServerString() {

    /*
        jdbc:microsoft:sqlserver://<server_name>:<port> -> port is optional
        jdbc:sqlserver://<server_name>:<port>
        jdbc:oracle:thin:@//<host>:<port>/ServiceName
        jdbc:oracle:thin:@<host>:<port>:<SID>
        jdbc:db2://<host>[:<port>]/<database_name>
        jdbc:mysql://<host>:<port>/<database_name>
        jdbc:postgresql://<host>:<port>/<database_name>
        jdbc:h2:tcp://<server>[:<port>]/[<path>]<databaseName>
        jdbc:h2:[file:][<path>]<databaseName>
        jdbc:h2:<url>[;USER=<username>][;PASSWORD=<value>]
     */
    assertEquals("127.0.0.1",      JDBC.tryExtractServerString("jdbc:microsoft:sqlserver://127.0.0.1"));
    assertEquals("127.0.0.1:1234", JDBC.tryExtractServerString("jdbc:microsoft:sqlserver://127.0.0.1:1234"));
    assertEquals("127.0.0.1",      JDBC.tryExtractServerString("jdbc:sqlserver://127.0.0.1"));
    assertEquals("127.0.0.1:1234", JDBC.tryExtractServerString("jdbc:sqlserver://127.0.0.1:1234"));
    assertEquals("127.0.0.1:1234", JDBC.tryExtractServerString("jdbc:oracle:thin:@127.0.0.1:1234:db"));
    assertEquals("127.0.0.1:1234", JDBC.tryExtractServerString("jdbc:oracle:thin:@//127.0.0.1:1234/db"));
    assertEquals("127.0.0.1:1234", JDBC.tryExtractServerString("jdbc:db2://127.0.0.1:1234/db"));
    assertEquals("127.0.0.1",      JDBC.tryExtractServerString("jdbc:mysql://127.0.0.1"));
    assertEquals("127.0.0.1:1234", JDBC.tryExtractServerString("jdbc:mysql://127.0.0.1:1234"));
    assertEquals("127.0.0.1:1234", JDBC.tryExtractServerString("jdbc:mysql://127.0.0.1:1234?a=b&c=d"));
    assertEquals("127.0.0.1",      JDBC.tryExtractServerString("jdbc:h2:tcp://127.0.0.1/path/db"));
    assertEquals("127.0.0.1",      JDBC.tryExtractServerString("jdbc:h2:tcp://127.0.0.1/path/db;a=b;c=d"));
    assertEquals("127.0.0.1:1234", JDBC.tryExtractServerString("jdbc:h2:tcp://127.0.0.1:1234/path/db"));
    assertEquals("file:a.db",      JDBC.tryExtractServerString("jdbc:h2:file:a.db"));
    assertNull(JDBC.tryExtractServerString("jdbc:h2:./target/test"));
    assertNull(JDBC.tryExtractServerString("abcd"));
}