[teiid-commits] teiid SVN: r2937 - in trunk: client/src/main/java/org/teiid/net and 5 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Thu Feb 24 12:57:40 EST 2011


Author: shawkins
Date: 2011-02-24 12:57:38 -0500 (Thu, 24 Feb 2011)
New Revision: 2937

Modified:
   trunk/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java
   trunk/client/src/main/java/org/teiid/jdbc/JDBCURL.java
   trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java
   trunk/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java
   trunk/client/src/main/java/org/teiid/jdbc/TeiidDriver.java
   trunk/client/src/main/java/org/teiid/net/TeiidURL.java
   trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java
   trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties
   trunk/client/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java
   trunk/client/src/test/java/org/teiid/jdbc/TestJDBCURL.java
   trunk/client/src/test/java/org/teiid/jdbc/TestSocketProfile.java
   trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDataSource.java
   trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java
   trunk/client/src/test/java/org/teiid/net/TestTeiidURL.java
   trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
Log:
TEIID-1481 clean up of url handling logic

Modified: trunk/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java	2011-02-24 04:55:53 UTC (rev 2936)
+++ trunk/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java	2011-02-24 17:57:38 UTC (rev 2937)
@@ -25,15 +25,11 @@
 import java.sql.Connection;
 import java.sql.SQLException;
 import java.util.Arrays;
-import java.util.Enumeration;
 import java.util.Properties;
 import java.util.logging.Logger;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
 import org.teiid.core.TeiidException;
 import org.teiid.core.TeiidRuntimeException;
-import org.teiid.core.util.PropertiesUtils;
 import org.teiid.core.util.ReflectionHelper;
 import org.teiid.net.CommunicationException;
 import org.teiid.net.ConnectionException;
@@ -42,17 +38,8 @@
 
 final class EmbeddedProfile {
     
-	/** 
-     * Match URL like
-     * - jdbc:teiid:BQT
-     * - jdbc:teiid:BQT;verson=1  
-     */
-    static final String BASE_PATTERN = "jdbc:teiid:([\\w-\\.]+)(;.*)?"; //$NON-NLS-1$
-
     private static Logger logger = Logger.getLogger("org.teiid.jdbc"); //$NON-NLS-1$
     
-    static Pattern basePattern = Pattern.compile(BASE_PATTERN);
-    
     /**
      * This method tries to make a connection to the given URL. This class
      * will return a null if this is not the right driver to connect to the given URL.
@@ -62,15 +49,6 @@
      */
     public static Connection connect(String url, Properties info) 
         throws SQLException {
-        // create a properties obj if it is null
-        if (info == null) {
-            info = new Properties();
-        } else {
-        	info = PropertiesUtils.clone(info);
-        }
-
-        // parse the URL to add it's properties to properties object
-        parseURL(url, info);            
         ConnectionImpl conn = createConnection(url, info);
         logger.fine(JDBCPlugin.Util.getString("JDBCDriver.Connection_sucess")); //$NON-NLS-1$ 
         return conn;
@@ -95,52 +73,6 @@
 		}
     }
     
