Author: rareddy
Date: 2010-08-09 11:53:18 -0400 (Mon, 09 Aug 2010)
New Revision: 2429
Modified:
trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java
trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java
Log:
TEIID-1192: adding the support for having the underscores in the host names in the JDBC
URL.
Modified: trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java 2010-08-08 16:21:55 UTC
(rev 2428)
+++ trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java 2010-08-09 15:53:18 UTC
(rev 2429)
@@ -60,7 +60,7 @@
*/
// This host/port pattern allows just a . or a - to be in the host part.
- static final String HOST_PORT_PATTERN = "[\\p{Alnum}\\.\\-]+:\\d+";
//$NON-NLS-1$
+ static final String HOST_PORT_PATTERN = "[\\p{Alnum}\\.\\-\\_]+:\\d+";
//$NON-NLS-1$
static final String URL_PATTERN =
"jdbc:(metamatrix|teiid):([\\w|-]+)@mm[s]?://"+HOST_PORT_PATTERN+"(,"+HOST_PORT_PATTERN+")*(;.*)?";
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
static Pattern urlPattern = Pattern.compile(URL_PATTERN);
Modified: trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java 2010-08-08 16:21:55 UTC
(rev 2428)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java 2010-08-09 15:53:18 UTC
(rev 2429)
@@ -48,7 +48,8 @@
assertFalse(drv.acceptsURL("jdbc:teiid:vdb@/foo/blah/deploy.properties"));
//$NON-NLS-1$
assertTrue(drv.acceptsURL("jdbc:teiid:8294601c-9fe9-4244-9499-4a012c5e1476_vdb"));
//$NON-NLS-1$
assertTrue(drv.acceptsURL("jdbc:teiid:8294601c-9fe9-4244-9499-4a012c5e1476_vdb@mm://localhost:12345"));
//$NON-NLS-1$
-
+ assertTrue(drv.acceptsURL("jdbc:teiid:test_vdb@mm://local-host:12345"));
//$NON-NLS-1$
+ assertTrue(drv.acceptsURL("jdbc:teiid:test_vdb@mm://local_host:12345"));
//$NON-NLS-1$
}
/** Valid format of urls*/
@@ -88,7 +89,7 @@
assertTrue(!drv.acceptsURL("jdbc:metamatrix:@localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log"));
//$NON-NLS-1$
assertTrue(!drv.acceptsURL("jdbc:metamatrix:@localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;autoCommitTxn=OFF;paritalResultsMode=true"));
//$NON-NLS-1$
assertTrue(!drv.acceptsURL("jdbc:metamatrix:@localhost:1234;stickyConnections=false;socketsPerVM=4"));
//$NON-NLS-1$
-
assertTrue(!drv.acceptsURL("jdbc:metamatrix:vdb@mm://my_host.mydomain.com:53535,127.0.0.1:1234"));
//$NON-NLS-1$
+
assertTrue(drv.acceptsURL("jdbc:metamatrix:vdb@mm://my_host.mydomain.com:53535,127.0.0.1:1234"));
//$NON-NLS-1$
}
/** Invalid format of urls*/