[teiid-commits] teiid SVN: r1917 - in trunk/connector-sdk: src/main/java/com/metamatrix/cdk and 8 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Fri Mar 5 10:12:25 EST 2010


Author: shawkins
Date: 2010-03-05 10:12:25 -0500 (Fri, 05 Mar 2010)
New Revision: 1917

Removed:
   trunk/connector-sdk/src/main/java/com/metamatrix/cdk/ConnectorShell.java
   trunk/connector-sdk/src/main/java/com/metamatrix/cdk/ConnectorShellCommandTarget.java
   trunk/connector-sdk/src/main/java/com/metamatrix/cdk/IConnectorHost.java
   trunk/connector-sdk/src/main/java/com/metamatrix/cdk/QueryCommandTarget.java
   trunk/connector-sdk/src/main/java/com/metamatrix/cdk/api/EnvironmentUtility.java
   trunk/connector-sdk/src/main/java/com/metamatrix/cdk/file/
   trunk/connector-sdk/src/main/java/com/metamatrix/common/classloader/
   trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/ConnectorResultUtility.java
   trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/ScriptCommandTarget.java
   trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/ScriptFileNameStack.java
   trunk/connector-sdk/src/main/java/com/metamatrix/core/factory/
   trunk/connector-sdk/src/main/resources/com/metamatrix/cdk/Template.cdk
   trunk/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestScriptFileNameStack.java
   trunk/connector-sdk/src/test/java/com/metamatrix/core/factory/
Modified:
   trunk/connector-sdk/
   trunk/connector-sdk/pom.xml
   trunk/connector-sdk/src/main/java/com/metamatrix/cdk/CommandBuilder.java
   trunk/connector-sdk/src/main/java/com/metamatrix/cdk/api/ConnectorHost.java
   trunk/connector-sdk/src/main/java/com/metamatrix/cdk/api/TranslationUtility.java
   trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/Command.java
   trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/ScriptReader.java
   trunk/connector-sdk/src/test/java/com/metamatrix/cdk/unittest/FakeTranslationFactory.java
   trunk/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestCommand.java
   trunk/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestShell.java
Log:
TEIID-833 committing JCA merge


Property changes on: trunk/connector-sdk
___________________________________________________________________
Name: svn:mergeinfo
   - 

Modified: trunk/connector-sdk/pom.xml
===================================================================
--- trunk/connector-sdk/pom.xml	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/pom.xml	2010-03-05 15:12:25 UTC (rev 1917)
@@ -53,6 +53,10 @@
 		</resources>
 	</build>
 	<dependencies>
+        <dependency>
+            <groupId>org.jboss.teiid</groupId>
+            <artifactId>teiid-client</artifactId>
+        </dependency>    
 		<dependency>
 			<groupId>org.jboss.teiid</groupId>
 			<artifactId>teiid-connector-api</artifactId>
@@ -79,5 +83,10 @@
 			<groupId>beanshell</groupId>
 			<artifactId>bsh</artifactId>
 		</dependency>
+        <dependency>
+          <groupId>javax.resource</groupId>
+          <artifactId>connector-api</artifactId>
+          <scope>provided</scope>
+        </dependency>        
 	</dependencies>
 </project>
\ No newline at end of file

Modified: trunk/connector-sdk/src/main/java/com/metamatrix/cdk/CommandBuilder.java
===================================================================
--- trunk/connector-sdk/src/main/java/com/metamatrix/cdk/CommandBuilder.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/main/java/com/metamatrix/cdk/CommandBuilder.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -26,10 +26,8 @@
 import java.util.Iterator;
 import java.util.List;
 
-import org.teiid.connector.language.ICommand;
-import org.teiid.connector.language.ILanguageFactory;
+import org.teiid.connector.language.LanguageFactory;
 import org.teiid.dqp.internal.datamgr.language.LanguageBridgeFactory;