-    /**
-     * This method parses the URL and adds properties to the the properties object. These include required and any optional
-     * properties specified in the URL. 
-     * Expected URL format -- 
-     * jdbc:teiid:VDB;[name=value]*;
-     * 
-     * @param The URL needed to be parsed.
-     * @param The properties object which is to be updated with properties in the URL.
-     * @throws SQLException if the URL is not in the expected format.
-     */
-     static void parseURL(String url, Properties info) throws SQLException {
-        if (url == null || url.trim().length() == 0) {
-            String logMsg = JDBCPlugin.Util.getString("EmbeddedDriver.URL_must_be_specified"); //$NON-NLS-1$
-            throw new SQLException(logMsg);
-        }
-                
-        try {
-            JDBCURL jdbcURL = new JDBCURL(url);
-
-            // Set the VDB Name
-            info.setProperty(BaseDataSource.VDB_NAME, jdbcURL.getVDBName());
-                       
-            Properties optionalParams = jdbcURL.getProperties();
-            JDBCURL.normalizeProperties(info);
-            
-            Enumeration keys = optionalParams.keys();
-            while (keys.hasMoreElements()) {
-                String propName = (String)keys.nextElement();
-                // Don't let the URL properties override the passed-in Properties object.
-                if (!info.containsKey(propName)) {
-                    info.setProperty(propName, optionalParams.getProperty(propName));
-                }
-            }
-            // add the property only if it is new because they could have
-            // already been specified either through url or otherwise.
-            if(! info.containsKey(BaseDataSource.VDB_VERSION) && jdbcURL.getVDBVersion() != null) {
-                info.setProperty(BaseDataSource.VDB_VERSION, jdbcURL.getVDBVersion());
-            }
-            if(!info.containsKey(BaseDataSource.APP_NAME)) {
-                info.setProperty(BaseDataSource.APP_NAME, BaseDataSource.DEFAULT_APP_NAME);
-            }
-        } catch (Exception e) {
-            throw new SQLException(e); 
-        }        
-    }
-
     /** 
      * validate some required properties 
      * @param info the connection properties to be validated
@@ -158,11 +90,4 @@
 
     }
     
-    public static boolean acceptsURL(String url) {
-        // Check if this can match our default one, then allow it.
-        Matcher m = basePattern.matcher(url);
-        boolean matched = m.matches();
-        return matched;
-    }    
-    
 }

Modified: trunk/client/src/main/java/org/teiid/jdbc/JDBCURL.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/JDBCURL.java	2011-02-24 04:55:53 UTC (rev 2936)
+++ trunk/client/src/main/java/org/teiid/jdbc/JDBCURL.java	2011-02-24 17:57:38 UTC (rev 2937)
@@ -32,21 +32,20 @@
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import org.teiid.net.TeiidURL;
 
-
-
-
-
-
 /** 
  * @since 4.3
  */
 public class JDBCURL {
     private static final String UTF_8 = "UTF-8"; //$NON-NLS-1$
     public static final String JDBC_PROTOCOL = "jdbc:teiid:"; //$NON-NLS-1$
-    private static final String OLD_JDBC_PROTOCOL = "jdbc:metamatrix:"; //$NON-NLS-1$
+    
+    static final String URL_PATTERN = JDBC_PROTOCOL + "([\\w-\\.]+)(?:@([^;]*))?(;.*)?"; //$NON-NLS-1$
+    static Pattern urlPattern = Pattern.compile(URL_PATTERN);
 
     public static final Set<String> EXECUTION_PROPERTIES = Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(
             ExecutionProperties.PROP_TXN_AUTO_WRAP,
@@ -79,7 +78,20 @@
     
     private String vdbName;
     private String connectionURL;
-    private Properties properties = new Properties();
+    private Properties properties = new Properties();
+    
+    public enum ConnectionType {
+    	Embedded,
+    	Socket
+    }
+    
+    public static ConnectionType acceptsUrl(String url) {
+    	Matcher m = urlPattern.matcher(url);
+    	if (m.matches()) {
+    		return m.group(2) != null?ConnectionType.Socket:ConnectionType.Embedded;
+    	}
+    	return null;
+    }
     
     private String urlString;
     
@@ -121,63 +133,23 @@
         jdbcURL = jdbcURL.trim();
         if (jdbcURL.length() == 0) {
             throw new IllegalArgumentException();
-        }
-        int delimiter = jdbcURL.indexOf('@');
-        if (delimiter == -1) {
-            // this is for default connection protocol in embedded driver.
-            // then go by first semi colon
-            int fsc = jdbcURL.indexOf(';');
-            if (fsc == -1) {
-                parseJDBCProtocol(jdbcURL);
-            }
-            else {
-                parseJDBCProtocol(jdbcURL.substring(0, fsc));
-                parseConnectionProperties(jdbcURL.substring(fsc+1), this.properties);
-            }
-        }
-        else {
-            String[] urlParts = jdbcURL.split("@", 2); //$NON-NLS-1$
-            if (urlParts.length != 2) {
-                throw new IllegalArgumentException();
-            }
-            parseJDBCProtocol(urlParts[0]);
-            parseConnectionPart(urlParts[1]);
-        }
-    }
-
-    private void parseJDBCProtocol(String protocol) {
-        if (protocol.startsWith(JDBC_PROTOCOL)) {
-	        if (protocol.length() == JDBC_PROTOCOL.length()) {
-	            throw new IllegalArgumentException();
-	        }
-	        vdbName = protocol.substring(JDBC_PROTOCOL.length());
         }
-        else if (protocol.startsWith(OLD_JDBC_PROTOCOL)) {
-	        if (protocol.length() == OLD_JDBC_PROTOCOL.length()) {
-	            throw new IllegalArgumentException();
-	        }
-	        vdbName = protocol.substring(OLD_JDBC_PROTOCOL.length());
-        }
-        else {
+        
+        Matcher m = urlPattern.matcher(jdbcURL);
+        if (!m.matches()) {
         	throw new IllegalArgumentException();
         }
-        
-    }
-    
-    private void parseConnectionPart(String connectionInfo) {
-        String[] connectionParts = connectionInfo.split(";"); //$NON-NLS-1$
-        if (connectionParts.length == 0 || connectionParts[0].trim().length() == 0) {
-            throw new IllegalArgumentException();
-        }
-        connectionURL = connectionParts[0].trim();
-        if (connectionParts.length > 1) {
-            // The rest should be connection params
-            for (int i = 1; i < connectionParts.length; i++) {
-                parseConnectionProperty(connectionParts[i], this.properties);
-            }
-        }
-    }
-    
+        vdbName = m.group(1);
+        connectionURL = m.group(2);
+        if (connectionURL != null) {
+        	connectionURL = connectionURL.trim();
+        }
+        String props = m.group(3);
+        if (props != null) {
+        	parseConnectionProperties(props, this.properties);
+        }
+    }
+    
     public static void parseConnectionProperties(String connectionInfo, Properties p) {
         String[] connectionParts = connectionInfo.split(";"); //$NON-NLS-1$
         if (connectionParts.length != 0) {

Modified: trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java	2011-02-24 04:55:53 UTC (rev 2936)
+++ trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java	2011-02-24 17:57:38 UTC (rev 2937)
@@ -24,18 +24,13 @@
 
 import java.sql.Connection;
 import java.sql.SQLException;
-import java.util.Enumeration;
 import java.util.Properties;
 import java.util.logging.Level;
 import java.util.logging.Logger;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
 import org.teiid.core.TeiidException;
-import org.teiid.core.util.PropertiesUtils;
 import org.teiid.net.CommunicationException;
 import org.teiid.net.ConnectionException;
-import org.teiid.net.TeiidURL;
 import org.teiid.net.ServerConnection;
 import org.teiid.net.socket.SocketServerConnectionFactory;
 
@@ -53,38 +48,17 @@
 	private static Logger logger = Logger.getLogger("org.teiid.jdbc"); //$NON-NLS-1$
     
     /**
-     *  Suports JDBC URLS of format
-     *  - jdbc:teiid:BQT at mm://localhost:####;version=1
-     *  - jdbc:teiid:BQT at mms://localhost:####;version=1
-     *  - jdbc:teiid:BQT at mm(s)://host1:####,host2:####,host3:####;version=1
-     */
-    
-    // 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: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);
-    
-    /**
      * This method tries to make a connection to the given URL. This class
      * will return a null if this is not the right driver to connect to the given URL.
      * @param The URL used to establish a connection.
      * @return Connection object created
      * @throws SQLException if it is unable to establish a connection to the server.
      */
-    public static Connection connect(String url, Properties info) throws SQLException {
+    static Connection connect(String url, Properties info) throws SQLException {
 
         ConnectionImpl myConnection = null;
-        // create a properties obj if it is null
-        if(info == null) {
-            info = new Properties();
-        } else {
-            info = PropertiesUtils.clone(info);
-        }
 
         try {
-            // parse the URL to add it's properties to properties object
-            parseURL(url, info);
-
             myConnection = createConnection(url, info);
         } catch (TeiidException e) {
             logger.log(Level.SEVERE, "Could not create connection", e); //$NON-NLS-1$
@@ -108,51 +82,4 @@
         return connection;
     }
 
-    /**
-     * This method parses the URL and adds properties to the the properties object.
-     * These include required and any optional properties specified in the URL.
-     * @param The URL needed to be parsed.
-     * @param The properties object which is to be updated with properties in the URL.
-     * @throws SQLException if the URL is not in the expected format.
-     */
-    protected static void parseURL(String url, Properties info) throws SQLException {
-        if(url == null) {
-            String msg = JDBCPlugin.Util.getString("MMDriver.urlFormat"); //$NON-NLS-1$
-            throw new TeiidSQLException(msg);
-        }
-        try {
-            JDBCURL jdbcURL = new JDBCURL(url);
-            info.setProperty(BaseDataSource.VDB_NAME, jdbcURL.getVDBName());
-            info.setProperty(TeiidURL.CONNECTION.SERVER_URL, jdbcURL.getConnectionURL());
-            Properties optionalParams = jdbcURL.getProperties();
-            JDBCURL.normalizeProperties(info);
-            Enumeration keys = optionalParams.keys();
-            while (keys.hasMoreElements()) {
-                String propName = (String)keys.nextElement();
-                // Don't let the URL properties override the passed-in Properties object.
-                if (!info.containsKey(propName)) {
-                    info.setProperty(propName, optionalParams.getProperty(propName));
-                }
-            }
-            // add the property only if it is new because they could have
-            // already been specified either through url or otherwise.
-            if(!info.containsKey(BaseDataSource.VDB_VERSION) && jdbcURL.getVDBVersion() != null) {
-                info.setProperty(BaseDataSource.VDB_VERSION, jdbcURL.getVDBVersion());
-            }
-            if(!info.containsKey(BaseDataSource.APP_NAME)) {
-                info.setProperty(BaseDataSource.APP_NAME, BaseDataSource.DEFAULT_APP_NAME);
-            }
-
-        } catch(IllegalArgumentException iae) {
-            throw new TeiidSQLException(JDBCPlugin.Util.getString("MMDriver.urlFormat")); //$NON-NLS-1$
-        }  
-    }
-    
-
-    public static boolean acceptsURL(String url) {
-        Matcher m = urlPattern.matcher(url);
-        return m.matches();
-    }
 }
-
-

Modified: trunk/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java	2011-02-24 04:55:53 UTC (rev 2936)
+++ trunk/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java	2011-02-24 17:57:38 UTC (rev 2937)
@@ -22,6 +22,7 @@
 
 package org.teiid.jdbc;
 
+import java.net.MalformedURLException;
 import java.sql.Connection;
 import java.util.Properties;
 
@@ -59,7 +60,7 @@
 	/**
      * The port number where a server is listening for requests.
      * This property name is one of the standard property names defined by the JDBC 2.0 specification,
-     * and is <i>optional</i>.
+     * and is <i>required</i>.
      */
     private int portNumber;
 
@@ -119,68 +120,66 @@
         return props;
     }
     
-    private Properties buildServerProperties(final String userName, final String password) {               
-        Properties props = buildProperties(userName, password);
-        
-        props.setProperty(TeiidURL.CONNECTION.SERVER_URL,this.buildServerURL());
-
-        return props;
-    }    
-
-    protected String buildServerURL() {
-    	if ( this.alternateServers == null ) {
+    protected String buildServerURL() throws TeiidSQLException {
+    	if ( this.alternateServers == null || this.alternateServers.length() == 0) {
     		// Format:  "mm://server:port"
     		return new TeiidURL(this.serverName, this.portNumber, this.secure).getAppServerURL();
     	} 
 
     	// Format: "mm://server1:port,server2:port,..."
-		String serverURL = ""; //$NON-NLS-1$
-		
-		serverURL = "" + ( this.secure ? TeiidURL.SECURE_PROTOCOL : TeiidURL.DEFAULT_PROTOCOL ); //$NON-NLS-1$
+		String serverURL = this.secure ? TeiidURL.SECURE_PROTOCOL : TeiidURL.DEFAULT_PROTOCOL;
 		
-		if (this.serverName.indexOf(':') != -1) {
-			serverURL += "["; //$NON-NLS-1$
+		if (this.serverName.indexOf(':') != -1 && !this.serverName.startsWith("[")) { //$NON-NLS-1$
+			serverURL += "[" + this.serverName + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+		} else {
+			serverURL += this.serverName; 
 		}
-			
-		serverURL += "" + this.serverName; //$NON-NLS-1$
 		
-		if (this.serverName.indexOf(':') != -1) {
-			serverURL += "]"; //$NON-NLS-1$
-		}
+		serverURL += TeiidURL.COLON_DELIMITER + this.portNumber;
+		
+		//add in the port number if not specified 
+		
+    	String[] as = this.alternateServers.split( TeiidURL.COMMA_DELIMITER);
+    	
+    	for ( int i = 0; i < as.length; i++ ) {
+    		String server = as[i].trim();
+    		//ipv6 without port
+    		if (server.startsWith("[") && server.endsWith("]")) { //$NON-NLS-1$ //$NON-NLS-2$
+    			String msg = reasonWhyInvalidServerName(server.substring(1, server.length() - 1));
+    			if (msg != null) {
+    				throw createConnectionError(JDBCPlugin.Util.getString("MMDataSource.alternateServer_is_invalid", msg)); //$NON-NLS-1$
+    			}
+    			serverURL += (TeiidURL.COMMA_DELIMITER +as[i] + TeiidURL.COLON_DELIMITER + this.portNumber);
+    		} else {
+        		String[] serverParts = server.split(TeiidURL.COLON_DELIMITER, 2);
+        		String msg = reasonWhyInvalidServerName(serverParts[0]);
+    			if (msg != null) {
+    				throw createConnectionError(JDBCPlugin.Util.getString("MMDataSource.alternateServer_is_invalid", msg)); //$NON-NLS-1$
+    			}
+    			serverURL += (TeiidURL.COMMA_DELIMITER + serverParts[0] + TeiidURL.COLON_DELIMITER);
+    			if ( serverParts.length > 1 ) {
+    				try {
+						TeiidURL.validatePort(serverParts[1]);
+					} catch (MalformedURLException e) {
+						throw createConnectionError(JDBCPlugin.Util.getString("MMDataSource.alternateServer_is_invalid", e.getMessage())); //$NON-NLS-1$
+					}
+        			
+    				serverURL += serverParts[1];
+    			} else {
+    				serverURL += this.portNumber;
+    			}
+    		}
+    	}
 		
-		if ( this.portNumber != 0 ) 
-			serverURL += TeiidURL.COLON_DELIMITER  + this.portNumber;
-		
-		if ( this.alternateServers.length() > 0 ) {
-        	String[] as = this.alternateServers.split( TeiidURL.COMMA_DELIMITER);
-        	
-        	for ( int i = 0; i < as.length; i++ ) {
-        		if (as[i].startsWith("[") && as[i].endsWith("]:")) { //$NON-NLS-1$ //$NON-NLS-2$
-        			serverURL += (TeiidURL.COMMA_DELIMITER + as[i]);
-        		}
-        		else if (as[i].startsWith("[") && as[i].endsWith("]")) { //$NON-NLS-1$ //$NON-NLS-2$
-        			serverURL += (TeiidURL.COMMA_DELIMITER +as[i] + TeiidURL.COLON_DELIMITER + this.portNumber);
-        		}
-        		else {
-	        		String[] server = as[i].split(TeiidURL.COLON_DELIMITER );
-	
-	        		if ( server.length > 0 ) {
-	        			serverURL += TeiidURL.COMMA_DELIMITER + server[0];
-	        			if ( server.length > 1 ) {
-	        				serverURL += TeiidURL.COLON_DELIMITER + server[1];
-	        			} else {
-	        				serverURL += TeiidURL.COLON_DELIMITER + this.portNumber;
-	        			}
-	        		}
-        		}
-        	}
-		}
-		
-		return new TeiidURL(serverURL).getAppServerURL();
+		try {
+			return new TeiidURL(serverURL).getAppServerURL();
+		} catch (MalformedURLException e) {
+			throw TeiidSQLException.create(e);
+		}
     }
 
-    protected String buildURL() {
-        return new JDBCURL(this.getDatabaseName(), buildServerURL(), buildProperties(getUser(), getPassword())).getJDBCURL();
+    protected JDBCURL buildURL() throws TeiidSQLException {
+        return new JDBCURL(this.getDatabaseName(), buildServerURL(), buildProperties(getUser(), getPassword()));
     }
 
     protected void validateProperties( final String userName, final String password) throws java.sql.SQLException {
@@ -195,11 +194,6 @@
         if ( reason != null ) {
             throw createConnectionError(reason);
         }
-
-        reason = reasonWhyInvalidAlternateServers(this.alternateServers);
-        if ( reason != null) {
-        	throw createConnectionError(reason);
-        }
     }
     
     private TeiidSQLException createConnectionError(String reason) {
@@ -242,9 +236,8 @@
     	
     	// if not proceed with socket connection.
         validateProperties(userName,password);
-        final Properties props = buildServerProperties(userName, password);	        
-        return driver.connect(buildURL(), props);
-    	
+        
+        return driver.connect(buildURL().getJDBCURL(), null);
     }
     
 	private Properties buildEmbeddedProperties(final String userName, final String password) {
@@ -257,7 +250,11 @@
      * @see java.lang.Object#toString()
      */
     public String toString() {
-        return buildURL(); 
+        try {
+			return buildURL().getJDBCURL();
+		} catch (TeiidSQLException e) {
+			return e.getMessage();
+		} 
     }
 
     // --------------------------------------------------------------------------------------------
@@ -370,14 +367,8 @@
      * @return the reason why the property is invalid, or null if it is considered valid
      * @see #setPortNumber(int)
      */
-    public static String reasonWhyInvalidPortNumber( final int portNumber) {
-        if ( portNumber == 0 ) {
-            return null;        // default is always fine
-        }
-        if ( portNumber < 1 ) {
-            return JDBCPlugin.Util.getString("MMDataSource.Port_number_must_be_positive"); //$NON-NLS-1$
-        }
-        return null;
+    public static String reasonWhyInvalidPortNumber( final int portNumber) {
+    	return TeiidURL.validatePort(portNumber);
     }
 
     /**
@@ -390,7 +381,7 @@
     public static String reasonWhyInvalidServerName( final String serverName ) {
         if ( serverName == null || serverName.trim().length() == 0 ) {
             return JDBCPlugin.Util.getString("MMDataSource.Server_name_required"); //$NON-NLS-1$
-        }
+        }
         return null;
     }
 
@@ -430,61 +421,6 @@
         return null;
     }
  
-    /**
-     * The reason why "alternateServers" is invalid.
-     * @param value of "alternateServers" property
-     * @return reason
-     */
-    public static String reasonWhyInvalidAlternateServers(final String alternateServers) {
-    	if ( alternateServers == null || alternateServers.trim().length() < 1 )
-    		return null;
-    	
-    	String[] as = alternateServers.split( TeiidURL.COMMA_DELIMITER);
-    	String sReason = null;
-    	String reason = ""; //$NON-NLS-1$
-    	int reasonCount = 0;
-    	final String newline = System.getProperty("line.separator"); //$NON-NLS-1$
-    	
-    	for ( int i = 0; i < as.length; i++ ) {
-    		String[] server = as[i].split( TeiidURL.COLON_DELIMITER );
-
-    		if ( server.length < 1 || server.length > 2 ) {
-    			// ie "server:31000:an invalid value"
-    			// ie "server,server:31000"
-				return JDBCPlugin.Util.getString("MMDataSource.Alternate_Servers_format"); //$NON-NLS-1$
-    		}
-
-    		// check the server name portion
-    		sReason = reasonWhyInvalidServerName(server[0] );
-    		if ( sReason != null ) {
-   				reason += (reason.length() > 0 ? newline : "" ) + sReason; //$NON-NLS-1$
-   				reasonCount++;
-   				sReason = null;
-    		}
-    		
-    		if ( server.length > 1 ) {
-				// check the port portion
-				int port = 0;
-				// parse the int from the string
-				try { port = Integer.parseInt(server[1]); }
-				catch ( NumberFormatException e ) { 
-	    			// ie "server:invalid_port"
-	   				reason += (reason.length() > 0 ? newline : "" )  //$NON-NLS-1$
-						+ JDBCPlugin.Util.getString("MMDataSource.serverPort_must_be_a_number"); //$NON-NLS-1$
-					reasonCount++;
-				}
-				sReason = reasonWhyInvalidPortNumber(port);
-				if ( sReason != null ) {
-	   				reason += (reason.length() > 0 ? newline : "" ) + sReason; //$NON-NLS-1$
-	   				reasonCount++;
-	   				sReason = null;
-				}
-    		}
-    	}
-    	if ( reasonCount < 1 ) return null;
-    	return JDBCPlugin.Util.getString("MMDataSource.alternateServer_is_invalid", String.valueOf(reasonCount), reason); //$NON-NLS-1$
-    }
- 
     /** 
      * @return Returns the transparentFailover.
      */

Modified: trunk/client/src/main/java/org/teiid/jdbc/TeiidDriver.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/TeiidDriver.java	2011-02-24 04:55:53 UTC (rev 2936)
+++ trunk/client/src/main/java/org/teiid/jdbc/TeiidDriver.java	2011-02-24 17:57:38 UTC (rev 2937)
@@ -27,6 +27,7 @@
 import java.sql.DriverManager;
 import java.sql.DriverPropertyInfo;
 import java.sql.SQLException;
+import java.util.Enumeration;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Properties;
@@ -35,6 +36,8 @@
 
 import org.teiid.core.util.ApplicationInfo;
 import org.teiid.core.util.PropertiesUtils;
+import org.teiid.jdbc.JDBCURL.ConnectionType;
+import org.teiid.net.TeiidURL;
 
 
 /**
@@ -79,14 +82,21 @@
     }
 
     public Connection connect(String url, Properties info) throws SQLException {
-
-    	if (EmbeddedProfile.acceptsURL(url)) {
+    	ConnectionType conn = JDBCURL.acceptsUrl(url);
+    	if (conn == null) {
+    		return null;
+    	}
+        if(info == null) {
+        	// create a properties obj if it is null
+            info = new Properties();
+        } else {
+        	//don't modify the original
+            info = PropertiesUtils.clone(info);
+        }
+    	if (conn == ConnectionType.Embedded) {
     		return EmbeddedProfile.connect(url, info);
     	}
-    	else if (SocketProfile.acceptsURL(url)) {
-    		return SocketProfile.connect(url, info);
-    	}
-    	return null;
+		return SocketProfile.connect(url, info);
     }
     
     /**
@@ -99,21 +109,13 @@
      * @throws SQLException, should never occur
      */
     public boolean acceptsURL(String url) throws SQLException {
-    	return EmbeddedProfile.acceptsURL(url) || SocketProfile.acceptsURL(url);
+    	return JDBCURL.acceptsUrl(url) != null;
     }
 
-    /**
-     * Get's the driver's major version number. Initially this should be 1.
-     * @return major version number of the driver.
-     */
     public int getMajorVersion() {
         return ApplicationInfo.getInstance().getMajorReleaseVersion();
     }
 
-    /**
-     * Get's the driver's minor version number. Initially this should be 0.
-     * @return major version number of the driver.
-     */
     public int getMinorVersion() {
         return ApplicationInfo.getInstance().getMinorReleaseVersion();
     }
@@ -132,11 +134,7 @@
         // construct list of driverPropertyInfo objects
         List<DriverPropertyInfo> driverProps = new LinkedList<DriverPropertyInfo>();
 
-        if (EmbeddedProfile.acceptsURL(url)) {
-        	EmbeddedProfile.parseURL(url, info);
-        } else if (SocketProfile.acceptsURL(url)) {
-        	SocketProfile.parseURL(url, info);
-        }
+        parseURL(url, info);
 
         for (String property: JDBCURL.KNOWN_PROPERTIES) {
         	DriverPropertyInfo dpi = new DriverPropertyInfo(property, info.getProperty(property));
@@ -154,6 +152,48 @@
     }    
     
     /**
+     * This method parses the URL and adds properties to the the properties object.
+     * These include required and any optional properties specified in the URL.
+     * @param The URL needed to be parsed.
+     * @param The properties object which is to be updated with properties in the URL.
+     * @throws SQLException if the URL is not in the expected format.
+     */
+    protected static void parseURL(String url, Properties info) throws SQLException {
+        if(url == null) {
+            String msg = JDBCPlugin.Util.getString("MMDriver.urlFormat"); //$NON-NLS-1$
+            throw new TeiidSQLException(msg);
+        }
+        try {
+            JDBCURL jdbcURL = new JDBCURL(url);
+            info.setProperty(BaseDataSource.VDB_NAME, jdbcURL.getVDBName());
+            if (jdbcURL.getConnectionURL() != null) {
+            	info.setProperty(TeiidURL.CONNECTION.SERVER_URL, jdbcURL.getConnectionURL());
+            }
+            Properties optionalParams = jdbcURL.getProperties();
+            JDBCURL.normalizeProperties(info);
+            Enumeration keys = optionalParams.keys();
+            while (keys.hasMoreElements()) {
+                String propName = (String)keys.nextElement();
+                // Don't let the URL properties override the passed-in Properties object.
+                if (!info.containsKey(propName)) {
+                    info.setProperty(propName, optionalParams.getProperty(propName));
+                }
+            }
+            // add the property only if it is new because they could have
+            // already been specified either through url or otherwise.
+            if(!info.containsKey(BaseDataSource.VDB_VERSION) && jdbcURL.getVDBVersion() != null) {
+                info.setProperty(BaseDataSource.VDB_VERSION, jdbcURL.getVDBVersion());
+            }
+            if(!info.containsKey(BaseDataSource.APP_NAME)) {
+                info.setProperty(BaseDataSource.APP_NAME, BaseDataSource.DEFAULT_APP_NAME);
+            }
+
+        } catch(IllegalArgumentException iae) {
+            throw new TeiidSQLException(JDBCPlugin.Util.getString("MMDriver.urlFormat")); //$NON-NLS-1$
+        }  
+    }
+    
+    /**
      * This method returns true if the driver passes jdbc compliance tests.
      * @return true if the driver is jdbc complaint, else false.
      */

Modified: trunk/client/src/main/java/org/teiid/net/TeiidURL.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/TeiidURL.java	2011-02-24 04:55:53 UTC (rev 2936)
+++ trunk/client/src/main/java/org/teiid/net/TeiidURL.java	2011-02-24 17:57:38 UTC (rev 2937)
@@ -22,13 +22,13 @@
 
 package org.teiid.net;
 
-import java.net.UnknownHostException;
+import java.net.MalformedURLException;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import java.util.NoSuchElementException;
 import java.util.StringTokenizer;
 
+import org.teiid.core.util.StringUtil;
 import org.teiid.jdbc.JDBCPlugin;
 
 
@@ -92,12 +92,7 @@
     public static final String DEFAULT_PROTOCOL= TeiidURL.CONNECTION.NON_SECURE_PROTOCOL + "://"; //$NON-NLS-1$
     public static final String SECURE_PROTOCOL= TeiidURL.CONNECTION.SECURE_PROTOCOL + "://"; //$NON-NLS-1$
 
-    public static final String FORMAT_SERVER = "mm[s]://server1:port1[,server2:port2]"; //$NON-NLS-1$
-
-    public static final String INVALID_FORMAT_SERVER = JDBCPlugin.Util.getString("MMURL.INVALID_FORMAT", new Object[] {FORMAT_SERVER}); //$NON-NLS-1$
-
-
-    
+    public static final String INVALID_FORMAT_SERVER = JDBCPlugin.Util.getString("MMURL.INVALID_FORMAT"); //$NON-NLS-1$
     /*
      * appserver URL
      */
@@ -112,15 +107,21 @@
     /**
      * Create an MMURL from the server URL.  For use by the server-side.
      * @param serverURL   Expected format: mm[s]://server1:port1[,server2:port2]
+     * @throws MalformedURLException 
      * @since 4.2
      */
-    public TeiidURL(String serverURL) {
-        appServerURL = serverURL;
-        if (!hasValidURLProtocol(serverURL)) {
-            throw new IllegalArgumentException(INVALID_FORMAT_SERVER);
+    public TeiidURL(String serverURL) throws MalformedURLException {
+        if (serverURL == null) {
+            throw new MalformedURLException(INVALID_FORMAT_SERVER);
+        } 
+        if (StringUtil.startsWithIgnoreCase(serverURL, SECURE_PROTOCOL)) {
+        	usingSSL = true;
+        } else if (!StringUtil.startsWithIgnoreCase(serverURL, DEFAULT_PROTOCOL)) {
+        	throw new IllegalArgumentException(INVALID_FORMAT_SERVER);
         }
-        usingSSL = isSecureProtocol(appServerURL);
-		parseURL(serverURL, INVALID_FORMAT_SERVER);
+
+        appServerURL = serverURL;
+		parseServerURL(serverURL.substring(usingSSL?SECURE_PROTOCOL.length():DEFAULT_PROTOCOL.length()), INVALID_FORMAT_SERVER);
     }
     
     public TeiidURL(String host, int port, boolean secure) {
@@ -147,18 +148,6 @@
         return valid;
     }
 
-    /**
-     * @param appServerURL2
-     * @return
-     */
-    private boolean isSecureProtocol(String url) { 
-        return url.toLowerCase().startsWith(SECURE_PROTOCOL);
-    }
-    
-    private boolean hasValidURLProtocol(String url) {
-        return url != null && (url.startsWith(DEFAULT_PROTOCOL) || url.startsWith(SECURE_PROTOCOL));        
-    }
-    
     public List<HostInfo> getHostInfo() {
         return hosts;
     }
@@ -166,7 +155,7 @@
     /**
      * Get a list of hosts
      *  
-     * @return string of host seperated by commas
+     * @return string of host separated by commas
      * @since 4.2
      */
     public String getHosts() {
@@ -205,80 +194,69 @@
         return portList.toString();
     }
 
-    private void parseURL(String url, String exceptionMessage) {
-
-        //      Parse property string
-        int urlProtocolIndex = url.indexOf(DOUBLE_SLASH_DELIMITER);
-        String serverURL;
-        if (urlProtocolIndex > 0) {
-            serverURL = url.substring(urlProtocolIndex + 2);
-            if(serverURL == null || serverURL.equals("")) { //$NON-NLS-1$
-                throw new IllegalArgumentException(exceptionMessage);
-            }
-			parseServerURL(serverURL, exceptionMessage);
-        } else {
-            throw new IllegalArgumentException(exceptionMessage);
-        }
-    }
-
     /**
      * @param url
-     * @throws UnknownHostException 
+     * @throws MalformedURLException 
      * @since 4.2
      */
-    private void parseServerURL(String serverURL, String exceptionMessage) {
-        StringTokenizer st;
-        StringTokenizer st2;
-
-        st = new StringTokenizer(serverURL, COMMA_DELIMITER); 
+    private void parseServerURL(String serverURL, String exceptionMessage) throws MalformedURLException {
+        StringTokenizer st = new StringTokenizer(serverURL, COMMA_DELIMITER); 
         if (!st.hasMoreTokens()) {
-            throw new IllegalArgumentException(exceptionMessage);
+            throw new MalformedURLException(exceptionMessage);
         }
         while (st.hasMoreTokens()) {
         	String nextToken = st.nextToken();
-            try {
-            	String host = ""; //$NON-NLS-1$
-            	String port = ""; //$NON-NLS-1$
-	        	if (nextToken.startsWith("[")) { //$NON-NLS-1$
-	        		int hostEnd = nextToken.indexOf("]:"); //$NON-NLS-1$
-	        		host = nextToken.substring(1, hostEnd);
-	        		port = nextToken.substring(hostEnd+2);
-	        	}
-	        	else {
-	        		st2 = new StringTokenizer(nextToken, COLON_DELIMITER);
-	                host = st2.nextToken().trim();
-	                port = st2.nextToken().trim();
-	        	}
-	        	
-                if (host.equals("")) { //$NON-NLS-1$
-                    throw new IllegalArgumentException("hostname can't be empty"); //$NON-NLS-1$
-                }
-
-                if (port.equals("")) { //$NON-NLS-1$
-                    throw new IllegalArgumentException("port can't be empty"); //$NON-NLS-1$
-                }
-                
-                int portNumber;
-                try {
-                    portNumber = Integer.parseInt(port);
-                } catch (NumberFormatException nfe) {
-                    throw new IllegalArgumentException("port must be numeric:" + port); //$NON-NLS-1$
-                }
-                if (portNumber < 0 || portNumber > 0xFFFF) {
-                    throw new IllegalArgumentException("port out of range:" + portNumber); //$NON-NLS-1$
-                }
-                HostInfo hostInfo = new HostInfo(host, portNumber);
-                hosts.add(hostInfo);
-	        	
-            } catch (NoSuchElementException nsee) {
-                throw new IllegalArgumentException(exceptionMessage);
-            } catch (NullPointerException ne) {
-                throw new IllegalArgumentException(exceptionMessage);
+        	nextToken = nextToken.trim();
+        	String host = ""; //$NON-NLS-1$
+        	String port = ""; //$NON-NLS-1$
+        	if (nextToken.startsWith("[")) { //$NON-NLS-1$
+        		int hostEnd = nextToken.indexOf("]:"); //$NON-NLS-1$
+        		if (hostEnd == -1) {
+        			throw new MalformedURLException(JDBCPlugin.Util.getString("TeiidURL.invalid_ipv6_hostport", nextToken, exceptionMessage)); //$NON-NLS-1$
+        		}
+        		host = nextToken.substring(1, hostEnd);
+        		port = nextToken.substring(hostEnd+2);
+        	}
+        	else {
+        		int hostEnd = nextToken.indexOf(":"); //$NON-NLS-1$
+        		if (hostEnd == -1) {
+        			throw new MalformedURLException(JDBCPlugin.Util.getString("TeiidURL.invalid_hostport", nextToken, exceptionMessage)); //$NON-NLS-1$
+        		}
+        		host = nextToken.substring(0, hostEnd);
+        		port = nextToken.substring(hostEnd+1);
+        	}
+        	host = host.trim();
+        	port = port.trim();
+            if (host.equals("") || port.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$
+                throw new MalformedURLException(JDBCPlugin.Util.getString("TeiidURL.invalid_hostport", nextToken, exceptionMessage)); //$NON-NLS-1$
             }
-        	
+            int portNumber = validatePort(port);
+            HostInfo hostInfo = new HostInfo(host, portNumber);
+            hosts.add(hostInfo);
         }
     }
 
+	public static int validatePort(String port) throws MalformedURLException {
+		int portNumber;
+		try {
+		    portNumber = Integer.parseInt(port);
+		} catch (NumberFormatException nfe) {
+		    throw new MalformedURLException(JDBCPlugin.Util.getString("TeiidURL.non_numeric_port", port)); //$NON-NLS-1$
+		}
+		String msg = validatePort(portNumber);
+		if (msg != null) {
+			throw new MalformedURLException(msg);
+		}
+		return portNumber;
+	}
+
+	public static String validatePort(int portNumber) {
+		if (portNumber < 0 || portNumber > 0xFFFF) {
+		    return JDBCPlugin.Util.getString("TeiidURL.port_out_of_range", portNumber); //$NON-NLS-1$
+		}
+		return null;
+	}
+
     /**
      * Get the Application Server URL
      * 

Modified: trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java	2011-02-24 04:55:53 UTC (rev 2936)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java	2011-02-24 17:57:38 UTC (rev 2937)
@@ -29,6 +29,7 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.net.InetAddress;
+import java.net.MalformedURLException;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -291,7 +292,12 @@
 		
 		updateConnectionProperties(connectionProperties);
 		
-		TeiidURL url = new TeiidURL(connectionProperties.getProperty(TeiidURL.CONNECTION.SERVER_URL));
+		TeiidURL url;
+		try {
+			url = new TeiidURL(connectionProperties.getProperty(TeiidURL.CONNECTION.SERVER_URL));
+		} catch (MalformedURLException e1) {
+			throw new ConnectionException(e1);
+		}
 		
 		String discoveryStrategyName = connectionProperties.getProperty(TeiidURL.CONNECTION.DISCOVERY_STRATEGY, URL);
 

Modified: trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties
===================================================================
--- trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties	2011-02-24 04:55:53 UTC (rev 2936)
+++ trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties	2011-02-24 17:57:38 UTC (rev 2937)
@@ -82,14 +82,11 @@
 MMStatement.Stmt_closed=Unable to perform operations on an already closed statement.
 MMStatement.Success_query=Successfully executed a query {0} and obtained results
 MMStatement.Invalid_field_size=Invalid MaxFieldSize {0}
-MMDataSource.Port_number_must_be_positive=The port number must be a positive number
-MMDataSource.serverPort_must_be_a_number=The serverPort property must be a number.
 MMDataSource.Server_name_required=The server name must be specified
 MMDataSource.Invalid_trans_auto_wrap_mode=The transaction auto-wrap setting must be one of \"{0}\", \"{1}\", or \"{2}\".
 MMDataSource.Sockets_per_vm_invalid=The property socketsPerVM must be a positive number.
 MMDataSource.Sticky_connections_invalid=The property stickyConnections must be boolean.
-MMDataSource.Alternate_Servers_format=The format for the alternateServers property is <server2>[:<port2>][,<server3>[:<port3>],...].
-MMDataSource.alternateServer_is_invalid=The alternateServers property contains the following {0} error(s): {1}
+MMDataSource.alternateServer_is_invalid=The alternateServers property contains the following error: {0} The format for the alternateServers property is <server2>[:<port2>][,<server3>[:<port3>],...].
 StreamImpl.Unable_to_read_data_from_stream=Unable to read data from the stream: {0}
 
 MMStatement.Invalid_During_Transaction=Call to method {0} not valid during a transaction.
@@ -146,6 +143,10 @@
 SocketServerConnection.closed=Server connection is closed
 SocketHelper.keystore_not_found=Key store ''{0}'' was not found.
 
-MMURL.INVALID_FORMAT=The required url format is {0}
+MMURL.INVALID_FORMAT=The required socket url format is mm[s]://server1:port1[,server2:port2]
+TeiidURL.invalid_ipv6_hostport=The IPv6 host:port ''{0}'' is not valid. {1}
+TeiidURL.invalid_hostport=The host:port ''{0}'' is not valid. {1}
+TeiidURL.non_numeric_port=The port ''{0}'' is a non-numeric value.
+TeiidURL.port_out_of_range=The port ''{0}'' is out of range.
 
 BatchSerializer.datatype_mismatch=The modeled datatype {0} for column {1} doesn''t match the runtime type "{2}". Please ensure that the column''s modeled datatype matches the expected data.

Modified: trunk/client/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java	2011-02-24 04:55:53 UTC (rev 2936)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java	2011-02-24 17:57:38 UTC (rev 2937)
@@ -28,6 +28,7 @@
 import java.util.Properties;
 
 import org.junit.Test;
+import org.teiid.jdbc.JDBCURL.ConnectionType;
 
 public class TestEmbeddedProfile {
     
@@ -38,29 +39,25 @@
     @Test public void testAcceptsURL() {    
         
         // ClassPath based URL
-        assertFalse(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:teiid:BQT at classpath:/dqp.properties;partialResultsMode=true")); //$NON-NLS-1$
+        assertFalse(ConnectionType.Embedded == JDBCURL.acceptsUrl("jdbc:teiid:BQT at classpath:/dqp.properties;partialResultsMode=true")); //$NON-NLS-1$
         
-        // These are specific to the MMorg.teiid.jdbc.EmbeddedProfile and should not be suported
-        assertFalse(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:teiid:BQT at mm://host:7001;version=1")); //$NON-NLS-1$
-        assertFalse(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:teiid:BQT at mms://host:7001;version=1")); //$NON-NLS-1$
-        
-        assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:teiid:BQT")); //$NON-NLS-1$
-        assertFalse(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:teiid:BQT!/path/foo.properties")); //$NON-NLS-1$
-        assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:teiid:BQT;")); //$NON-NLS-1$
-        assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:teiid:BQT;version=1;logFile=foo.txt")); //$NON-NLS-1$
-        assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:teiid:BQT.1;version=1;logFile=foo.txt")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Embedded, JDBCURL.acceptsUrl("jdbc:teiid:BQT")); //$NON-NLS-1$
+        assertNull(JDBCURL.acceptsUrl("jdbc:teiid:BQT!/path/foo.properties")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Embedded, JDBCURL.acceptsUrl("jdbc:teiid:BQT;")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Embedded, JDBCURL.acceptsUrl("jdbc:teiid:BQT;version=1;logFile=foo.txt")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Embedded, JDBCURL.acceptsUrl("jdbc:teiid:BQT.1;version=1;logFile=foo.txt")); //$NON-NLS-1$
     }
 
     @Test public void testParseURL() throws SQLException{
         Properties p = new Properties();
-        org.teiid.jdbc.EmbeddedProfile.parseURL("jdbc:teiid:BQT", p); //$NON-NLS-1$
+        TeiidDriver.parseURL("jdbc:teiid:BQT", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
         assertEquals(2, p.size());        
     }
 
     @Test public void testParseURL2() throws SQLException {
         Properties p = new Properties();       
-        org.teiid.jdbc.EmbeddedProfile.parseURL("jdbc:teiid:BQT;version=3", p); //$NON-NLS-1$
+        TeiidDriver.parseURL("jdbc:teiid:BQT;version=3", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("3")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VERSION).equals("3")); //$NON-NLS-1$
@@ -69,7 +66,7 @@
     
     @Test public void testParseURL3() throws SQLException{
         Properties p = new Properties();
-        org.teiid.jdbc.EmbeddedProfile.parseURL("jdbc:teiid:BQT@/metamatrix/dqp/dqp.properties;version=4;autoCommitTxn=ON;partialResultsMode=YES;", p); //$NON-NLS-1$
+        TeiidDriver.parseURL("jdbc:teiid:BQT;version=4;autoCommitTxn=ON;partialResultsMode=YES;", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("4")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VERSION).equals("4")); //$NON-NLS-1$
@@ -80,7 +77,7 @@
     
     @Test public void testParseURL4() throws SQLException{
         Properties p = new Properties();
-        org.teiid.jdbc.EmbeddedProfile.parseURL("jdbc:teiid:BQT;partialResultsMode=true", p); //$NON-NLS-1$
+        TeiidDriver.parseURL("jdbc:teiid:BQT;partialResultsMode=true", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
         assertTrue(p.getProperty(ExecutionProperties.PROP_PARTIAL_RESULTS_MODE).equals("true")); //$NON-NLS-1$
         assertEquals(3, p.size());                
@@ -88,19 +85,19 @@
     
     @Test public void testParseURL5() throws SQLException{
         Properties p = new Properties();
-        org.teiid.jdbc.EmbeddedProfile.parseURL("jdbc:teiid:BQT", p); //$NON-NLS-1$
+        TeiidDriver.parseURL("jdbc:teiid:BQT", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
     }
     
     @Test public void testParseURL55() throws SQLException{
         Properties p = new Properties();
-        org.teiid.jdbc.EmbeddedProfile.parseURL("jdbc:teiid:BQT;", p); //$NON-NLS-1$
+        TeiidDriver.parseURL("jdbc:teiid:BQT;", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
     }    
        
     @Test public void testParseURL6() throws SQLException{
         Properties p = new Properties();
-        org.teiid.jdbc.EmbeddedProfile.parseURL("jdbc:teiid:BQT;partialResultsMode=true;version=1", p); //$NON-NLS-1$
+        TeiidDriver.parseURL("jdbc:teiid:BQT;partialResultsMode=true;version=1", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
         assertTrue(p.getProperty(ExecutionProperties.PROP_PARTIAL_RESULTS_MODE).equals("true")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("1")); //$NON-NLS-1$

Modified: trunk/client/src/test/java/org/teiid/jdbc/TestJDBCURL.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestJDBCURL.java	2011-02-24 04:55:53 UTC (rev 2936)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestJDBCURL.java	2011-02-24 17:57:38 UTC (rev 2937)
@@ -25,15 +25,12 @@
 import java.net.URLEncoder;
 import java.util.Properties;
 
-import org.teiid.jdbc.BaseDataSource;
-import org.teiid.jdbc.ExecutionProperties;
-import org.teiid.jdbc.JDBCURL;
-import org.teiid.net.TeiidURL;
-
 import junit.framework.TestCase;
 
+import org.teiid.net.TeiidURL;
 
 
+
 /** 
  * @since 4.3
  */
@@ -42,13 +39,13 @@
     // Need to allow embedded spaces and ='s within optional properties
     public final void testCredentials() throws Exception {
         String credentials = URLEncoder.encode("defaultToLogon,(system=BQT1 SQL Server 2000 Simple Cap,user=xyz,password=xyz)", "UTF-8"); //$NON-NLS-1$ //$NON-NLS-2$
-        JDBCURL url = new JDBCURL("jdbc:metamatrix:QT_sqls2kds at mm://slwxp136:43100;credentials="+credentials); //$NON-NLS-1$
+        JDBCURL url = new JDBCURL("jdbc:teiid:QT_sqls2kds at mm://slwxp136:43100;credentials="+credentials); //$NON-NLS-1$
         Properties p = url.getProperties();
         assertEquals("defaultToLogon,(system=BQT1 SQL Server 2000 Simple Cap,user=xyz,password=xyz)", p.getProperty("credentials"));  //$NON-NLS-1$//$NON-NLS-2$        
     }
        
     public void testJDBCURLWithProperties() {
-        String URL = "jdbc:metamatrix:bqt at mm://localhost:12345;version=1;user=xyz;password=***;logLevel=1;configFile=testdata/bqt/dqp_stmt_e2e.xmi;disableLocalTxn=true;autoFailover=false"; //$NON-NLS-1$
+        String URL = "jdbc:teiid:bqt at mm://localhost:12345;version=1;user=xyz;password=***;logLevel=1;configFile=testdata/bqt/dqp_stmt_e2e.xmi;disableLocalTxn=true;autoFailover=false"; //$NON-NLS-1$
         
         Properties expectedProperties = new Properties();
         expectedProperties.setProperty("version", "1"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -65,7 +62,7 @@
     }
     
     public void testJDBCURLWithoutProperties() {
-        String URL = "jdbc:metamatrix:bqt at mm://localhost:12345"; //$NON-NLS-1$
+        String URL = "jdbc:teiid:bqt at mm://localhost:12345"; //$NON-NLS-1$
         
         JDBCURL url = new JDBCURL(URL); 
         assertEquals("bqt", url.getVDBName()); //$NON-NLS-1$
@@ -75,7 +72,7 @@
     
     public void testCaseConversion() {
         // Different case ------------------------------------HERE -v  ----------------and HERE  -v
-        String URL = "jdbc:metamatrix:bqt at mm://localhost:12345;VERSION=1;user=xyz;password=***;configFile=testdata/bqt/dqp_stmt_e2e.xmi"; //$NON-NLS-1$
+        String URL = "jdbc:teiid:bqt at mm://localhost:12345;VERSION=1;user=xyz;password=***;configFile=testdata/bqt/dqp_stmt_e2e.xmi"; //$NON-NLS-1$
         
         Properties expectedProperties = new Properties();
         expectedProperties.setProperty("version", "1"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -89,7 +86,7 @@
     }
     
     public void testWithExtraSemicolons() {
-        String URL = "jdbc:metamatrix:bqt at mm://localhost:12345;version=1;user=xyz;password=***;logLevel=1;;;configFile=testdata/bqt/dqp_stmt_e2e.xmi;;"; //$NON-NLS-1$
+        String URL = "jdbc:teiid:bqt at mm://localhost:12345;version=1;user=xyz;password=***;logLevel=1;;;configFile=testdata/bqt/dqp_stmt_e2e.xmi;;"; //$NON-NLS-1$
         
         Properties expectedProperties = new Properties();
         expectedProperties.setProperty("version", "1"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -104,7 +101,7 @@
     }
     
     public void testWithWhitespace() {
-        String URL = "jdbc:metamatrix:bqt at mm://localhost:12345; version =1;user= xyz ;password=***; logLevel = 1 ; configFile=testdata/bqt/dqp_stmt_e2e.xmi ;"; //$NON-NLS-1$
+        String URL = "jdbc:teiid:bqt at mm://localhost:12345; version =1;user= xyz ;password=***; logLevel = 1 ; configFile=testdata/bqt/dqp_stmt_e2e.xmi ;"; //$NON-NLS-1$
         
         Properties expectedProperties = new Properties();
         expectedProperties.setProperty("version", "1"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -119,7 +116,7 @@
     }
     
     public void testNoPropertyValue() {
-        String URL = "jdbc:metamatrix:bqt at mm://localhost:12345;version=1;user=xyz;password=***;logLevel=;configFile="; //$NON-NLS-1$
+        String URL = "jdbc:teiid:bqt at mm://localhost:12345;version=1;user=xyz;password=***;logLevel=;configFile="; //$NON-NLS-1$
         
         Properties expectedProperties = new Properties();
         expectedProperties.setProperty("version", "1"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -144,7 +141,7 @@
     }
     
     public void testNoVDBName() {
-        String URL = "jdbc:metamatrix:@mm://localhost:12345;version=1;user=xyz;password=***;logLevel=1"; //$NON-NLS-1$
+        String URL = "jdbc:teiid:@mm://localhost:12345;version=1;user=xyz;password=***;logLevel=1"; //$NON-NLS-1$
         try {
             new JDBCURL(URL);
             fail("Illegal argument should have failed."); //$NON-NLS-1$
@@ -154,7 +151,7 @@
     }
     
     public void testNoAtSignInURL() {
-        String URL = "jdbc:metamatrix:bqt!mm://localhost:12345;version=1;user=xyz;password=***;logLevel=1"; //$NON-NLS-1$
+        String URL = "jdbc:teiid:bqt!mm://localhost:12345;version=1;user=xyz;password=***;logLevel=1"; //$NON-NLS-1$
         try {
             new JDBCURL(URL);
             // No @ sign is llowed as part of embedded driver now, 
@@ -166,7 +163,7 @@
     }
     
     public void testMoreThanOneAtSign() {
-        String URL = "jdbc:metamatrix:bqt at mm://localhost:12345;version=1;user=xy@;password=***;logLevel=1"; //$NON-NLS-1$
+        String URL = "jdbc:teiid:bqt at mm://localhost:12345;version=1;user=xy@;password=***;logLevel=1"; //$NON-NLS-1$
         try {
             // this allowed as customer properties can have @ in their properties
             new JDBCURL(URL);            
@@ -176,7 +173,7 @@
     }
     
     public void testNoEqualsInProperty() {
-        String URL = "jdbc:metamatrix:bqt at mm://localhost:12345;version=1;user=xyz;password***;logLevel=1"; //$NON-NLS-1$
+        String URL = "jdbc:teiid:bqt at mm://localhost:12345;version=1;user=xyz;password***;logLevel=1"; //$NON-NLS-1$
         try {
             new JDBCURL(URL);
             fail("Illegal argument should have failed."); //$NON-NLS-1$
@@ -186,21 +183,21 @@
     }
     
     public void testMoreThanOneEqualsInProperty() {
-        String URL = "jdbc:metamatrix:bqt at mm://localhost:12345;version=1;user=xyz;password==***;logLevel=1"; //$NON-NLS-1$
+        String URL = "jdbc:teiid:bqt at mm://localhost:12345;version=1;user=xyz;password==***;logLevel=1"; //$NON-NLS-1$
         try {
             new JDBCURL(URL);
             fail("Illegal argument should have failed."); //$NON-NLS-1$
         } catch (IllegalArgumentException e) {
             // expected
         }
-        URL = "jdbc:metamatrix:bqt at mm://localhost:12345;version=1;user=xyz;password=***=;logLevel=1"; //$NON-NLS-1$
+        URL = "jdbc:teiid:bqt at mm://localhost:12345;version=1;user=xyz;password=***=;logLevel=1"; //$NON-NLS-1$
         try {
             new JDBCURL(URL);
             fail("Illegal argument should have failed."); //$NON-NLS-1$
         } catch (IllegalArgumentException e) {
             // expected
         }
-        URL = "jdbc:metamatrix:bqt at mm://localhost:12345;version=1;user=xyz;=password=***;logLevel=1"; //$NON-NLS-1$
+        URL = "jdbc:teiid:bqt at mm://localhost:12345;version=1;user=xyz;=password=***;logLevel=1"; //$NON-NLS-1$
         try {
             new JDBCURL(URL);
             fail("Illegal argument should have failed."); //$NON-NLS-1$
@@ -210,7 +207,7 @@
     }
     
     public void testNoKeyInProperty() {
-        String URL = "jdbc:metamatrix:bqt at mm://localhost:12345;version=1;user=xyz;=***;logLevel=1"; //$NON-NLS-1$
+        String URL = "jdbc:teiid:bqt at mm://localhost:12345;version=1;user=xyz;=***;logLevel=1"; //$NON-NLS-1$
         try {
             new JDBCURL(URL);
             fail("Illegal argument should have failed."); //$NON-NLS-1$
@@ -277,19 +274,19 @@
     public final void testEncodedPropertyInURL() throws Exception {
         String password = "=@#^&*()+!%$^%@#_-)_~{}||\\`':;,./<>?password has = & %"; //$NON-NLS-1$
         String encPassword = URLEncoder.encode(password, "UTF-8"); //$NON-NLS-1$
-        JDBCURL url = new JDBCURL("jdbc:metamatrix:QT_sqls2kds at mm://slwxp136:43100;PASswoRd="+encPassword); //$NON-NLS-1$
+        JDBCURL url = new JDBCURL("jdbc:teiid:QT_sqls2kds at mm://slwxp136:43100;PASswoRd="+encPassword); //$NON-NLS-1$
         Properties p = url.getProperties();
         assertEquals(password, p.getProperty("password"));  //$NON-NLS-1$
     }   
     
     
     public void testGetServerURL_NoProperties() {        
-        String result = new JDBCURL("jdbc:metamatrix:designtimecatalog at mm://slwxp172:44401;user=ddifranco;password=mm").getConnectionURL(); //$NON-NLS-1$
+        String result = new JDBCURL("jdbc:teiid:designtimecatalog at mm://slwxp172:44401;user=ddifranco;password=mm").getConnectionURL(); //$NON-NLS-1$
         assertEquals("mm://slwxp172:44401", result);         //$NON-NLS-1$
     }
 
     public void testGetServerURL_Properties() {        
-        String result = new JDBCURL("jdbc:metamatrix:designtimecatalog at mm://slwxp172:44401;user=ddifranco;password=mm").getConnectionURL(); //$NON-NLS-1$
+        String result = new JDBCURL("jdbc:teiid:designtimecatalog at mm://slwxp172:44401;user=ddifranco;password=mm").getConnectionURL(); //$NON-NLS-1$
         assertEquals("mm://slwxp172:44401", result);         //$NON-NLS-1$
     }
     
@@ -301,7 +298,7 @@
      */
     public void testGetServerURL_PasswordProperties() throws Exception {        
         String result = null;
-        String srcURL = "jdbc:metamatrix:designtimecatalog at mm://slwxp172:44401;user=ddifranco;password="; //$NON-NLS-1$
+        String srcURL = "jdbc:teiid:designtimecatalog at mm://slwxp172:44401;user=ddifranco;password="; //$NON-NLS-1$
         String password = null;
         String tgtURL = "mm://slwxp172:44401"; //$NON-NLS-1$
         
@@ -318,7 +315,7 @@
     }
     
     public void testGetServerURL_2Servers() {       
-        String result = new JDBCURL("jdbc:metamatrix:designtimecatalog at mm://slwxp172:44401,slabc123:12345;user=ddifranco;password=mm").getConnectionURL(); //$NON-NLS-1$
+        String result = new JDBCURL("jdbc:teiid:designtimecatalog at mm://slwxp172:44401,slabc123:12345;user=ddifranco;password=mm").getConnectionURL(); //$NON-NLS-1$
         assertEquals("mm://slwxp172:44401,slabc123:12345", result);         //$NON-NLS-1$
     }
 

Modified: trunk/client/src/test/java/org/teiid/jdbc/TestSocketProfile.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestSocketProfile.java	2011-02-24 04:55:53 UTC (rev 2936)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestSocketProfile.java	2011-02-24 17:57:38 UTC (rev 2937)
@@ -22,13 +22,13 @@
 
 package org.teiid.jdbc;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
 
 import java.sql.SQLException;
 import java.util.Properties;
 
 import org.junit.Test;
+import org.teiid.jdbc.JDBCURL.ConnectionType;
 import org.teiid.net.TeiidURL;
 
 
@@ -37,59 +37,58 @@
     
     /** Valid format of urls*/
     @Test public void testAcceptsURL1()  throws Exception   {
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:jvdb at mm://localhost:1234")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:jvdb at mm://localhost:1234")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://localhost:1234;version=x")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://localhost:1234")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://localhost:1234,localhost2:12342,localhost3:12343")); //$NON-NLS-1$       
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://localhost:1234;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://localhost:1234,localhost2:12342,localhost3:12343;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mms://localhost:1234;logLevel=1;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:@mm://localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;autoCommitTxn=OFF;paritalResultsMode=true")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:jvdb at mms://localhost:1234")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://localhost:1234;version=x")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://localhost:1234,localhost2:12342,localhost3:12343")); //$NON-NLS-1$       
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mms://localhost:1234,localhost2:12342,localhost3:12343;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mms://localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;autoCommitTxn=OFF;paritalResultsMode=true")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://127.0.0.1:1234;logLevel=2")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mms://127.0.0.1:1234")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://127.0.0.1:1234,localhost.mydomain.com:63636;logLevel=2")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://my-host.mydomain.com:53535,127.0.0.1:1234")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://123.123.123.123:53535,127.0.0.1:1234")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:jvdb at mm://localhost:1234")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:jvdb at mm://localhost:1234")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mm://localhost:1234;version=x")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mm://localhost:1234")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mm://localhost:1234,localhost2:12342,localhost3:12343")); //$NON-NLS-1$       
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mm://localhost:1234;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mm://localhost:1234,localhost2:12342,localhost3:12343;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mms://localhost:1234;logLevel=1;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
+        assertNull(JDBCURL.acceptsUrl("jdbc:teiid:@mm://localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mm://localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;autoCommitTxn=OFF;paritalResultsMode=true")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:jvdb at mms://localhost:1234")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mm://localhost:1234;version=x")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mm://localhost:1234,localhost2:12342,localhost3:12343")); //$NON-NLS-1$       
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mms://localhost:1234,localhost2:12342,localhost3:12343;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mms://localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;autoCommitTxn=OFF;paritalResultsMode=true")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mm://127.0.0.1:1234;logLevel=2")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mms://127.0.0.1:1234")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mm://127.0.0.1:1234,localhost.mydomain.com:63636;logLevel=2")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mm://my-host.mydomain.com:53535,127.0.0.1:1234")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mm://123.123.123.123:53535,127.0.0.1:1234")); //$NON-NLS-1$
         
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:jvdb at localhost:1234")); //$NON-NLS-1$
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:jvdb at localhost:1234")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:jvdb at localhost:1234")); //$NON-NLS-1$
 
         //DQP type
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:jvdb at c:/dqp.properties;version=1")); //$NON-NLS-1$
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:jvdb@/foo/dqp.properties;version=1")); //$NON-NLS-1$
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:jvdb at ../foo/dqp.properties;version=1")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:jvdb at c:/dqp.properties;version=1")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:jvdb@/foo/dqp.properties;version=1")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:jvdb at ../foo/dqp.properties;version=1")); //$NON-NLS-1$
         
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:jvdb at mm://localhost:port")); //$NON-NLS-1$
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:vdb at localhost:port;version=x")); //$NON-NLS-1$
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:@localhost:1234")); //$NON-NLS-1$
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:@localhost:1234,localhost2:12342,localhost3:12343")); //$NON-NLS-1$       
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:@localhost:1234;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:@localhost:1234,localhost2:12342,localhost3:12343;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:@localhost:1234;logLevel=1;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:@localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:@localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;autoCommitTxn=OFF;paritalResultsMode=true")); //$NON-NLS-1$
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:@localhost:1234;stickyConnections=false;socketsPerVM=4")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://my_host.mydomain.com:53535,127.0.0.1:1234")); //$NON-NLS-1$        
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:jvdb at mm://localhost:port")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at localhost:port;version=x")); //$NON-NLS-1$
+        assertNull(JDBCURL.acceptsUrl("jdbc:teiid:@localhost:1234")); //$NON-NLS-1$
+        assertNull(JDBCURL.acceptsUrl("jdbc:teiid:@localhost:1234,localhost2:12342,localhost3:12343")); //$NON-NLS-1$       
+        assertNull(JDBCURL.acceptsUrl("jdbc:teiid:@localhost:1234;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
+        assertNull(JDBCURL.acceptsUrl("jdbc:teiid:@localhost:1234,localhost2:12342,localhost3:12343;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
+        assertNull(JDBCURL.acceptsUrl("jdbc:teiid:@localhost:1234;logLevel=1;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
+        assertNull(JDBCURL.acceptsUrl("jdbc:teiid:@localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
+        assertNull(JDBCURL.acceptsUrl("jdbc:teiid:@localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;autoCommitTxn=OFF;paritalResultsMode=true")); //$NON-NLS-1$
+        assertNull(JDBCURL.acceptsUrl("jdbc:teiid:@localhost:1234;stickyConnections=false;socketsPerVM=4")); //$NON-NLS-1$
+        assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mm://my_host.mydomain.com:53535,127.0.0.1:1234")); //$NON-NLS-1$        
     }
 
     /** Invalid format of urls*/
     @Test public void testAcceptsURL2() throws Exception    {
-        assertTrue(!SocketProfile.acceptsURL("jdbc:matamatrix:test")); //$NON-NLS-1$
-        assertTrue(!SocketProfile.acceptsURL("metamatrix:test")); //$NON-NLS-1$
-        assertTrue(!SocketProfile.acceptsURL("jdbc&matamatrix:test")); //$NON-NLS-1$
-        assertTrue(!SocketProfile.acceptsURL("jdbc;metamatrix:test")); //$NON-NLS-1$
+        assertTrue(!TeiidDriver.getInstance().acceptsURL("jdbc:matamatrix:test")); //$NON-NLS-1$
+        assertTrue(!TeiidDriver.getInstance().acceptsURL("metamatrix:test")); //$NON-NLS-1$
+        assertTrue(!TeiidDriver.getInstance().acceptsURL("jdbc&matamatrix:test")); //$NON-NLS-1$
+        assertTrue(!TeiidDriver.getInstance().acceptsURL("jdbc;metamatrix:test")); //$NON-NLS-1$
     }   
 
     @Test public void testParseURL() throws SQLException{
         Properties p = new Properties();
-        SocketProfile.parseURL("jdbc:teiid:BQT at mm://slwxp157:1234", p); //$NON-NLS-1$
+        TeiidDriver.parseURL("jdbc:teiid:BQT at mm://slwxp157:1234", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
         assertTrue(p.getProperty(TeiidURL.CONNECTION.SERVER_URL).equals("mm://slwxp157:1234")); //$NON-NLS-1$
         assertEquals(3, p.size());        
@@ -97,7 +96,7 @@
 
     @Test public void testParseURL2() throws SQLException {
         Properties p = new Properties();       
-        SocketProfile.parseURL("jdbc:teiid:BQT at mms://slwxp157:1234;version=3", p); //$NON-NLS-1$
+        TeiidDriver.parseURL("jdbc:teiid:BQT at mms://slwxp157:1234;version=3", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("3")); //$NON-NLS-1$
         assertTrue(p.getProperty(TeiidURL.CONNECTION.SERVER_URL).equals("mms://slwxp157:1234")); //$NON-NLS-1$
@@ -108,7 +107,7 @@
     
     @Test public void testParseURL3() throws SQLException{
         Properties p = new Properties();
-        SocketProfile.parseURL("jdbc:teiid:BQT at mm://slwxp157:1234,slntmm01:43401,sluxmm09:43302;version=4;autoCommitTxn=ON;partialResultsMode=YES;ApplicationName=Client", p); //$NON-NLS-1$
+        TeiidDriver.parseURL("jdbc:teiid:BQT at mm://slwxp157:1234,slntmm01:43401,sluxmm09:43302;version=4;autoCommitTxn=ON;partialResultsMode=YES;ApplicationName=Client", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("4"));         //$NON-NLS-1$
         assertTrue(p.getProperty(ExecutionProperties.PROP_TXN_AUTO_WRAP).equals("ON")); //$NON-NLS-1$
@@ -121,11 +120,11 @@
     
     @Test
     public void testIPV6() throws SQLException{
-    	assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://[::1]:53535,127.0.0.1:1234")); //$NON-NLS-1$
-    	assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://[3ffe:ffff:0100:f101::1]:53535,127.0.0.1:1234")); //$NON-NLS-1$
+    	assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mm://[::1]:53535,127.0.0.1:1234")); //$NON-NLS-1$
+    	assertEquals(ConnectionType.Socket, JDBCURL.acceptsUrl("jdbc:teiid:vdb at mm://[3ffe:ffff:0100:f101::1]:53535,127.0.0.1:1234")); //$NON-NLS-1$
     	
     	Properties p = new Properties();
-        SocketProfile.parseURL("jdbc:teiid:BQT at mms://[3ffe:ffff:0100:f101::1]:1234;version=3", p); //$NON-NLS-1$
+    	TeiidDriver.parseURL("jdbc:teiid:BQT at mms://[3ffe:ffff:0100:f101::1]:1234;version=3", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("3")); //$NON-NLS-1$
         assertTrue(p.getProperty(TeiidURL.CONNECTION.SERVER_URL).equals("mms://[3ffe:ffff:0100:f101::1]:1234")); //$NON-NLS-1$
@@ -135,7 +134,7 @@
     @Test
     public void testIPV6MultipleHosts() throws SQLException{
     	Properties p = new Properties();
-        SocketProfile.parseURL("jdbc:teiid:BQT at mms://[3ffe:ffff:0100:f101::1]:1234,[::1]:31000,127.0.0.1:2134;version=3", p); //$NON-NLS-1$
+    	TeiidDriver.parseURL("jdbc:teiid:BQT at mms://[3ffe:ffff:0100:f101::1]:1234,[::1]:31000,127.0.0.1:2134;version=3", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("3")); //$NON-NLS-1$
         assertTrue(p.getProperty(TeiidURL.CONNECTION.SERVER_URL).equals("mms://[3ffe:ffff:0100:f101::1]:1234,[::1]:31000,127.0.0.1:2134")); //$NON-NLS-1$

Modified: trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDataSource.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDataSource.java	2011-02-24 04:55:53 UTC (rev 2936)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDataSource.java	2011-02-24 17:57:38 UTC (rev 2937)
@@ -27,14 +27,12 @@
 import java.sql.Connection;
 import java.sql.SQLException;
 
+import junit.framework.TestCase;
+
 import org.teiid.client.RequestMessage.ShowPlan;
 import org.teiid.core.util.UnitTestUtil;
-import org.teiid.jdbc.BaseDataSource;
-import org.teiid.jdbc.TeiidDataSource;
 
-import junit.framework.TestCase;
-
-
+ at SuppressWarnings("nls")
 public class TestTeiidDataSource extends TestCase {
 
     protected static final boolean VALID = true;
@@ -102,9 +100,7 @@
             return TeiidDataSource.reasonWhyInvalidSocketsPerVM(value);
         } else if ( propertyName.equals("stickyConnections")) { //$NON-NLS-1$
             return TeiidDataSource.reasonWhyInvalidStickyConnections(value);
-        } else if ( propertyName.equals("alternateServers")) { //$NON-NLS-1$
-            return TeiidDataSource.reasonWhyInvalidAlternateServers(value);
-        }
+        } 
 
         fail("Unknown property name \"" + propertyName + "\""); //$NON-NLS-1$ //$NON-NLS-2$
         return null;
@@ -159,7 +155,12 @@
         ds.setSecure(secure);
         ds.setAlternateServers(alternateServers);
 
-        final String url = ds.buildURL();
+        String url;
+		try {
+			url = ds.buildURL().getJDBCURL();
+		} catch (TeiidSQLException e) {
+			throw new RuntimeException(e);
+		}
         assertEquals(expectedURL, url);
     }
 
@@ -336,7 +337,7 @@
         helpTestReasonWhyInvalid("PortNumber", 1, VALID); //$NON-NLS-1$
     }
     public void testReasonWhyInvalidPortNumber2() {
-        helpTestReasonWhyInvalid("PortNumber", 9999999, VALID); //$NON-NLS-1$
+        helpTestReasonWhyInvalid("PortNumber", 9999999, INVALID); //$NON-NLS-1$
     }
     public void testReasonWhyInvalidPortNumber3() {
         helpTestReasonWhyInvalid("PortNumber", 0, VALID); //$NON-NLS-1$
@@ -406,62 +407,76 @@
         helpTestReasonWhyInvalid("stickyConnections", "YES", INVALID); //$NON-NLS-1$ //$NON-NLS-2$
     }
     
+    public void helpTestAlternateServer(String altServers, boolean valid) {
+    	this.dataSource.setAlternateServers(altServers);
+    	try {
+			this.dataSource.buildURL();
+			if (!valid) {
+				fail("expected exception");
+			}
+		} catch (TeiidSQLException e) {
+			if (valid) {
+				throw new RuntimeException(e);
+			}
+		}
+    }
+    
     public void testReasonWhyInvalidAlternateServers1() {
-    	helpTestReasonWhyInvalid("alternateServers", null, VALID); //$NON-NLS-1$
+    	helpTestAlternateServer(null, VALID); 
     }
     public void testReasonWhyInvalidAlternateServers2() {
-    	helpTestReasonWhyInvalid("alternateServers", "", VALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer("", VALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers3() {
-    	helpTestReasonWhyInvalid("alternateServers", "server", VALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer("server", VALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers4() {
-    	helpTestReasonWhyInvalid("alternateServers", "server:100", VALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer("server:100", VALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers5() {
-    	helpTestReasonWhyInvalid("alternateServers", "server:port", INVALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer("server:port", INVALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers6() {
-    	helpTestReasonWhyInvalid("alternateServers", "server:100:1", INVALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer("server:100:1", INVALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers7() {
-    	helpTestReasonWhyInvalid("alternateServers", "server:100:abc", INVALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer("server:100:abc", INVALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers8() {
-    	helpTestReasonWhyInvalid("alternateServers", "server:abc:100", INVALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer("server:abc:100", INVALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers9() {
-    	helpTestReasonWhyInvalid("alternateServers", ":100", INVALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer(":100", INVALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers10() {
-    	helpTestReasonWhyInvalid("alternateServers", ":abc", INVALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer(":abc", INVALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers11() {
-    	helpTestReasonWhyInvalid("alternateServers", "server1:100,server2", VALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer("server1:100,server2", VALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers12() {
-    	helpTestReasonWhyInvalid("alternateServers", "server1:100,server2:101", VALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer("server1:100,server2:101", VALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers13() {
-    	helpTestReasonWhyInvalid("alternateServers", "server1:100,", VALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer("server1:100,", VALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers14() {
-    	helpTestReasonWhyInvalid("alternateServers", "server1:100,server2:abc", INVALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer("server1:100,server2:abc", INVALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers15() {
-    	helpTestReasonWhyInvalid("alternateServers", "server1:100,server2:101:abc", INVALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer("server1:100,server2:101:abc", INVALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers16() {
-    	helpTestReasonWhyInvalid("alternateServers", "server1,server2:100", VALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer("server1,server2:100", VALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers17() {
-    	helpTestReasonWhyInvalid("alternateServers", "server1,server2", VALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer("server1,server2", VALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers18() {
-    	helpTestReasonWhyInvalid("alternateServers", ",server2:100", INVALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer(",server2:100", INVALID); //$NON-NLS-1$ 
     }
     public void testReasonWhyInvalidAlternateServers19() {
-    	helpTestReasonWhyInvalid("alternateServers", "server1,server2,server3,server4:500", VALID); //$NON-NLS-1$ //$NON-NLS-2$
+    	helpTestAlternateServer("server1,server2,server3,server4:500", VALID); //$NON-NLS-1$ 
     }
     
 
@@ -612,13 +627,13 @@
                             "jdbc:teiid:vdbName at mm://hostName:7001,hostName:7002,hostName2:7001,hostName2:7002;ApplicationName=JDBC;SHOWPLAN=ON;partialResultsMode=false;autoCommitTxn=DETECT;VirtualDatabaseName=vdbName"); //$NON-NLS-1$ 
     }
     
-    public void testBuildURL_AdditionalProperties() {
+    public void testBuildURL_AdditionalProperties() throws TeiidSQLException {
     	final TeiidDataSource ds = new TeiidDataSource();
     	ds.setAdditionalProperties("foo=bar;a=b"); //$NON-NLS-1$
     	ds.setServerName("hostName"); //$NON-NLS-1$
     	ds.setDatabaseName("vdbName"); //$NON-NLS-1$
     	ds.setPortNumber(1);
-    	assertEquals("jdbc:teiid:vdbName at mm://hostname:1;fetchSize=2048;ApplicationName=JDBC;a=b;VirtualDatabaseName=vdbName;foo=bar", ds.buildURL()); //$NON-NLS-1$
+    	assertEquals("jdbc:teiid:vdbName at mm://hostname:1;fetchSize=2048;ApplicationName=JDBC;a=b;VirtualDatabaseName=vdbName;foo=bar", ds.buildURL().getJDBCURL()); //$NON-NLS-1$
     }
 
     public void testInvalidDataSource() {

Modified: trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java	2011-02-24 04:55:53 UTC (rev 2936)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java	2011-02-24 17:57:38 UTC (rev 2937)
@@ -22,9 +22,7 @@
 
 package org.teiid.jdbc;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.*;
 
 import java.sql.DriverPropertyInfo;
 import java.util.Properties;
@@ -40,12 +38,12 @@
     	assertTrue(drv.acceptsURL("jdbc:teiid:vdb at mm://localhost:12345")); //$NON-NLS-1$
     	assertTrue(drv.acceptsURL("jdbc:teiid:vdb at 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:vdb@/foo/blah/deploy.properties")); //$NON-NLS-1$
     	
     	assertTrue(drv.acceptsURL("jdbc:teiid:vdb at mm://localhost:12345")); //$NON-NLS-1$
     	assertTrue(drv.acceptsURL("jdbc:teiid:vdb at 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: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 at mm://localhost:12345")); //$NON-NLS-1$
     	assertTrue(drv.acceptsURL("jdbc:teiid:test_vdb at mm://local-host:12345")); //$NON-NLS-1$
@@ -77,12 +75,12 @@
         assertTrue(drv.acceptsURL("jdbc:teiid:vdb at mm://123.123.123.123:53535,127.0.0.1:1234")); //$NON-NLS-1$
 
         //DQP type
-        assertTrue(!drv.acceptsURL("jdbc:teiid:jvdb at c:/dqp.properties;version=1")); //$NON-NLS-1$
-        assertTrue(!drv.acceptsURL("jdbc:teiid:jvdb@/foo/dqp.properties;version=1")); //$NON-NLS-1$
-        assertTrue(!drv.acceptsURL("jdbc:teiid:jvdb at ../foo/dqp.properties;version=1")); //$NON-NLS-1$
+        assertTrue(drv.acceptsURL("jdbc:teiid:jvdb at c:/dqp.properties;version=1")); //$NON-NLS-1$
+        assertTrue(drv.acceptsURL("jdbc:teiid:jvdb@/foo/dqp.properties;version=1")); //$NON-NLS-1$
+        assertTrue(drv.acceptsURL("jdbc:teiid:jvdb at ../foo/dqp.properties;version=1")); //$NON-NLS-1$
         
-        assertTrue(!drv.acceptsURL("jdbc:teiid:jvdb at mm://localhost:port")); //$NON-NLS-1$
-        assertTrue(!drv.acceptsURL("jdbc:teiid:vdb at localhost:port;version=x")); //$NON-NLS-1$
+        assertTrue(drv.acceptsURL("jdbc:teiid:jvdb at mm://localhost:port")); //$NON-NLS-1$
+        assertTrue(drv.acceptsURL("jdbc:teiid:vdb at localhost:port;version=x")); //$NON-NLS-1$
         assertTrue(!drv.acceptsURL("jdbc:teiid:@localhost:1234")); //$NON-NLS-1$
         assertTrue(!drv.acceptsURL("jdbc:teiid:@localhost:1234,localhost2:12342,localhost3:12343")); //$NON-NLS-1$       
         assertTrue(!drv.acceptsURL("jdbc:teiid:@localhost:1234;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
@@ -104,7 +102,7 @@
 
     @Test public void testParseURL() throws Exception{
         Properties p = new Properties();
-        SocketProfile.parseURL("jdbc:teiid:BQT at mm://slwxp157:1234", p); //$NON-NLS-1$
+        TeiidDriver.parseURL("jdbc:teiid:BQT at mm://slwxp157:1234", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
         assertTrue(p.getProperty(TeiidURL.CONNECTION.SERVER_URL).equals("mm://slwxp157:1234")); //$NON-NLS-1$
         assertEquals(3, p.size());        
@@ -112,7 +110,7 @@
 
     @Test public void testParseURL2() throws Exception {
         Properties p = new Properties();       
-        SocketProfile.parseURL("jdbc:teiid:BQT at mms://slwxp157:1234;version=3", p); //$NON-NLS-1$
+        TeiidDriver.parseURL("jdbc:teiid:BQT at mms://slwxp157:1234;version=3", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("3")); //$NON-NLS-1$
         assertTrue(p.getProperty(TeiidURL.CONNECTION.SERVER_URL).equals("mms://slwxp157:1234")); //$NON-NLS-1$
@@ -123,7 +121,7 @@
     
     @Test public void testParseURL3() throws Exception{
         Properties p = new Properties();
-        SocketProfile.parseURL("jdbc:teiid:BQT at mm://slwxp157:1234,slntmm01:43401,sluxmm09:43302;version=4;autoCommitTxn=ON;partialResultsMode=YES;ApplicationName=Client", p); //$NON-NLS-1$
+        TeiidDriver.parseURL("jdbc:teiid:BQT at mm://slwxp157:1234,slntmm01:43401,sluxmm09:43302;version=4;autoCommitTxn=ON;partialResultsMode=YES;ApplicationName=Client", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("4"));         //$NON-NLS-1$
         assertTrue(p.getProperty(ExecutionProperties.PROP_TXN_AUTO_WRAP).equals("ON")); //$NON-NLS-1$

Modified: trunk/client/src/test/java/org/teiid/net/TestTeiidURL.java
===================================================================
--- trunk/client/src/test/java/org/teiid/net/TestTeiidURL.java	2011-02-24 04:55:53 UTC (rev 2936)
+++ trunk/client/src/test/java/org/teiid/net/TestTeiidURL.java	2011-02-24 17:57:38 UTC (rev 2937)
@@ -22,18 +22,18 @@
 
 package org.teiid.net;
 
+import static org.junit.Assert.*;
+
+import java.net.MalformedURLException;
 import java.util.List;
 
 import org.junit.Test;
-import static org.junit.Assert.*;
 
 
 public class TestTeiidURL {
     
-    public static final String REQUIRED_URL = TeiidURL.FORMAT_SERVER;
-
     @Test
-    public final void testTeiidURL() {
+    public final void testTeiidURL() throws Exception {
         String SERVER_URL = "mm://localhost:31000"; //$NON-NLS-1$
         assertTrue(TeiidURL.isValidServerURL(SERVER_URL)); 
         
@@ -44,7 +44,7 @@
     }
     
     @Test
-    public final void testTeiidURLIPv6() {
+    public final void testTeiidURLIPv6() throws Exception {
         String SERVER_URL = "mm://[3ffe:ffff:0100:f101::1]:31000"; //$NON-NLS-1$
         assertTrue(TeiidURL.isValidServerURL(SERVER_URL)); 
         
@@ -57,33 +57,19 @@
     }    
     
     @Test
-    public final void testBogusProtocol() {  
+    public final void testBogusProtocol() throws Exception {  
         String SERVER_URL = "foo://localhost:31000"; //$NON-NLS-1$
         assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
-        
-        try {
-            new TeiidURL(SERVER_URL);
-            fail("MM URL passed non standard protocal fine"); //$NON-NLS-1$
-        } catch (RuntimeException e) {
-            assertEquals(TeiidURL.INVALID_FORMAT_SERVER, e.getMessage());
-        }
     }
     
     @Test
     public final void testBogusProtocol1() {       
         String SERVER_URL = "foo://localhost:31000"; //$NON-NLS-1$
         assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
-
-        try {
-            new TeiidURL(SERVER_URL);  
-            fail("MM URL passed non standard protocal fine"); //$NON-NLS-1$
-        } catch (RuntimeException e) {
-            assertEquals(TeiidURL.INVALID_FORMAT_SERVER, e.getMessage());
-        }
     }
     
     @Test
-    public final void testTeiidURLSecure() {
+    public final void testTeiidURLSecure() throws Exception {
         String SERVER_URL = "mms://localhost:31000"; //$NON-NLS-1$
         assertTrue(TeiidURL.isValidServerURL(SERVER_URL)); 
 
@@ -97,94 +83,50 @@
     public final void testTeiidURLBadProtocolMM() {
         String SERVER_URL = "mmm://localhost:31000"; //$NON-NLS-1$
         assertFalse(TeiidURL.isValidServerURL(SERVER_URL)); 
-
-        try {
-            new TeiidURL(SERVER_URL); 
-            fail("MMURL did not throw an exception"); //$NON-NLS-1$
-        } catch( IllegalArgumentException e ) {
-            assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
-        }
     }
     
     @Test
     public final void testTeiidURLWrongSlash() {
         String SERVER_URL = "mm:\\\\localhost:31000"; //$NON-NLS-1$
         assertFalse(TeiidURL.isValidServerURL(SERVER_URL));
-
-        try {
-            new TeiidURL(SERVER_URL); 
-            fail("MMURL did not throw an exception"); //$NON-NLS-1$
-        } catch( IllegalArgumentException e ) {
-            assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
-        }
     }
     
     @Test
     public final void testTeiidURLOneSlash() {
         String SERVER_URL = "mm:/localhost:31000"; //$NON-NLS-1$
         assertFalse(TeiidURL.isValidServerURL(SERVER_URL)); 
-        
-        try {
-            new TeiidURL(SERVER_URL); 
-            fail("MMURL did not throw an exception"); //$NON-NLS-1$
-        } catch( IllegalArgumentException e ) {
-            assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
-        }
     }
     
-    @Test
-    public final void testTeiidURLNoHost() {
+    @Test(expected=MalformedURLException.class)
+    public final void testTeiidURLNoHost() throws Exception {
         String SERVER_URL = "mm://:31000"; //$NON-NLS-1$
         assertFalse(TeiidURL.isValidServerURL(SERVER_URL)); 
 
-        try {
-            new TeiidURL(SERVER_URL); 
-            fail("MMURL did not throw an exception"); //$NON-NLS-1$
-        } catch( IllegalArgumentException e ) {
-            assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
-        }
+        new TeiidURL(SERVER_URL); 
     }
     
-    @Test
-    public final void testTeiidURLNoHostAndPort() {
+    @Test(expected=MalformedURLException.class)
+    public final void testTeiidURLNoHostAndPort() throws Exception {
         String SERVER_URL = "mm://:"; //$NON-NLS-1$
         assertFalse(TeiidURL.isValidServerURL(SERVER_URL)); 
 
-        try {
-            new TeiidURL(SERVER_URL);
-            fail("MMURL did not throw an exception"); //$NON-NLS-1$
-        } catch( IllegalArgumentException e ) {
-            assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
-        }
+        new TeiidURL(SERVER_URL);
     }
     
     @Test
     public final void testTeiidURLNoHostAndPort2() {
         String SERVER_URL = "mm://"; //$NON-NLS-1$
         assertFalse(TeiidURL.isValidServerURL(SERVER_URL)); 
-
-        try {
-            new TeiidURL(SERVER_URL); 
-            fail("MMURL did not throw an exception"); //$NON-NLS-1$
-        } catch( IllegalArgumentException e ) {
-            assertEquals(TeiidURL.INVALID_FORMAT_SERVER,e.getMessage());
-        }
     }
     
     @Test
     public final void testTeiidURLBadPort() {
         String SERVER_URL = "mm://localhost:port"; //$NON-NLS-1$
         assertFalse(TeiidURL.isValidServerURL(SERVER_URL)); 
-
-        try {
-            new TeiidURL(SERVER_URL); 
-            fail("MMURL did not throw an Exception"); //$NON-NLS-1$
-        } catch( IllegalArgumentException e ) {            
-        }
     }
     
     @Test
-    public final void testTeiidURL2Hosts() {
+    public final void testTeiidURL2Hosts() throws Exception {
         String SERVER_URL = "mm://localhost:31000,localhost:31001"; //$NON-NLS-1$        
         assertTrue(TeiidURL.isValidServerURL(SERVER_URL)); 
 
@@ -195,7 +137,7 @@
     }
     
     @Test
-    public final void testTeiidIPv6URL2Hosts() {
+    public final void testTeiidIPv6URL2Hosts() throws Exception {
         String SERVER_URL = "mm://[3ffe:ffff:0100:f101::1]:31000,[::1]:31001, 127.0.0.1:31003"; //$NON-NLS-1$        
         assertTrue(TeiidURL.isValidServerURL(SERVER_URL)); 
 
@@ -210,7 +152,7 @@
     }    
     
     @Test
-    public final void testTeiidURL3Hosts() {
+    public final void testTeiidURL3Hosts() throws Exception {
         String SERVER_URL = "mm://localhost:31000,localhost:31001,localhost:31002"; //$NON-NLS-1$        
         assertTrue(TeiidURL.isValidServerURL(SERVER_URL)); 
 
@@ -221,7 +163,7 @@
     }
 
     @Test
-    public final void testGetHostInfo() {
+    public final void testGetHostInfo() throws Exception {
         String SERVER_URL = "mm://localhost:31000"; //$NON-NLS-1$        
         assertTrue(TeiidURL.isValidServerURL(SERVER_URL)); 
  
@@ -230,27 +172,27 @@
     }
 
     @Test
-    public final void testGetProtocolStandalone() {
+    public final void testGetProtocolStandalone() throws Exception {
         TeiidURL url = new TeiidURL("mm://localhost:31000"); //$NON-NLS-1$
         assertNotNull(url);
         assertEquals("mm://localhost:31000",url.getAppServerURL()); //$NON-NLS-1$
     }
 
     @Test
-    public final void testHasMoreElements() {
+    public final void testHasMoreElements() throws Exception {
         TeiidURL url = new TeiidURL("mm://localhost:31000,localhost:31001"); //$NON-NLS-1$
         assertNotNull(url);
         assertFalse(url.getHostInfo().isEmpty());
     }
 
     @Test
-    public final void testNextElement() {
+    public final void testNextElement() throws Exception {
         TeiidURL url = new TeiidURL("mm://localhost:31000,localhost:31001"); //$NON-NLS-1$
         assertEquals(2, url.getHostInfo().size());
     }
 
     @Test
-    public final void testHostInfoEquals() {
+    public final void testHostInfoEquals() throws Exception {
         HostInfo expectedResults = new HostInfo("localhost",31000);  //$NON-NLS-1$
         TeiidURL url = new TeiidURL("mm://localhost:31000"); //$NON-NLS-1$
         HostInfo actualResults = url.getHostInfo().get(0);
@@ -258,7 +200,7 @@
     }
         
     @Test
-    public final void testWithEmbeddedSpaces() {
+    public final void testWithEmbeddedSpaces() throws Exception {
         HostInfo expectedResults = new HostInfo("localhost",12345);  //$NON-NLS-1$
         
         TeiidURL url = new TeiidURL("mm://localhost : 12345"); //$NON-NLS-1$

Modified: trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java	2011-02-24 04:55:53 UTC (rev 2936)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java	2011-02-24 17:57:38 UTC (rev 2937)
@@ -151,7 +151,7 @@
 	
 	public ConnectionImpl createConnection(String embeddedURL) throws Exception {
 		final Properties p = new Properties();
-		EmbeddedProfile.parseURL(embeddedURL, p);
+		TeiidDriver.parseURL(embeddedURL, p);
 
 		LocalServerConnection conn = new LocalServerConnection(p) {
 			@Override



More information about the teiid-commits mailing list