Author: rareddy
Date: 2010-07-28 17:11:54 -0400 (Wed, 28 Jul 2010)
New Revision: 2390
Modified:
trunk/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java
trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java
trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java
Log:
TEIID-1174: Allowing the "-" in the VDB names.
Modified: trunk/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java 2010-07-28 19:17:38 UTC
(rev 2389)
+++ trunk/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java 2010-07-28 21:11:54 UTC
(rev 2390)
@@ -47,7 +47,7 @@
* - jdbc:teiid:BQT
* - jdbc:teiid:BQT;verson=1
*/
- static final String BASE_PATTERN = "jdbc:teiid:(\\w+)(;.*)?";
//$NON-NLS-1$
+ static final String BASE_PATTERN = "jdbc:teiid:([\\w|-]+)(;.*)?";
//$NON-NLS-1$
private static Logger logger = Logger.getLogger("org.teiid.jdbc");
//$NON-NLS-1$
Modified: trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java 2010-07-28 19:17:38 UTC
(rev 2389)
+++ trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java 2010-07-28 21:11:54 UTC
(rev 2390)
@@ -61,7 +61,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 URL_PATTERN =
"jdbc:(metamatrix|teiid):(\\w+)@mm[s]?://"+HOST_PORT_PATTERN+"(,"+HOST_PORT_PATTERN+")*(;.*)?";
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ 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-07-28 19:17:38 UTC
(rev 2389)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java 2010-07-28 21:11:54 UTC
(rev 2390)
@@ -46,6 +46,8 @@
assertTrue(drv.acceptsURL("jdbc:teiid:vdb@mm://localhost:12345;user=foo;password=bar"));
//$NON-NLS-1$
assertTrue(drv.acceptsURL("jdbc:teiid:vdb")); //$NON-NLS-1$
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$
}