-import org.teiid.dqp.internal.datamgr.language.LanguageFactoryImpl;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.query.QueryParserException;
@@ -51,8 +49,8 @@
  */
 public class CommandBuilder {
 	
-	public static ILanguageFactory getLanuageFactory() {
-		return LanguageFactoryImpl.INSTANCE;
+	public static LanguageFactory getLanuageFactory() {
+		return LanguageFactory.INSTANCE;
 	}
 
     private QueryMetadataInterface metadata;
@@ -64,11 +62,11 @@
         this.metadata = metadata;
     }
     
-    public ICommand getCommand(String queryString) {
+    public org.teiid.connector.language.Command getCommand(String queryString) {
         return getCommand(queryString, false, false);
     }
     
-    public ICommand getCommand(String queryString, boolean generateAliases, boolean supportsGroupAlias) {
+    public org.teiid.connector.language.Command getCommand(String queryString, boolean generateAliases, boolean supportsGroupAlias) {
         Command command = null;
         try {
             command = QueryParser.getQueryParser().parseCommand(queryString);
@@ -78,8 +76,7 @@
             if (generateAliases) {
                 command.acceptVisitor(new AliasGenerator(supportsGroupAlias));
             }
-            ICommand result =  new LanguageBridgeFactory(metadata).translate(command);
-            return result;
+            return new LanguageBridgeFactory(metadata).translate(command);
         } catch (QueryParserException e) {
             throw new MetaMatrixRuntimeException(e);
         } catch (QueryResolverException e) {
@@ -89,8 +86,6 @@
         } catch (QueryValidatorException e) {
             throw new MetaMatrixRuntimeException(e);
         }
-
-        
     }
     
     /**

Deleted: trunk/connector-sdk/src/main/java/com/metamatrix/cdk/ConnectorShell.java
===================================================================
--- trunk/connector-sdk/src/main/java/com/metamatrix/cdk/ConnectorShell.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/main/java/com/metamatrix/cdk/ConnectorShell.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -1,117 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.cdk;
-
-import com.metamatrix.core.commandshell.CommandShell;
-
-
-/**
- * Command line utility to execute queries on a connector.
- */
-public class ConnectorShell extends CommandShell {
-	
-	
-
-    public ConnectorShell(IConnectorHost host) {
-        super(new ConnectorShellCommandTarget(host));
-    }
-    
-    public ConnectorShell(ConnectorShellCommandTarget target) {
-        super(target);
-    }
-
-    public static void main(String[] args) {
-        System.out.println("Starting"); //$NON-NLS-1$
-        
-        new ConnectorShell(new ConnectorShellCommandTarget()).run(args, DEFAULT_LOG_FILE);
-    }
-    
-    protected boolean showHelpFor(String methodName) {
-        return getParameterNamesDirect(methodName) != null;
-    }
-    
-    protected String[] getParameterNames(String methodName) {
-        String[] result = getParameterNamesDirect(methodName);
-        if (result == null) {
-            result = new String[] {};
-        }
-        return result;
-    }
-
-    private String[] getParameterNamesDirect(String methodName) {
-        if (methodName.equals("select")) { //$NON-NLS-1$
-            return new String[] { "query" }; //$NON-NLS-1$
-        } else if (methodName.equals("run")) { //$NON-NLS-1$
-            return new String[] { "scriptName" }; //$NON-NLS-1$
-        } else if (methodName.equals("setProperty")) { //$NON-NLS-1$
-            return new String[] { "propertyName", "propertyValue" }; //$NON-NLS-1$ //$NON-NLS-2$
-        } else if (methodName.equals("load")) { //$NON-NLS-1$
-            return new String[] { "fullyQualifiedConnectorClassName", "pathToVdbFile" }; //$NON-NLS-1$ //$NON-NLS-2$
-        } else if (methodName.equals("getProperties")) { //$NON-NLS-1$
-            return new String[] {};
-        } else if (methodName.equals("delete")) { //$NON-NLS-1$
-            return new String[] { "multilineSqlTerminatedWith;" }; //$NON-NLS-1$
-        } else if (methodName.equals("insert")) { //$NON-NLS-1$
-            return new String[] { "multilineSqlTerminatedWith;" }; //$NON-NLS-1$
-        } else if (methodName.equals("help")) { //$NON-NLS-1$
-            return new String[] { "" }; //$NON-NLS-1$
-        } else if (methodName.equals("update")) { //$NON-NLS-1$
-            return new String[] { "multilineSqlTerminatedWith;" }; //$NON-NLS-1$
-        } else if (methodName.equals("select")) { //$NON-NLS-1$
-            return new String[] { "multilineSqlTerminatedWith;" }; //$NON-NLS-1$
-        } else if (methodName.equals("quit")) { //$NON-NLS-1$
-            return new String[] { "" }; //$NON-NLS-1$
-        } else if (methodName.equals("runScript")) { //$NON-NLS-1$
-            return new String[] { "pathToScriptFile", "scriptNameWithinFile" }; //$NON-NLS-1$ //$NON-NLS-2$
-        } else if (methodName.equals("loadFromScript")) { //$NON-NLS-1$
-            return new String[] { "pathToConfiguratonScript" };         //$NON-NLS-1$
-        } else if (methodName.equals("setFailOnError")) { //$NON-NLS-1$
-            return new String[] { "boolean" }; //$NON-NLS-1$
-        } else if (methodName.equals("setPrintStackOnError")) { //$NON-NLS-1$
-            return new String[] { "boolean" }; //$NON-NLS-1$
-        } else if (methodName.equals("setSecurityContext")) { //$NON-NLS-1$
-            return new String[] { "vdbName", "vdbVersion", "userName" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        } else if (methodName.equals("setScriptFile")) { //$NON-NLS-1$
-            return new String[] { "pathToScriptFile" }; //$NON-NLS-1$
-        } else if (methodName.equals("runAll")) { //$NON-NLS-1$
-            return new String[] {};
-        } else if (methodName.equals("setBatchSize")) { //$NON-NLS-1$
-            return new String[] { "batchSize" }; //$NON-NLS-1$
-        } else if (methodName.equalsIgnoreCase("start")) { //$NON-NLS-1$
-            return new String[] {};
-        } else if (methodName.equalsIgnoreCase("stop")) { //$NON-NLS-1$
-            return new String[] {};
-        } else if (methodName.equalsIgnoreCase("loadProperties")) { //$NON-NLS-1$
-            return new String[] {"pathToPropertyFile"}; //$NON-NLS-1$
-        } else if (methodName.equalsIgnoreCase("createTemplate")) { //$NON-NLS-1$
-            return new String[] {"pathToTemplateFile"}; //$NON-NLS-1$
-        } else if (methodName.equalsIgnoreCase("createArchive")) { //$NON-NLS-1$
-            return new String[] {"pathToArchiveFileName", "pathToCDKFileName", "pathToDirectoryForExtenstionModules"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        } else if (methodName.equalsIgnoreCase("loadArchive")) { //$NON-NLS-1$
-            return new String[] {"pathToArchiveFileName", "newConnectorTypeName"}; //$NON-NLS-1$//$NON-NLS-2$
-        } else if (methodName.equalsIgnoreCase("exec")) { //$NON-NLS-1$
-            return new String[] {"fullyQualifiedProcedureName"}; //$NON-NLS-1$
-        }
-        return null;
-    }
-}

Deleted: trunk/connector-sdk/src/main/java/com/metamatrix/cdk/ConnectorShellCommandTarget.java
===================================================================
--- trunk/connector-sdk/src/main/java/com/metamatrix/cdk/ConnectorShellCommandTarget.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/main/java/com/metamatrix/cdk/ConnectorShellCommandTarget.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -1,461 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.cdk;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.StringTokenizer;
-import java.util.TreeSet;
-
-import org.teiid.connector.api.Connector;
-import org.teiid.connector.api.ConnectorException;
-import org.teiid.connector.language.ICommand;
-import org.teiid.connector.language.IProcedure;
-import org.teiid.connector.language.IQuery;
-
-import com.metamatrix.cdk.api.ConnectorHost;
-import com.metamatrix.cdk.file.ConfigReaderWriter;
-import com.metamatrix.cdk.file.XMLConfigReaderWriter;
-import com.metamatrix.common.config.api.ConnectorArchive;
-import com.metamatrix.common.config.api.ConnectorBinding;
-import com.metamatrix.common.config.api.ConnectorBindingType;
-import com.metamatrix.common.config.api.ExtensionModule;
-import com.metamatrix.common.config.model.BasicConfigurationObjectEditor;
-import com.metamatrix.common.config.model.BasicConnectorArchive;
-import com.metamatrix.common.config.model.BasicExtensionModule;
-import com.metamatrix.common.config.xml.XMLConfigurationImportExportUtility;
-import com.metamatrix.common.util.ByteArrayHelper;
-import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.core.commandshell.ConnectorResultUtility;
-import com.metamatrix.core.factory.ComponentLoader;
-import com.metamatrix.core.util.FileUtils;
-import com.metamatrix.core.util.StringUtilities;
-
-
-/**
- * Implements the commands supported by the ConnectorShell.  Delegates to a ConnectorHost to execute queries.
- */
-public class ConnectorShellCommandTarget extends QueryCommandTarget {
-    private static final String MM_JAR_PROTOCOL = "extensionjar"; //$NON-NLS-1$   
-    private static final String CONNECTOR_CLASSPATH = "ConnectorClassPath"; //$NON-NLS-1$
-    private static final String CONNECTOR_CLASS_NAME = "ConnectorClass"; //$NON-NLS-1$
-    
-    private IConnectorHost connectorHost;
-    private Properties connectorProperties = null;
-    private Connector connector;
-    private String vdbFileName;
-    private String connectorClassName = null;
-    private URLClassLoader connectorClassLoader = null;
-    public ConnectorShellCommandTarget() {
-    }
-    
-    public ConnectorShellCommandTarget(IConnectorHost connectorHost) {
-        this.connectorHost = connectorHost;
-    }
-    
-    protected String execute(String query) {
-        try {
-            ICommand command = getConnectorHost().getCommand(query);
-            String[] columnNames = null;
-            if(command instanceof IQuery) {
-                IQuery iquery = (IQuery) command;
-                columnNames = iquery.getColumnNames();
-            } else if (!(command instanceof IProcedure)){
-                columnNames = new String[] {"count"}; //$NON-NLS-1$
-            }
-            List results = getConnectorHost().executeCommand(command);
-            return ConnectorResultUtility.resultsToString(results, columnNames);
-        } catch (ConnectorException e) {
-            throw new MetaMatrixRuntimeException(e);
-        }
-    }
-
-    protected Set getMethodsToIgnore() {
-        Set result = new HashSet();
-        result.addAll(Arrays.asList( new String[] { "runRep", "setUsePreparedStatement"} )); //$NON-NLS-1$ //$NON-NLS-2$
-        return result;
-    }
-
-    /**
-     * Executes the provided script and expects the script to produce a ConnectorHost for executing queries.
-     * @param configurationScriptFileName Resource name of the script file to be loaded from the class path.
-     */
-    public void loadFromScript(String configurationScriptFileName) {
-        ComponentLoader loader = new ComponentLoader(this.getClass().getClassLoader(), configurationScriptFileName);       
-        connectorHost = (IConnectorHost) loader.load("ConnectorHost"); //$NON-NLS-1$
-    }
-    
-    public void load(String connectorClassName, String vdbFileName) throws IllegalAccessException,
-        InstantiationException, ClassNotFoundException {
-        if (connectorClassLoader == null) {
-            Class.forName(connectorClassName);	// Just make sure we load the class
-            this.connectorProperties = new Properties();
-        }
-        else {
-            connectorClassLoader.loadClass(connectorClassName).newInstance();
-        }        
-        this.vdbFileName = vdbFileName;
-        this.connectorClassName = connectorClassName; 
-        connectorHost = null;
-    }
-    
-
-    public void start() throws IllegalAccessException,
-    	InstantiationException, ClassNotFoundException {
-        if (connectorHost == null) {
-            if (vdbFileName == null) {
-                throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.Connector_must_be_loaded_before_it_can_be_used._1")); //$NON-NLS-1$
-            }
-            if (connectorClassLoader == null) {
-                connector = (Connector) Class.forName(connectorClassName).newInstance();
-            }
-            else {
-                connector = (Connector) connectorClassLoader.loadClass(connectorClassName).newInstance();
-            }
-            connectorHost = new ConnectorHost(connector, connectorProperties, shell.expandFileName(vdbFileName));     
-        }
-    }
-    
-    public void stop() {
-        if (connector != null) {
-            connector.stop();
-            connector = null;
-        } 
-        connectorHost = null;
-    }
-    
-    public void loadProperties(String propertyFileName) {
-        File propertyFile = new File(propertyFileName);
-        if(!propertyFile.exists()
-        || !propertyFile.isFile()
-        || !propertyFile.canRead()) {
-            throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.Cannot_read_from_file__{0}_1", propertyFile)); //$NON-NLS-1$
-        }
-        try {
-            connectorProperties = loadFromXMLConfig(propertyFile);
-            return;
-        } catch (Exception e) {
-            // Assume this is a properties file, not an XML file.
-        }
-        connectorProperties = loadFromPropertiesFile(propertyFile);
-    }
-    
-    private Properties loadFromXMLConfig(File propertyFile) {
-        ConfigReaderWriter xmlConfig = new XMLConfigReaderWriter();
-        InputStream in = null;
-        try {
-            in = new FileInputStream(propertyFile);
-        } catch (IOException e) {
-            throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.Cannot_read_from_file__{0}_1", propertyFile)); //$NON-NLS-1$
-        }
-        
-        try {
-            ConnectorBinding binding = (ConnectorBinding) xmlConfig.loadConnectorBinding(in)[1];
-            return binding.getProperties();
-        } catch (Exception e) {
-            throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.Could_not_load_XML_configuration_from_file__{0}_1", propertyFile)); //$NON-NLS-1$
-        } finally {
-            try {
-                in.close();
-            } catch (Exception e) {
-            }
-        }
-    }
-    
-    private Properties loadFromPropertiesFile(File propertyFile) {
-        Properties props = new Properties();
-        InputStream in = null;
-        try {
-            in = new FileInputStream(propertyFile);
-            props.load(in);
-            return props;
-        } catch (IOException e) {
-            throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.Cannot_read_from_file__{0}_1", propertyFile)); //$NON-NLS-1$
-        } finally {
-            try {
-                in.close();
-            } catch (Exception e) {
-            }
-        }
-    }
-    
-    public void setFailOnError(boolean failOnError) {
-        if (failOnError) {
-            shell.turnOffExceptionHandling();
-        } else {
-            shell.turnOnExceptionHandling();
-        }        
-    }
-    
-    public void setPrintStackOnError(boolean printStackOnError) {
-        shell.setPrintStackTraceOnException(printStackOnError);
-    }
-    
-    public void setSecurityContext(String vdbName, String vdbVersion, String userName) {
-        getConnectorHost().setSecurityContext(vdbName, vdbVersion, userName, null, null);
-    }
-    
-    public void setBatchSize(int batchSize) {
-    }
-
-    public void setProperty(String propertyName, String propertyValue) {
-        if (connectorHost == null) {
-            if (connectorProperties == null) {
-                connectorProperties = new Properties();
-            }
-            connectorProperties.put(propertyName, propertyValue);
-        } else {
-            throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.Cannot_set_connector_properties_after_the_connector_is_started._1")); //$NON-NLS-1$
-        }
-    }
-    
-    private IConnectorHost getConnectorHost() {
-        return connectorHost;
-    }
-    
-    public String getProperties() {
-        StringBuffer props = new StringBuffer();
-        IConnectorHost host = getConnectorHost();
-        if (host != null) {
-            Properties properties = host.getConnectorEnvironmentProperties();
-            stringifyProperties(properties, props);
-        } else if (connectorProperties != null) {
-            stringifyProperties(connectorProperties, props);
-        }
-        return props.toString();
-    }
-    
-    public void createTemplate(String filename) {
-        File file = new File(filename);
-        if (file.exists()) {
-            if (!file.canWrite()) {
-                throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.Cannot_write_to_file__{0}_3", file)); //$NON-NLS-1$
-            }
-        } else if (file.getParentFile() == null || file.getParentFile().exists()) {
-            try {
-                if (!file.createNewFile()) {
-                    throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.Cannot_create_file__{0}_4", file)); //$NON-NLS-1$
-                }
-            } catch (IOException e) {
-                throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.Cannot_create_file__{0}_4", file)); //$NON-NLS-1$
-            }
-        } else {
-            throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.Cannot_create_file_{0}_because_directory_{1}_does_not_exist._6", file, file.getParentFile())); //$NON-NLS-1$
-        }
-        FileOutputStream out = null;
-        try {
-            out = new FileOutputStream(file);
-        } catch (FileNotFoundException e) {
-            throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.Cannot_write_to_file__{0}_3", file)); //$NON-NLS-1$
-        }
-        
-        InputStream template = getClass().getResourceAsStream("Template.cdk"); //$NON-NLS-1$
-        int readByte = -1;
-        try {
-            while((readByte = template.read()) != -1) {
-                out.write(readByte);
-            }
-        } catch (IOException e) {
-            throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.Cannot_write_to_file__{0}_3", file)); //$NON-NLS-1$
-        } finally {
-            try {
-                template.close();
-            } catch (Exception e) {
-            }
-            try {
-                out.close();
-            } catch (Exception e) {
-            }
-        }
-    }
-    
-    /**
-     * Build the connector archive file. ( This is duplicate code from the 
-     * ConnectorArchiveImportExport class, due to dependency reasons I had to
-     * write)
-     *  
-     * @param filename
-     * @param cdkName
-     * @param extDirName
-     * @since 4.3.2
-     */
-    public void createArchive(String fileName, String cdkName, String extDirName) {
-        
-        String lcaseCdkName = cdkName.toLowerCase();
-        
-        File out = new File(fileName);
-        if (out.exists()) {
-            throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.archive_file_exists", fileName)); //$NON-NLS-1$            
-        }
-        
-        File cdk = new File(cdkName);
-        if (!cdk.exists() || !lcaseCdkName.endsWith(".cdk")) { //$NON-NLS-1$
-            throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.bad_cdk_file", cdkName)); //$NON-NLS-1$
-        }
-        
-        File extDir = new File(extDirName);
-        if (!extDir.exists() || !extDir.isDirectory()) {
-            throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.bad_extdir", extDirName)); //$NON-NLS-1$
-        }
-        
-        File[] extModules = extDir.listFiles();        
-        if (extModules.length == 0) {
-            throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.no_ext_modules", extDirName)); //$NON-NLS-1$            
-        }
-                
-        try {
-            BasicConnectorArchive archive = new BasicConnectorArchive();
-            XMLConfigurationImportExportUtility util = new XMLConfigurationImportExportUtility();
-            List types = new ArrayList(util.importComponentTypes(new FileInputStream(cdk), new BasicConfigurationObjectEditor()));
-            ConnectorBindingType type = (ConnectorBindingType)types.get(0);
-            archive.addConnectorType(type);
-            
-            // Look at the connector type and find all the needextension modules
-            List neededExtensionModules = getExtensionJarNames(type);            
-            for (final Iterator i = neededExtensionModules.iterator(); i.hasNext();) {
-                final String extName = (String)i.next();
-                File extModule = new File(extDirName, extName);
-                BasicExtensionModule ext = new BasicExtensionModule(extModule.getName(), ExtensionModule.JAR_FILE_TYPE, "JAR File", ByteArrayHelper.toByteArray(extModule)); //$NON-NLS-1$
-                archive.addExtensionModule(type, ext);                
-            }
-            
-            // write the archive file
-            FileOutputStream fout = new FileOutputStream(out);
-            util.exportConnectorArchive(fout, archive, null);
-            fout.close();
-            
-        } catch (Exception e) {
-            throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.failed_create_archive", e.getMessage())); //$NON-NLS-1$
-        }
-    }
-        
-    /**
-     * Load the archive file, so that the connector can be started 
-     * @param fileName
-     * @param typeName Name to give the new connector type.
-     * @since 4.3.2
-     */
-    public void loadArchive(String fileName, String typeName) {
-        XMLConfigurationImportExportUtility util = new XMLConfigurationImportExportUtility();
-        
-        File archiveFile = new File(fileName);
-        if(!archiveFile.exists()) {
-            throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.bad_archive_file", fileName)); //$NON-NLS-1$
-        }
-        
-        try {
-            FileInputStream in = new FileInputStream(archiveFile);
-            ConnectorArchive archive = util.importConnectorArchive(in, new BasicConfigurationObjectEditor());
-            in.close();
-            
-            ConnectorBindingType type = archive.getConnectorTypes()[0];
-            ExtensionModule[] extModules = archive.getExtensionModules(type);
-
-            // write the needed extension jar files to disk
-            List extModuleUrls = new ArrayList();
-            List neededExtensionModules = getExtensionJarNames(type);
-            for (final Iterator i = neededExtensionModules.iterator(); i.hasNext();) {
-                final String extName = (String)i.next();                
-                for (int j = 0; j < extModules.length; j++) {
-                    if (extModules[j].getFullName().equalsIgnoreCase(extName)) {
-                        File targetFile = new File("extensions/"+extModules[j].getFullName()); //$NON-NLS-1$
-                        FileUtils.write(extModules[j].getFileContents(), targetFile.getCanonicalFile()); 
-                        extModuleUrls.add(targetFile.toURL());
-                    }
-                }                
-            } // for
-            
-            connectorClassName = type.getDefaultValue(CONNECTOR_CLASS_NAME);
-            URL[] urls = (URL[])extModuleUrls.toArray(new URL[extModuleUrls.size()]);
-            connectorClassLoader = new URLClassLoader(urls, this.getClass().getClassLoader());
-            this.connectorProperties = new Properties();
-            
-            // Now set the rest of the properties
-            Properties props = type.getDefaultPropertyValues();
-            Iterator keys = props.keySet().iterator();
-            while(keys.hasNext()) {
-                String key = (String)keys.next();
-                if (!key.equals(CONNECTOR_CLASS_NAME) && !key.equals(CONNECTOR_CLASSPATH)) {
-                    String value = type.getDefaultValue(key);
-                    if (value != null) {
-                        setProperty(key, type.getDefaultValue(key));
-                    }
-                }
-            }
-                
-        } catch (Exception e) {
-            throw new RuntimeException(CdkPlugin.Util.getString("ConnectorShellCommandTarget.failed_load_archive", e.getMessage())); //$NON-NLS-1$            
-        }
-    }
-    
-    /**
-     * Gets the extension modules needed by this connector type 
-     * @param type
-     * @return
-     * @since 4.3
-     */
-    private List getExtensionJarNames(ConnectorBindingType type) {
-        List modules = new ArrayList();
-        String classPath = type.getDefaultValue(CONNECTOR_CLASSPATH); 
-        StringTokenizer st = new StringTokenizer(classPath, ";"); //$NON-NLS-1$
-        while (st.hasMoreTokens()) {
-            String path = st.nextToken();
-            int idx = path.indexOf(MM_JAR_PROTOCOL);
-            if (idx != -1) {
-                String jarFile = path.substring(idx + MM_JAR_PROTOCOL.length() + 1);
-                modules.add(jarFile);
-            }                                        
-        }
-        return modules;
-    }
-    
-    private void stringifyProperties(Properties props, StringBuffer buf) {
-        // Properties.list() does not list the complete value of a property,
-        // so we iterate through the property names and add them to the result.
-        
-        // Sort the names in a natural ordering
-        SortedSet sortedNames = new TreeSet(props.keySet());
-        String propertyName = null;
-        for(Iterator i = sortedNames.iterator(); i.hasNext();) {
-            propertyName = (String)i.next();
-            buf.append(propertyName)
-               .append("=") //$NON-NLS-1$
-               .append(props.getProperty(propertyName))
-               .append(StringUtilities.LINE_SEPARATOR);
-        }
-    }
-}

Deleted: trunk/connector-sdk/src/main/java/com/metamatrix/cdk/IConnectorHost.java
===================================================================
--- trunk/connector-sdk/src/main/java/com/metamatrix/cdk/IConnectorHost.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/main/java/com/metamatrix/cdk/IConnectorHost.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.cdk;
-
-import java.io.Serializable;
-import java.util.List;
-import java.util.Properties;
-
-import org.teiid.connector.api.ConnectorException;
-import org.teiid.connector.language.ICommand;
-
-
-/**
- */
-public interface IConnectorHost {
-
-    public Properties getConnectorEnvironmentProperties();
-
-    public void setSecurityContext(String vdbName, String vdbVersion, String userName, Serializable trustedPayload);
-
-    public void setSecurityContext(String vdbName, String vdbVersion, String userName,
-                                   Serializable trustedPayload, Serializable executionPayload);
-
-    public List executeCommand(String query) throws ConnectorException;
-    
-    ICommand getCommand(String query) throws ConnectorException;
-    List executeCommand(ICommand command) throws ConnectorException;
-    
-    int[] executeBatchedUpdates(String[] updates) throws ConnectorException;
-}

Deleted: trunk/connector-sdk/src/main/java/com/metamatrix/cdk/QueryCommandTarget.java
===================================================================
--- trunk/connector-sdk/src/main/java/com/metamatrix/cdk/QueryCommandTarget.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/main/java/com/metamatrix/cdk/QueryCommandTarget.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -1,111 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.cdk;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.core.commandshell.ScriptCommandTarget;
-
-/**
- * Base CommandTarget class for processing SQL queries via the command line.
- */
-abstract public class QueryCommandTarget extends ScriptCommandTarget {
-
-	abstract protected String execute(String query);
-    protected boolean usePreparedStatement = false;
-    protected boolean prepareStmt = false;
-    protected Map preparedStmts = new HashMap();
-    protected String currentPreparedStmtName = null;
-    
-    protected String readSql(String commandName, String[] args) {
-        StringBuffer query = new StringBuffer();
-        StringBuffer firstLine = new StringBuffer();
-        firstLine.append(commandName);
-        firstLine.append(" "); //$NON-NLS-1$
-
-        for (int i = 0; i < args.length; i++) {
-            firstLine.append(args[i]);
-            firstLine.append(" "); //$NON-NLS-1$
-        }
-
-        String line = firstLine.toString();
-
-        boolean cont = true;
-        while (cont) {
-            try {
-                if (line != null && line.trim().endsWith(";")) { //$NON-NLS-1$
-                    cont = false;
-                    line = line.trim();
-                    line = line.substring(0, line.length() - 1);
-                }
-                query.append(" "); //$NON-NLS-1$
-                query.append(line);
-                if (cont) {
-                    line = shell.getNextCommandLine();
-                }
-            } catch (IOException e) {
-                throw new MetaMatrixRuntimeException(e);
-            }
-        }
-        return query.toString();            
-    }
-    
-    public void setUsePreparedStatement(boolean usePreparedStatement) {
-        this.usePreparedStatement = usePreparedStatement;
-    }
-    
-    protected String executeSql(String commandName, String[] args) {
-        if (!this.usePreparedStatement) {
-            prepareStmt = false;
-        }
-        
-        if (prepareStmt) {
-            preparedStmts.put(currentPreparedStmtName, readSql(commandName, args));
-            return ""; //$NON-NLS-1$
-        }
-        return execute(readSql(commandName, args));
-    }
-    
-	public String select(String[] args) { 
-		return executeSql("select", args); //$NON-NLS-1$
-	}
-
-	public String insert(String[] args) {
-		return executeSql("insert", args); //$NON-NLS-1$
-	}
-
-	public String update(String[] args) {
-		return executeSql("update", args); //$NON-NLS-1$
-	}
-
-	public String delete(String[] args) {
-		return executeSql("delete", args); //$NON-NLS-1$
-	}
-    
-    public String exec(String[] args) {
-        return executeSql("exec", args); //$NON-NLS-1$
-    }    
-}

Modified: trunk/connector-sdk/src/main/java/com/metamatrix/cdk/api/ConnectorHost.java
===================================================================
--- trunk/connector-sdk/src/main/java/com/metamatrix/cdk/api/ConnectorHost.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/main/java/com/metamatrix/cdk/api/ConnectorHost.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -22,11 +22,9 @@
 
 package com.metamatrix.cdk.api;
 
-import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import java.util.Properties;
 
 import org.teiid.connector.api.Connection;
 import org.teiid.connector.api.Connector;
@@ -37,111 +35,46 @@
 import org.teiid.connector.api.ExecutionContext;
 import org.teiid.connector.api.ResultSetExecution;
 import org.teiid.connector.api.UpdateExecution;
-import org.teiid.connector.language.ICommand;
+import org.teiid.connector.language.BatchedUpdates;
+import org.teiid.connector.language.Command;
 import org.teiid.connector.metadata.runtime.RuntimeMetadata;
-import org.teiid.dqp.internal.datamgr.impl.ConnectorEnvironmentImpl;
-import org.teiid.dqp.internal.datamgr.impl.ExecutionContextImpl;
-import org.teiid.dqp.internal.datamgr.language.BatchedUpdatesImpl;
 import org.teiid.metadata.index.VDBMetadataFactory;
 
-import com.metamatrix.cdk.IConnectorHost;
-import com.metamatrix.common.application.ApplicationEnvironment;
-import com.metamatrix.common.application.ApplicationService;
-import com.metamatrix.common.util.PropertiesUtils;
-
 /**
  * A simple test environment to execute commands on a connector.
  * Provides an alternative to deploying the connector in the full DQP environment.
  * Can be used for testing a connector.
  */
-public class ConnectorHost implements IConnectorHost {
+public class ConnectorHost {
 
     private Connector connector;
     private TranslationUtility util;
-    private ConnectorEnvironment connectorEnvironment;
-    private ApplicationEnvironment applicationEnvironment;
     private ExecutionContext executionContext;
-    private Properties connectorEnvironmentProperties;
-
-    private boolean connectorStarted = false;
     
-    /**
-     * Create a new environment to test a connector.
-     * @param connector a newly constructed connector to host in the new environment
-     * @param connectorEnvironmentProperties the properties to expose to the connector as part of the connector environment
-     * @param vdbFileName the path to the VDB file to load and use as the source of metadata for the queries sent to this connector
-     */
-    public ConnectorHost(Connector connector, Properties connectorEnvironmentProperties, String vdbFileName) {
-        this(connector, connectorEnvironmentProperties, vdbFileName, true);
+    public ConnectorHost(Connector connector, ConnectorEnvironment connectorEnvironment, String vdbFileName) throws ConnectorException {  
+        initialize(connector, connectorEnvironment, new TranslationUtility(VDBMetadataFactory.getVDBMetadata(vdbFileName)));
     }
     
-    public ConnectorHost(Connector connector, Properties connectorEnvironmentProperties, String vdbFileName, boolean showLog) {  
-        initialize(connector, connectorEnvironmentProperties, new TranslationUtility(VDBMetadataFactory.getVDBMetadata(vdbFileName)), showLog);
+    public ConnectorHost(Connector connector, ConnectorEnvironment connectorEnvironment, TranslationUtility util) throws ConnectorException{
+        initialize(connector, connectorEnvironment, util);
     }
     
-    public ConnectorHost(Connector connector, Properties connectorEnvironmentProperties, TranslationUtility util) {
-        initialize(connector, connectorEnvironmentProperties, util, true);
-    }
-
-    public ConnectorHost(Connector connector, Properties connectorEnvironmentProperties, TranslationUtility util, boolean showLog) {
-        initialize(connector, connectorEnvironmentProperties, util, showLog);
-    }
-    
-    private void initialize(Connector connector, Properties connectorEnvironmentProperties, TranslationUtility util, boolean showLog) {
-
+    private void initialize(Connector connector, final ConnectorEnvironment env, TranslationUtility util) throws ConnectorException {
         this.connector = connector;
         this.util = util;
-
-        applicationEnvironment = new ApplicationEnvironment();
-        connectorEnvironment = new ConnectorEnvironmentImpl(connectorEnvironmentProperties, new SysLogger(showLog), applicationEnvironment);
-        this.connectorEnvironmentProperties = PropertiesUtils.clone(connectorEnvironmentProperties);
+        this.connector.initialize(env);
     }
 
-    public void startConnectorIfNeeded() throws ConnectorException {
-        if (!connectorStarted) {
-            startConnector();
-        }
-    }
-
-    private void startConnector() throws ConnectorException {
-        connector.start(connectorEnvironment);
-        connectorStarted = true;
-    }
-
-    public Properties getConnectorEnvironmentProperties() {
-        return PropertiesUtils.clone(connectorEnvironmentProperties);
-    }
-
-    public void addResourceToConnectorEnvironment(String resourceName, Object resource) {
-        applicationEnvironment.bindService(resourceName, (ApplicationService) resource);
-    }
-
-    /** 
-     * @see com.metamatrix.cdk.IConnectorHost#setSecurityContext(java.lang.String, java.lang.String, java.lang.String, java.io.Serializable)
-     * @since 4.2
-     */
-    public void setSecurityContext(String vdbName,
-                                   String vdbVersion,
-                                   String userName,
-                                   Serializable trustedPayload) {
-        setSecurityContext(vdbName, vdbVersion, userName, trustedPayload, null);
-    }
-    
-    public void setSecurityContext(String vdbName, String vdbVersion, String userName, Serializable trustedPayload, Serializable executionPayload) {          
-        this.executionContext = new ExecutionContextImpl(vdbName, vdbVersion, userName, trustedPayload, executionPayload, "Connection", "Connector<CDK>", "Request", "1", "0"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$  
-    }
-    
     public void setExecutionContext(ExecutionContext context) {
     	this.executionContext = context;
     }
     
     public List executeCommand(String query) throws ConnectorException {
-        startConnectorIfNeeded();
 
         Connection connection = null;
         try {
             connection = getConnection();
-            ICommand command = getCommand(query);
+            Command command = getCommand(query);
             RuntimeMetadata runtimeMetadata = getRuntimeMetadata();
 
             return executeCommand(connection, command, runtimeMetadata);
@@ -152,8 +85,7 @@
         }
     }
     
-    public List executeCommand(ICommand command) throws ConnectorException {
-        startConnectorIfNeeded();
+    public List executeCommand(Command command) throws ConnectorException {
 
         Connection connection = null;
         try {
@@ -168,12 +100,10 @@
         }
     }
 
-    private List executeCommand(Connection connection, ICommand command, RuntimeMetadata runtimeMetadata)
+    private List executeCommand(Connection connection, Command command, RuntimeMetadata runtimeMetadata)
         throws ConnectorException {
 
-        ExecutionContext execContext = EnvironmentUtility.createExecutionContext("100", "1"); //$NON-NLS-1$ //$NON-NLS-2$
-        
-        Execution exec = connection.createExecution(command, execContext, runtimeMetadata);
+        Execution exec = connection.createExecution(command, this.executionContext, runtimeMetadata);
         exec.execute();
         List results = readResultsFromExecution(exec);
         exec.close();                
@@ -182,13 +112,12 @@
     }
 
     public int[] executeBatchedUpdates(String[] updates) throws ConnectorException {
-        startConnectorIfNeeded();
 
         Connection connection = null;
         try {
             connection = getConnection();
             RuntimeMetadata runtimeMetadata = getRuntimeMetadata();
-            ICommand[] commands = new ICommand[updates.length];
+            Command[] commands = new Command[updates.length];
             for (int i = 0; i < updates.length; i++) {
                 commands[i] = getCommand(updates[i]);
             }
@@ -201,8 +130,8 @@
         }
     }
     
-    public int[] executeBatchedUpdates(Connection connection, ICommand[] commands, RuntimeMetadata runtimeMetadata) throws ConnectorException {
-    	List<List> result = executeCommand(connection, new BatchedUpdatesImpl(Arrays.asList(commands)), runtimeMetadata);
+    public int[] executeBatchedUpdates(Connection connection, Command[] commands, RuntimeMetadata runtimeMetadata) throws ConnectorException {
+    	List<List> result = executeCommand(connection, new BatchedUpdates(Arrays.asList(commands)), runtimeMetadata);
     	int[] counts = new int[result.size()];
     	for (int i = 0; i < counts.length; i++) {
     		counts[i] = ((Integer)result.get(i).get(0)).intValue();
@@ -243,12 +172,13 @@
         return util.createRuntimeMetadata();
     }
 
-    public ICommand getCommand(String query) {
+    public Command getCommand(String query) {
     	return util.parseCommand(query);
     }
 
     private Connection getConnection() throws ConnectorException {
-        Connection connection = connector.getConnection(executionContext);
+        Connection connection = connector.getConnection();
         return connection;
     }
+    
 }

Deleted: trunk/connector-sdk/src/main/java/com/metamatrix/cdk/api/EnvironmentUtility.java
===================================================================
--- trunk/connector-sdk/src/main/java/com/metamatrix/cdk/api/EnvironmentUtility.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/main/java/com/metamatrix/cdk/api/EnvironmentUtility.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -1,148 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.cdk.api;
-
-import java.io.Serializable;
-import java.util.Properties;
-
-import org.teiid.connector.api.ConnectorEnvironment;
-import org.teiid.connector.api.ConnectorLogger;
-import org.teiid.connector.api.ConnectorPropertyNames;
-import org.teiid.connector.api.ExecutionContext;
-import org.teiid.dqp.internal.datamgr.impl.ConnectorEnvironmentImpl;
-import org.teiid.dqp.internal.datamgr.impl.ExecutionContextImpl;
-
-
-/**
- * A utility factory class to create connector environment objects that are normally supplied
- * by the MetaMatrix Server.  This utility will create objects that can be used for testing 
- * of your connector outside the context of the MetaMatrix Server.
- */
-public class EnvironmentUtility {
-
-    /**
-     * Can't construct - this is a utility class. 
-     */
-    private EnvironmentUtility() {
-    }
-    
-    /**
-     * Create a ConnectorLogger that prints to STDOUT at the specified log level (and above).  
-     * @param logLevel The logLevel as defined in {@link SysLogger}.
-     * @return A logger
-     */
-    public static ConnectorLogger createStdoutLogger(int logLevel) {
-        SysLogger logger = new SysLogger();
-        logger.setLevel(logLevel);
-        return logger;         
-    }
-
-    /**
-     * Create a ConnectorEnvironment with the specified properties and logger.  
-     * @param props The properties to put in the environment
-     * @param logger The logger to use
-     * @return A ConnectorEnvironment instance
-     */
-    public static ConnectorEnvironment createEnvironment(Properties props, ConnectorLogger logger) {
-        if(props.getProperty(ConnectorPropertyNames.CONNECTOR_BINDING_NAME) == null) {
-            props.setProperty(ConnectorPropertyNames.CONNECTOR_BINDING_NAME, "test"); //$NON-NLS-1$
-        }
-        return new ConnectorEnvironmentImpl(props, logger, null);
-    } 
-    
-    /**
-     * Create a ConnectorEnvironment with the specified properties.  A default logger will be 
-     * created that prints logging to STDOUT for INFO level and above. 
-     * @param props The properties to put in the environment
-     * @return A ConnectorEnvironment instance
-     */
-    public static ConnectorEnvironment createEnvironment(Properties props) {
-        return createEnvironment(props, true);
-    }
-    
-    /**
-     * Create a ConnectorEnvironment with the specified properties.  A default logger will be 
-     * created that prints logging to STDOUT for INFO level and above if stdoutLog is true. 
-     * @param props The properties to put in the environment
-     * @param stdoutLog
-     * @return A ConnectorEnvironment instance
-     */
-    public static ConnectorEnvironment createEnvironment(Properties props, boolean stdoutLog) {
-        return EnvironmentUtility.createEnvironment(props, stdoutLog?createStdoutLogger(SysLogger.INFO):new SysLogger(false));
-    }
-    
-    /**
-     * Create an ExecutionContext and set just the user name. Dummy information will be
-     * created for the other parts of the context. 
-     * @param user User name
-     * @return A SecurityContext / ExecutionContext instance
-     */
-    public static ExecutionContext createSecurityContext(String user) {
-        return new ExecutionContextImpl("vdb", "1", user, null, null, "Connection", "ConnectorID<CDK>", "Request", "1", "0");  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
-    }
-
-    /**
-     * Create an ExecutionContext and set just the security parts. Dummy information will be
-     * created for the other parts of the context. 
-     * @param vdbName Virtual database name
-     * @param vdbVersion Virtual database version
-     * @param user User name
-     * @param trustedToken Trusted token (passed when creating JDBC Connection)
-     * @return A SecurityContext / ExecutionContext instance
-     */
-    public static ExecutionContext createSecurityContext(String vdbName, String vdbVersion, String user, Serializable trustedToken) {
-        return new ExecutionContextImpl(vdbName, vdbVersion, user, trustedToken, null, "Connection", "ConnectorID<CDK>", "Request", "1", "0");  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-    }
-    
-    /**
-     * Create an ExecutionContext and set just the requestID and partID.  Dummy information will be
-     * created for the other parts of the context. 
-     * @param requestID Unique identifier for the user command within the server
-     * @param partID Unique identifier for the source command within the context of a requestID
-     * @return A SecurityContext / ExecutionContext instance
-     */
-    public static ExecutionContext createExecutionContext(String requestID, String partID) {
-        return new ExecutionContextImpl("vdb", "1", "user", null, null, "Connection", "ConnectorID<CDK>", requestID, partID, "0");   //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
-    }
-
-    /**
-     * Create an ExecutionContext and set all of the parts. 
-     * @param vdbName Virtual database name
-     * @param vdbVersion Virtual database version
-     * @param user User name
-     * @param trustedToken Trusted token (passed when creating JDBC Connection)
-     * @param executionPayload Command payload (passed for each command executed on JDBC Statement)
-     * @param requestID Unique identifier for the user command within the server
-     * @param partID Unique identifier for the source command within the context of a requestID
-     * @param connectionID Unique identifier for the connection through which the command is executed
-     * @param useResultSetCache Whether to use ResultSet cache if it is enabled. 
-     * @return A SecurityContext / ExecutionContext instance
-     * @since 4.2
-     */
-    public static ExecutionContext createExecutionContext(String vdbName, String vdbVersion, String user,
-                                                        Serializable trustedToken, Serializable executionPayload,                                                         
-														String connectionID, String connectorID, String requestID, String partID, boolean useResultSetCache) {
-        return new ExecutionContextImpl(vdbName, vdbVersion, user, trustedToken, executionPayload, connectionID, connectorID, requestID, partID, "0"); //$NON-NLS-1$
-    }
-
-}

Modified: trunk/connector-sdk/src/main/java/com/metamatrix/cdk/api/TranslationUtility.java
===================================================================
--- trunk/connector-sdk/src/main/java/com/metamatrix/cdk/api/TranslationUtility.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/main/java/com/metamatrix/cdk/api/TranslationUtility.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -22,14 +22,22 @@
 
 package com.metamatrix.cdk.api;
 
+import java.io.IOException;
 import java.net.URL;
+import java.util.Collection;
 
-import org.teiid.connector.language.ICommand;
+import org.teiid.connector.language.Command;
 import org.teiid.connector.metadata.runtime.RuntimeMetadata;
 import org.teiid.dqp.internal.datamgr.metadata.RuntimeMetadataImpl;
 import org.teiid.metadata.index.VDBMetadataFactory;
 
 import com.metamatrix.cdk.CommandBuilder;
+import com.metamatrix.query.function.FunctionLibrary;
+import com.metamatrix.query.function.FunctionTree;
+import com.metamatrix.query.function.SystemFunctionManager;
+import com.metamatrix.query.function.UDFSource;
+import com.metamatrix.query.function.metadata.FunctionMethod;
+import com.metamatrix.query.metadata.BasicQueryMetadataWrapper;
 import com.metamatrix.query.metadata.QueryMetadataInterface;
 
 /**
@@ -55,14 +63,18 @@
     }
     
     public TranslationUtility(URL url) {
-		metadata = VDBMetadataFactory.getVDBMetadata(url);
+        try {
+			metadata = VDBMetadataFactory.getVDBMetadata(url, null);
+		} catch (IOException e) {
+			throw new RuntimeException(e);
+		}     
     }
     
     public TranslationUtility(QueryMetadataInterface metadata) {
     	this.metadata = metadata;
     }
     
-    public ICommand parseCommand(String sql, boolean generateAliases, boolean supportsGroupAliases) {
+    public Command parseCommand(String sql, boolean generateAliases, boolean supportsGroupAliases) {
         CommandBuilder commandBuilder = new CommandBuilder(metadata);
         return commandBuilder.getCommand(sql, generateAliases, supportsGroupAliases);
     }
@@ -72,7 +84,7 @@
      * @param sql
      * @return Command using the language interfaces
      */
-    public ICommand parseCommand(String sql) {
+    public Command parseCommand(String sql) {
         CommandBuilder commandBuilder = new CommandBuilder(metadata);
         return commandBuilder.getCommand(sql);
     }
@@ -86,4 +98,13 @@
     public RuntimeMetadata createRuntimeMetadata() {
         return new RuntimeMetadataImpl(metadata);
     }
+
+	public void setUDF(final Collection<FunctionMethod> methods) {
+		this.metadata = new BasicQueryMetadataWrapper(this.metadata) {
+			@Override
+			public FunctionLibrary getFunctionLibrary() {
+				return new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(methods)));
+			}
+		};
+	}
 }

Modified: trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/Command.java
===================================================================
--- trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/Command.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/Command.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -27,7 +27,9 @@
 import java.lang.reflect.Array;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.text.DateFormat;
 import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.Collections;
 import java.util.Date;
 import java.util.Iterator;
@@ -39,7 +41,6 @@
 import com.metamatrix.core.id.IDGenerator;
 import com.metamatrix.core.id.InvalidIDException;
 import com.metamatrix.core.id.ObjectID;
-import com.metamatrix.core.util.DateUtil;
 import com.metamatrix.core.util.FileUtil;
 import com.metamatrix.core.util.StringUtil;
 
@@ -246,7 +247,7 @@
         }
         if (neededType.equals(Date.class)) {
             try {
-                return DateUtil.convertStringToDate(target);
+                return DateFormat.getDateTimeInstance().parse(target);
             } catch (ParseException e) {
                 throw new ArgumentConversionException(e, e.getMessage());
             }

Deleted: trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/ConnectorResultUtility.java
===================================================================
--- trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/ConnectorResultUtility.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/ConnectorResultUtility.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -1,206 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.core.commandshell;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.Iterator;
-import java.util.List;
-
-import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.core.util.StringUtil;
-
-/**
- * Provides utility methods for manipulating the results of executing commands against a connector.
- */
-public class ConnectorResultUtility {
-    private static final String ERROR_MESSAGE_PREFIX = "CompareResults Error: "; //$NON-NLS-1$
-    private static final String NULL_STRING = "<null>"; //$NON-NLS-1$
-    private static final String COLUMN_SEPARATOR = "\t"; //$NON-NLS-1$
-    private static final String NOROWS_STRING = "No rows returned."; //$NON-NLS-1$
-
-    /**
-     * Converts a List of Lists, where each sub-list is a row of data, into a tab delimited String where each line is
-     * a row of data.  Each object is converted to a String.
-     * @param results a List of Lists of data typcially obtained by executing a command on a connector through the ConnectorHost
-     * @return the results converted to a tab delimited String
-     */
-    public static String resultsToString(List results, String[] columnNames) {
-        if (results == null || results.isEmpty()) {
-            return NOROWS_STRING;
-        }
-        StringBuffer result = new StringBuffer();
-        int columnIndex = 0;
-        for (Iterator iterator = results.iterator(); iterator.hasNext();) {
-
-            List row = (List) iterator.next();
-            boolean firstColumn = true;
-            columnIndex = 0;
-            for (Iterator j = row.iterator(); j.hasNext(); columnIndex++) {
-                Object next = j.next();
-                String value = null;
-                if (next == null) {
-                    value = NULL_STRING;
-                } else {
-                    value = next.toString();
-                    value = StringUtil.replaceAll(value, "\t", "\\t"); //$NON-NLS-1$ //$NON-NLS-2$
-                    value = StringUtil.replaceAll(value, "\n", "\\n"); //$NON-NLS-1$ //$NON-NLS-2$
-                }
-                if (firstColumn) {
-                    firstColumn = false;
-                } else {
-                    result.append(COLUMN_SEPARATOR);
-                }
-                result.append(value);
-            }
-            result.append(StringUtil.LINE_SEPARATOR);
-        }
-
-        if (columnNames == null || columnNames.length == 0) {
-            columnNames = new String[columnIndex];
-            for (int i = 0; i < columnIndex; i++) {
-                columnNames[i] = "col" + (i+1); //$NON-NLS-1$
-            }
-        }
-        StringBuffer header = new StringBuffer();
-        boolean firstValue = true;
-        for (int i=0; i < columnNames.length; i++) {
-            String label = null;
-            if (columnNames[i] == null) {
-                label = NULL_STRING;
-            } else {
-                label = columnNames[i];
-                
-                int delimiterIndex = columnNames[i].lastIndexOf('.');
-                if (delimiterIndex != -1) {
-                    label = columnNames[i].substring(delimiterIndex + 1);
-                }
-            }
-            if (firstValue) {
-                firstValue = false;
-            } else {
-                header.append(COLUMN_SEPARATOR);
-            }
-            header.append(label);
-        }
-        header.append(StringUtil.LINE_SEPARATOR);
-        return header.toString() + result.toString();
-    }
-    
-    public static String resultsToString(List results) {
-        return resultsToString(results, null);
-    }
-
-    private static int getRowCount(String text) throws IOException {
-        BufferedReader reader = new BufferedReader(new StringReader(text));
-        int rowCount = 0;
-        String line = reader.readLine();
-        while (line != null) {
-            rowCount++;
-            line = reader.readLine();
-        }
-        return rowCount;
-    }
-
-    /**
-     * Compares two sets of results to determine if they are identical.
-     * The results are in the string form provided by the resultsToString method.
-     * @param expected String form of the expected results
-     * @param actual String form of the actual results
-     * @return null if the String are identical or a description of the first difference if they are different
-     */
-    public static String compareResultsStrings(String expected, String actual) {
-        if (expected.equals(actual)) {
-            return null;
-        }
-        try {
-            BufferedReader expectedReader = new BufferedReader(new StringReader(expected));
-            BufferedReader actualReader = new BufferedReader(new StringReader(actual));
-
-            int expectedRowCount = getRowCount(expected);
-            int actualRowCount = getRowCount(actual);
-
-            if (expectedRowCount > actualRowCount) {
-                return (ERROR_MESSAGE_PREFIX + "Expected " + expectedRowCount + //$NON-NLS-1$
-                " records but received only " + actualRowCount); //$NON-NLS-1$
-            } else if (actualRowCount > expectedRowCount) {
-                // Check also for less records than expected
-                return (ERROR_MESSAGE_PREFIX + "Expected " + expectedRowCount + //$NON-NLS-1$
-                " records but received " + actualRowCount); //$NON-NLS-1$
-            }
-
-            String expectedLine = expectedReader.readLine();
-            int rowIndex = 0;
-            while (expectedLine != null) {
-                String actualLine = actualReader.readLine();
-
-                List actualRow = StringUtil.split(actualLine, COLUMN_SEPARATOR);
-                List expectedRow = StringUtil.split(expectedLine, COLUMN_SEPARATOR);
-                int actualColumnCount = actualRow.size();
-                int expectedColumnCount = expectedRow.size();
-
-                //TODO: i18n the messages
-                
-                // Get actual value
-                if (actualColumnCount != expectedColumnCount) {
-                    return("Incorrect number of columns at row = " + rowIndex + ", expected = " + expectedColumnCount + ", actual = " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-                                                    + actualColumnCount);
-                }
-
-                // Compare sorted actual record with sorted expected record column by column
-                for (int columnIndex = 0; columnIndex < expectedColumnCount; columnIndex++) {
-                    // Get expected value
-                    Object expectedValue = expectedRow.get(columnIndex);
-                    Object actualValue = actualRow.get(columnIndex);
-
-                    // Compare these values
-                    if (expectedValue == null) {
-                        if (actualValue != null) {
-                            return getMismatchMessage(rowIndex, columnIndex, expectedValue, actualValue);
-                        }
-                    } else {
-                        if (!expectedValue.equals(actualValue)) {
-                            return getMismatchMessage(rowIndex, columnIndex, expectedValue, actualValue);
-                        }
-                    }
-                } // end loop through columns
-                expectedLine = expectedReader.readLine();
-
-                rowIndex++;
-            } // end loop through rows    }
-        } catch (IOException e) {
-            //this should not happen because the code is simply reading from Strings in memory
-            throw new MetaMatrixRuntimeException(e);
-        }
-        return null;
-    }
-
-    private static String getMismatchMessage(int rowIndex, int columnIndex, Object expectedValue, Object actualValue) {
-        return (ERROR_MESSAGE_PREFIX + "Value mismatch at row " + rowIndex //$NON-NLS-1$
-        + " and column " + columnIndex //$NON-NLS-1$
-        + ": expected = " //$NON-NLS-1$
-        + expectedValue + ", actual = " //$NON-NLS-1$
-        + actualValue);
-    }
-}

Deleted: trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/ScriptCommandTarget.java
===================================================================
--- trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/ScriptCommandTarget.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/ScriptCommandTarget.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -1,162 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.core.commandshell;
-
-import java.util.Arrays;
-import java.util.List;
-
-import com.metamatrix.core.CorePlugin;
-import com.metamatrix.core.util.StringUtil;
-
-/**
- * Base command target class with scripting support.
- */
-public class ScriptCommandTarget extends CommandTarget implements StringUtil.Constants {
-    protected static final String TEST_PREFIX = "test"; //$NON-NLS-1$
-
-    protected int testFailureCount = 0;
-
-    protected int testCount = 0;
-
-    private ScriptFileNameStack scriptFileNames = new ScriptFileNameStack();
-    
-    private boolean runningSetUp = false;
-    
-    public void setScriptFile(String scriptFileName) {
-        scriptFileNames.setDefaultScriptFileName(scriptFileName);
-    }
-
-    protected static final String SETUP_SCRIPT = "setUp"; //$NON-NLS-1$
-
-    protected boolean hasSetupScript(String fileName) {
-        String[] scriptNames = shell.getScriptNames(fileName);
-        List scriptNameList = Arrays.asList(scriptNames);
-        return scriptNameList.contains(SETUP_SCRIPT);
-    }
-
-    protected StringBuffer testFailureMessage;
-
-    protected void runningScript(String fileName) {
-        scriptFileNames.usingScriptFile(fileName);
-    }
-        
-    public String run(String scriptName) {
-        if (scriptFileNames.hasDefaultScriptFileBeenSet()) {
-            return runScriptDirect(scriptFileNames.getUnexpandedCurrentScriptFileName(), scriptName);
-        }
-        throw new NoScriptFileException();
-    }
-
-    public String runScript(String fileName, String scriptName) {
-        return runScriptDirect( fileName, scriptName );
-    }
-
-    private String runScriptDirect(String originalFileName, String scriptName) {
-        String fileName = scriptFileNames.expandScriptFileName(originalFileName);
-        testFailureMessage = new StringBuffer();
-        if (!runningSetUp) {
-            if (hasSetupScript(fileName)) {
-                try {
-                    runningSetUp = true;
-                    runScript(fileName, SETUP_SCRIPT, null, null); 
-                } finally {
-                    runningSetUp = false;
-                }
-            }
-        }
-        runScript(fileName, scriptName, null, getScriptResultListener());
-        return testFailureMessage.toString();
-    }
-
-    void runScript(String fileName, String scriptName, StringBuffer transcript, ScriptResultListener listener) {
-        scriptFileNames.startingScriptFromFile(fileName);
-        try {
-            shell.runScript(fileName, scriptName, transcript, listener);
-        } finally {
-            scriptFileNames.finishedScript();
-        }
-    }
-
-    private ScriptResultListener getScriptResultListener() {
-        return new ScriptResultListener() {
-            public void scriptResults(String scriptFileName, String scriptName, String expected, String actual) {
-                ScriptCommandTarget.this.scriptResults(scriptFileName, scriptName, expected, actual);
-            }
-        };
-    }
-
-    private void scriptResults(String scriptFileName, String scriptName, String expected, String actual) {
-        if(expected.equals(actual)) {
-        } else {
-            testFailureCount++;
-            String diffString = ConnectorResultUtility.compareResultsStrings(expected, actual);
-            testFailureMessage.append(CorePlugin.Util.getString("ScriptCommandTarget.Test_{0}.{1}_failed.{2}_2", new Object[] {scriptFileName, scriptName, diffString}) ); //$NON-NLS-1$
-            testFailureMessage.append(NEW_LINE);
-        }
-    }
-
-    protected void resetTestStatistics() {
-        testCount = 0;
-        testFailureCount = 0;
-        testFailureMessage = new StringBuffer();
-    }
-
-    public String runAll() {
-        resetTestStatistics();
-        String fileName = scriptFileNames.expandScriptFileName(scriptFileNames.getUnexpandedCurrentScriptFileName());
-        String[] scriptNames = shell.getScriptNames( fileName );
-        boolean runSetup = hasSetupScript( fileName );
-        for (int i=0; i<scriptNames.length; i++) {
-            if (scriptNames[i].startsWith(TEST_PREFIX)){
-                testCount++;
-                if (runSetup) {
-                    runScript(fileName, SETUP_SCRIPT, null, null); 
-                    runSetup = false;
-                }
-                runScript(fileName, scriptNames[i], null, getScriptResultListener());
-            }
-        }   
-        return getTestSummary();
-    }
-
-    protected String getTestSummary() {
-        return testFailureMessage.toString() + CorePlugin.Util.getString("ScriptCommandTarget.Tests_run__{0}_test_failures__{1}_1", new Object[] {new Integer(testCount), new Integer(testFailureCount)}); //$NON-NLS-1$
-    }
-
-    public void runRep(int repCount, String scriptName) {
-        for (int i=0; i<repCount; i++) {
-            run(scriptName);
-        }
-    }
-
-    public void setSilent(boolean silent) {
-        shell.setSilent(silent);
-    }
-    
-    protected Object clone() throws CloneNotSupportedException {
-        ScriptCommandTarget result = (ScriptCommandTarget) super.clone();
-        result.scriptFileNames = (ScriptFileNameStack) scriptFileNames.clone();
-        return result;
-    } 
-        
-}

Deleted: trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/ScriptFileNameStack.java
===================================================================
--- trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/ScriptFileNameStack.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/ScriptFileNameStack.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -1,143 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.core.commandshell;
-
-import java.io.File;
-import java.util.Stack;
-
-/**
- * Keeps track of script file names and script directories as scripts are run.
- * Knows how to interpret relative file names in the context of other file names.
- */
-class ScriptFileNameStack implements Cloneable {
-    private String defaultScriptFileName;
-
-    private Stack executingScriptFileName = new Stack();
-
-    /**
-     * @param scriptFileName The default script file name to use when none is specified and when no scripts are executing.
-     */
-    public void setDefaultScriptFileName(String scriptFileName) {
-        log("setDefaultScriptFileName", scriptFileName); //$NON-NLS-1$
-        defaultScriptFileName = scriptFileName;
-    }
-    
-
-    /**
-     * Record that a script file name is being used.  This will become the default if no default has been set.
-     * @param scriptFileName
-     */
-    public void usingScriptFile(String scriptFileName) {
-        log("usingScriptFile", scriptFileName); //$NON-NLS-1$
-        if (!hasDefaultScriptFileBeenSet()) {
-            setDefaultScriptFileName(scriptFileName);
-        }
-    }
-    
-    private void log(String method, String value) {
-        //System.out.println("ScriptFileNames." + method + ": " + value);
-    }
-
-    /**
-     * Expands relative file names to include path information from currently running file names.
-     * @param scriptFileName
-     * @return
-     */
-    public String expandScriptFileName(String scriptFileName) {
-        log("expandScriptFileName", scriptFileName); //$NON-NLS-1$
-        String result = scriptFileName;
-        String parent = getParent();
-        if (isAbsolute(scriptFileName) || parent == null) {
-        } else {
-            result = parent + File.separator + scriptFileName;
-        }
-        log("expandScriptFileName", "result=" + result); //$NON-NLS-1$ //$NON-NLS-2$
-        return result;
-    }
-   
-    private String getParent() {
-        String parent = null;
-        if (!executingScriptFileName.isEmpty()) {
-            parent = new File(peek()).getParent();
-        }
-        return parent;
-    }
-   
-
-    public boolean hasDefaultScriptFileBeenSet() {
-        return defaultScriptFileName != null;
-    }
-
-    private String peek() {
-        return (String) executingScriptFileName.peek();
-    }
-    
-    private boolean isAbsolute(String fileName) {
-        File file = new File(fileName);
-        return file.isAbsolute() || fileName.startsWith("\\") || fileName.startsWith("/"); //$NON-NLS-1$ //$NON-NLS-2$
-    }
-
-    /**
-     * Retrieves the default script file name.
-     * If a script is currently executing this will return the name of the current executing script file rather than the default.
-     * @return
-     */
-    public String getUnexpandedCurrentScriptFileName() {
-        String result = getCurrentScriptFileNameDirect();
-        log("getCurrentScriptFileName", result); //$NON-NLS-1$
-        return result;
-    }
-
-    private String getCurrentScriptFileNameDirect() {
-        if (executingScriptFileName.isEmpty()) {
-            return defaultScriptFileName;
-        }
-        return new File(peek()).getName();
-    }
-
-    /**
-     * Indicate that a script is about to be executed from the given file.
-     * This must be called in order to maintain the stack tracking the current script file.
-     * @param fileName
-     */
-    public void startingScriptFromFile(String fileName) {
-        log("startingScriptFromFile", fileName); //$NON-NLS-1$
-        executingScriptFileName.push(fileName);
-    }
-    
-    /**
-     * Indicate that a script has completed execution.
-     * This must be called in order to maintain the stack tracking the current script file.
-     */
-    public void finishedScript() {
-        log("finishedScript", ""); //$NON-NLS-1$ //$NON-NLS-2$
-        executingScriptFileName.pop();
-    }
-    
-    protected Object clone() throws CloneNotSupportedException {
-        ScriptFileNameStack result = (ScriptFileNameStack) super.clone();
-        executingScriptFileName = (Stack) executingScriptFileName.clone();        
-        return result;
-    } 
-
-}

Modified: trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/ScriptReader.java
===================================================================
--- trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/ScriptReader.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/ScriptReader.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -28,7 +28,6 @@
 import com.metamatrix.core.CorePlugin;
 import com.metamatrix.core.MetaMatrixRuntimeException;
 import com.metamatrix.core.util.StringUtil;
-import com.metamatrix.core.util.StringUtilities;
 
 /**
  * Understands how to read specific command line scripts from a String containing multiple scripts.
@@ -61,7 +60,7 @@
         testScriptIndex = 0;
         this.testName = scriptName;
         testScript = getScriptContents();
-        testLines = StringUtilities.getLines(testScript);
+        testLines = StringUtil.getLines(testScript);
     }
 
     /**
@@ -140,7 +139,7 @@
 
     private String getScriptContents() {
         boolean readyForNewScript = true;
-        String[] scriptLines = StringUtilities.getLines(script);
+        String[] scriptLines = StringUtil.getLines(script);
         for (int i=0; i<scriptLines.length; i++) {
             if (readyForNewScript) {
                 boolean openingBraceFound = false;
@@ -195,7 +194,7 @@
         List subStrings = StringUtil.split(script, "{"); //$NON-NLS-1$
         for (int i = 0; i < subStrings.size()-1; i++) {
             String fragment = ((String) subStrings.get(i)).trim();
-            String[] lines = StringUtilities.getLines(fragment);
+            String[] lines = StringUtil.getLines(fragment);
             String testName = lines[lines.length-1];
             if (!containsWhitespace(testName)) {
                 if (testName.length() > 0) {

Deleted: trunk/connector-sdk/src/main/resources/com/metamatrix/cdk/Template.cdk
===================================================================
--- trunk/connector-sdk/src/main/resources/com/metamatrix/cdk/Template.cdk	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/main/resources/com/metamatrix/cdk/Template.cdk	2010-03-05 15:12:25 UTC (rev 1917)
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ConfigurationDocument>
-    <Header>
-        <ApplicationCreatedBy>Connector Development Kit</ApplicationCreatedBy>
-        <ApplicationVersionCreatedBy>${pom.version}</ApplicationVersionCreatedBy>
-        <UserCreatedBy>MetaMatrixAdmin</UserCreatedBy>
-        <DocumentTypeVersion>1.0</DocumentTypeVersion>
-        <MetaMatrixSystemVersion>${pom.version}</MetaMatrixSystemVersion>
-        <Time>@build-date@</Time>
-    </Header>
-    <ComponentTypes>
-        <ComponentType Name="My Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="Connector" ParentComponentType="Connectors">
-	    <!-- Required by Connector API -->
-            <ComponentTypeDefn Deprecated="false">
-                <PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" DefaultValue="com.mycode.Connector" Multiplicity="1" IsHidden="false" IsMasked="false" IsModifiable="false" IsPreferred="false" />
-            </ComponentTypeDefn>
-            <ComponentTypeDefn Deprecated="false">
-                <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:mycode.jar" Multiplicity="1" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
-            </ComponentTypeDefn>
-
-	    <!-- Example properties - replace with custom properties -->
-            <ComponentTypeDefn Deprecated="false">
-                <PropertyDefinition Name="ExampleProperty" DisplayName="Example Property" ShortDescription="This property is displayed at the top due to IsPreferred=true" Multiplicity="1" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
-            </ComponentTypeDefn>
-            <ComponentTypeDefn Deprecated="false">
-                <PropertyDefinition Name="ExampleOptional" DisplayName="Example Optional Property" ShortDescription="This property is optional due to the Multiplicity=0..1" Multiplicity="0..1" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
-            </ComponentTypeDefn>
-            <ComponentTypeDefn Deprecated="false">
-                <PropertyDefinition Name="ExampleDefaultValue" DisplayName="Example Default Value Property" ShortDescription="This property has a default value" DefaultValue="Default value" Multiplicity="1" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
-            </ComponentTypeDefn>
-            <ComponentTypeDefn Deprecated="false">
-                <PropertyDefinition Name="ExampleEncrypted" DisplayName="Example Encrypted Property" ShortDescription="This property is encrypted in storage due to Masked=true" Multiplicity="1" IsHidden="false" IsMasked="true" IsModifiable="true" IsPreferred="false" />
-            </ComponentTypeDefn>
-
-            <ChangeHistory>
-                <Property Name="LastChangedBy">ConfigurationStartup</Property>
-                <Property Name="CreatedBy">ConfigurationStartup</Property>
-            </ChangeHistory>
-        </ComponentType>
-    </ComponentTypes>
-</ConfigurationDocument>
-

Modified: trunk/connector-sdk/src/test/java/com/metamatrix/cdk/unittest/FakeTranslationFactory.java
===================================================================
--- trunk/connector-sdk/src/test/java/com/metamatrix/cdk/unittest/FakeTranslationFactory.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/test/java/com/metamatrix/cdk/unittest/FakeTranslationFactory.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -24,7 +24,6 @@
 
 import com.metamatrix.cdk.api.TranslationUtility;
 import com.metamatrix.query.unittest.FakeMetadataFactory;
-import com.metamatrix.query.validator.TestValidator;
 
 public class FakeTranslationFactory {
 	
@@ -42,14 +41,6 @@
 		return new TranslationUtility(FakeMetadataFactory.exampleYahoo());
 	}
 	
-	public TranslationUtility getTextTranslationUtility() {
-		return new TranslationUtility(FakeMetadataFactory.exampleText());
-	}
-	
-	public TranslationUtility getAutoIncrementTranslationUtility() {
-		return new TranslationUtility(TestValidator.exampleMetadata3());
-	}
-	
 	public TranslationUtility getExampleTranslationUtility() {
 		return new TranslationUtility(FakeMetadataFactory.example1Cached());
 	}

Modified: trunk/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestCommand.java
===================================================================
--- trunk/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestCommand.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestCommand.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -22,26 +22,14 @@
 
 package com.metamatrix.core.commandshell;
 
-import java.util.TimeZone;
 import junit.framework.TestCase;
 
-import com.metamatrix.common.util.TimestampWithTimezone;
-import com.metamatrix.core.util.UnitTestUtil;
-
 public class TestCommand extends TestCase {
 
     public TestCommand(String name) {
         super(name);
     }
 
-	public void setUp() {
-		TimestampWithTimezone.resetCalendar(TimeZone.getTimeZone("GMT-06:00")); //$NON-NLS-1$
-	}
-
-	public void tearDown() {
-		TimestampWithTimezone.resetCalendar(null);
-	}
-
     public void test() throws Exception {
         FakeCommandTarget target = new FakeCommandTarget();
         String commandName = "getLatest"; //$NON-NLS-1$
@@ -60,15 +48,6 @@
         assertEquals("getLatest samplePath", target.getTrace()); //$NON-NLS-1$
     }
 
-    public void testArgConversion() throws Exception {
-        FakeCommandTarget target = new FakeCommandTarget();
-        String commandName = "checkin"; //$NON-NLS-1$
-        String[] args = new String[] { "samplePath", UnitTestUtil.getTestDataPath() + "/fakeFile", "2003-10-01:00:00:00" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        Command command = new Command(target, commandName, args);
-        command.execute();
-        assertEquals("checkin samplePath <data> Wed Oct 01 00:00:00 GMT-06:00 2003", target.getTrace()); //$NON-NLS-1$
-    }
-
     public void testArgConversionStringArray() throws Exception {
         FakeCommandTarget target = new FakeCommandTarget();
         String commandName = "method0"; //$NON-NLS-1$
@@ -95,14 +74,6 @@
         assertEquals("getLatest samplePath", target.getTrace()); //$NON-NLS-1$
     }
 
-    public void testCommandParsingDates() throws Exception {
-        FakeCommandTarget target = new FakeCommandTarget();
-        String commandLine = "checkin samplePath " + UnitTestUtil.getTestDataPath() + "/fakeFile \"2003-10-01:00:00:00\""; //$NON-NLS-1$ //$NON-NLS-2$
-        Command command = new Command(target, commandLine);
-        command.execute();
-        assertEquals("checkin samplePath <data> Wed Oct 01 00:00:00 GMT-06:00 2003", target.getTrace()); //$NON-NLS-1$
-    }
-
     public void testComment() throws Exception {
         FakeCommandTarget target = new FakeCommandTarget();
         String commandLine = "//command"; //$NON-NLS-1$

Deleted: trunk/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestScriptFileNameStack.java
===================================================================
--- trunk/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestScriptFileNameStack.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestScriptFileNameStack.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -1,184 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.core.commandshell;
-
-import java.io.File;
-import junit.framework.TestCase;
-
-public class TestScriptFileNameStack extends TestCase {
-    ScriptFileNameStack names = new ScriptFileNameStack();
-
-    public void testCurrentDefaultSetRelativeDirectory() {
-        names.setDefaultScriptFileName("a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        assertEquals("a" + File.separator + "b" + File.separator + "c", names.getUnexpandedCurrentScriptFileName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-    }
-
-    public void testCurrentDefaultSetAbsoluteDirectory() {
-        names.setDefaultScriptFileName(File.separator+"a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        assertEquals(File.separator + "a" + File.separator + "b" + File.separator + "c", names.getUnexpandedCurrentScriptFileName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-    }
-
-    ////
-
-    public void testCurrentDefaultWithExecutingScript() {
-        names.setDefaultScriptFileName("a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        names.startingScriptFromFile("d"); //$NON-NLS-1$
-        assertEquals("d", names.getUnexpandedCurrentScriptFileName()); //$NON-NLS-1$
-    }
-
-    public void testCurrentDefaultSetWithExecutingScript() {
-        names.setDefaultScriptFileName(File.separator+"a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        names.startingScriptFromFile("d"); //$NON-NLS-1$
-        assertEquals("d", names.getUnexpandedCurrentScriptFileName()); //$NON-NLS-1$
-    }
-
-    public void testCurrentDefaultWithExecutingRelativeScript() {
-        names.setDefaultScriptFileName("a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        names.startingScriptFromFile("d"+File.separator+"e"); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("e", names.getUnexpandedCurrentScriptFileName()); //$NON-NLS-1$
-    }
-
-    public void testCurrentDefaultSetWithExecutingAbsoluteScript() {
-        names.setDefaultScriptFileName(File.separator+"a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        names.startingScriptFromFile(File.separator+"d"+File.separator+"e"); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("e", names.getUnexpandedCurrentScriptFileName()); //$NON-NLS-1$
-    }
-
-    ////
-
-    public void testExpandWithExecutingScript() {
-        names.setDefaultScriptFileName("a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        names.startingScriptFromFile("d"); //$NON-NLS-1$
-        assertEquals("e", names.expandScriptFileName("e")); //$NON-NLS-1$ //$NON-NLS-2$
-    }
-
-    public void testExpandWithExecutingScript2() {
-        names.setDefaultScriptFileName(File.separator+"a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        names.startingScriptFromFile("d"); //$NON-NLS-1$
-        assertEquals("e", names.expandScriptFileName("e")); //$NON-NLS-1$ //$NON-NLS-2$
-    }
-
-    public void testExpandWithExecutingRelativeScript() {
-        names.setDefaultScriptFileName("a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        names.startingScriptFromFile("d"+File.separator+"e"); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("d" + File.separator + "f", names.expandScriptFileName("f")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-    }
-
-    public void testExpandWithExecutingAbsoluteScript() {
-        names.setDefaultScriptFileName(File.separator+"a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        names.startingScriptFromFile(File.separator+"d"+File.separator+"e"); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals(File.separator + "d" + File.separator + "f", names.expandScriptFileName("f")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-    }
-
-    public void testExpandWithExecutingBaseScript() {
-        names.setDefaultScriptFileName("a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        names.startingScriptFromFile("d"+File.separator+"e"); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("d" + File.separator + "f", names.expandScriptFileName("f")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-    }
-
-    public void testExpandWithExecutingScriptStack() {
-        names.setDefaultScriptFileName("a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        names.startingScriptFromFile("d"+File.separator+"e"); //$NON-NLS-1$ //$NON-NLS-2$
-        names.startingScriptFromFile("f"+File.separator+"g"); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("f" + File.separator + "h", names.expandScriptFileName("h")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-    }
-
-    public void testExpandWithExecutingScriptStackExpand() {
-        names.setDefaultScriptFileName("a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        names.startingScriptFromFile(names.expandScriptFileName("d"+File.separator+"e")); //$NON-NLS-1$ //$NON-NLS-2$
-        names.startingScriptFromFile(names.expandScriptFileName("f"+File.separator+"g")); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("d" + File.separator + "f" + File.separator + "h", names.expandScriptFileName("h")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-    }
-
-    public void testExpandWithExecutingScriptStackExpand2() {
-        names.setDefaultScriptFileName("a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        names.startingScriptFromFile(names.expandScriptFileName("a"+File.separator+"b"+File.separator+"c")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        names.startingScriptFromFile(names.expandScriptFileName("d"+File.separator+"e")); //$NON-NLS-1$ //$NON-NLS-2$
-        names.startingScriptFromFile(names.expandScriptFileName("f"+File.separator+"g")); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("a" + File.separator + "b" + File.separator + "d" + File.separator + "f" + File.separator + "h", names.expandScriptFileName("h")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
-    }
-
-    public void testExpandWithExecutingScriptStackRelative() {
-        names.setDefaultScriptFileName("a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        names.startingScriptFromFile("d"+File.separator+"e"); //$NON-NLS-1$ //$NON-NLS-2$
-        names.startingScriptFromFile("d"+File.separator+"f"+File.separator+"g"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        assertEquals("d" + File.separator + "f" + File.separator + "h", names.expandScriptFileName("h")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-    }
-
-    ////
-
-    public void testExpandFromRelativeDirectory() {
-        names.setDefaultScriptFileName("a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        assertEquals("d", names.expandScriptFileName("d")); //$NON-NLS-1$ //$NON-NLS-2$
-    }
-
-    public void testExpandFromAbsoluteDirectory() {
-        names.setDefaultScriptFileName(File.separator+"a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        assertEquals("d", names.expandScriptFileName("d")); //$NON-NLS-1$ //$NON-NLS-2$
-    }
-
-    public void testExpandWithoutReferencesingBaseDirectoryAbsolute() {
-        names.setDefaultScriptFileName(File.separator+"a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        assertEquals(File.separator + "d" + File.separator + "e", names.expandScriptFileName(File.separator + "d" + File.separator + "e")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-    }
-
-    public void testExpandWithoutReferencesingBaseDirectoryRelative() {
-        names.setDefaultScriptFileName(File.separator+"a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        assertEquals("d" + File.separator + "e", names.expandScriptFileName("d" + File.separator + "e")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-    }
-
-    public void testHasBaseDefaultBeenSet() {
-        assertFalse(names.hasDefaultScriptFileBeenSet());
-        names.setDefaultScriptFileName("a"); //$NON-NLS-1$
-        assertTrue(names.hasDefaultScriptFileBeenSet());
-    }
-
-    public void testSettingDefaultByUsing() {
-        names.usingScriptFile("a"); //$NON-NLS-1$
-        assertTrue(names.hasDefaultScriptFileBeenSet());
-    }
-
-    public void testUsingIgnoredAfterSetDefaultCalled() {
-        names.setDefaultScriptFileName("a"); //$NON-NLS-1$
-        names.usingScriptFile("b"); //$NON-NLS-1$
-        assertEquals("a", names.getUnexpandedCurrentScriptFileName()); //$NON-NLS-1$
-    }
-
-    public void testExecutingScriptAsStack() {
-        names.setDefaultScriptFileName(File.separator+"a"+File.separator+"b"+File.separator+"c"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        names.startingScriptFromFile(File.separator+"d"+File.separator+"e"); //$NON-NLS-1$ //$NON-NLS-2$
-        names.startingScriptFromFile(File.separator+"f"+File.separator+"g"); //$NON-NLS-1$ //$NON-NLS-2$
-        names.startingScriptFromFile(File.separator+"h"+File.separator+"i"); //$NON-NLS-1$ //$NON-NLS-2$
-        names.finishedScript();
-        assertEquals("g", names.getUnexpandedCurrentScriptFileName()); //$NON-NLS-1$
-    }
-
-    public void testClone() throws CloneNotSupportedException {
-        names.startingScriptFromFile("a"); //$NON-NLS-1$
-        names.startingScriptFromFile("b"); //$NON-NLS-1$
-        ScriptFileNameStack names2 = (ScriptFileNameStack) names.clone();
-        names.finishedScript();
-        assertEquals("b", names2.getUnexpandedCurrentScriptFileName()); //$NON-NLS-1$
-    }
-
-}

Modified: trunk/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestShell.java
===================================================================
--- trunk/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestShell.java	2010-03-05 14:26:51 UTC (rev 1916)
+++ trunk/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestShell.java	2010-03-05 15:12:25 UTC (rev 1917)
@@ -24,7 +24,7 @@
 
 import junit.framework.TestCase;
 import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.core.util.StringUtilities;
+import com.metamatrix.core.util.StringUtil;
 import com.metamatrix.core.util.UnitTestUtil;
 
 public class TestShell extends TestCase {
@@ -45,13 +45,13 @@
 
     public void testHelp() {
         assertEquals("checkin String byte[] java.util.Date " //$NON-NLS-1$
-        + StringUtilities.LINE_SEPARATOR + "exit " //$NON-NLS-1$
-        + StringUtilities.LINE_SEPARATOR + "getLatest String " //$NON-NLS-1$
-        + StringUtilities.LINE_SEPARATOR + "getTrace " //$NON-NLS-1$
-        + StringUtilities.LINE_SEPARATOR + "help " //$NON-NLS-1$
-        + StringUtilities.LINE_SEPARATOR + "method0 String[] " //$NON-NLS-1$
-        + StringUtilities.LINE_SEPARATOR + "method1 String int[] " //$NON-NLS-1$
-        + StringUtilities.LINE_SEPARATOR + "quit" //$NON-NLS-1$
+        + StringUtil.LINE_SEPARATOR + "exit " //$NON-NLS-1$
+        + StringUtil.LINE_SEPARATOR + "getLatest String " //$NON-NLS-1$
+        + StringUtil.LINE_SEPARATOR + "getTrace " //$NON-NLS-1$
+        + StringUtil.LINE_SEPARATOR + "help " //$NON-NLS-1$
+        + StringUtil.LINE_SEPARATOR + "method0 String[] " //$NON-NLS-1$
+        + StringUtil.LINE_SEPARATOR + "method1 String int[] " //$NON-NLS-1$
+        + StringUtil.LINE_SEPARATOR + "quit" //$NON-NLS-1$
    , shell.execute("help").trim() ); //$NON-NLS-1$
     }
 



More information about the teiid-commits mailing list