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

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Tue Mar 24 11:10:39 EDT 2009


Author: shawkins
Date: 2009-03-24 11:10:39 -0400 (Tue, 24 Mar 2009)
New Revision: 636

Modified:
   trunk/connector-sdk/src/main/java/com/metamatrix/cdk/ConnectorShell.java
   trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/CommandShell.java
   trunk/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestShell.java
   trunk/pom.xml
   trunk/test-integration/src/test/java/com/metamatrix/cdk/TestConnectorShell.java
Log:
adding changes from 6.0.0 release

Modified: trunk/connector-sdk/src/main/java/com/metamatrix/cdk/ConnectorShell.java
===================================================================
--- trunk/connector-sdk/src/main/java/com/metamatrix/cdk/ConnectorShell.java	2009-03-24 04:52:28 UTC (rev 635)
+++ trunk/connector-sdk/src/main/java/com/metamatrix/cdk/ConnectorShell.java	2009-03-24 15:10:39 UTC (rev 636)
@@ -29,6 +29,8 @@
  * Command line utility to execute queries on a connector.
  */
 public class ConnectorShell extends CommandShell {
+	
+	
 
     public ConnectorShell(IConnectorHost host) {
         super(new ConnectorShellCommandTarget(host));
@@ -41,7 +43,7 @@
     public static void main(String[] args) {
         System.out.println("Starting"); //$NON-NLS-1$
         
-        new ConnectorShell(new ConnectorShellCommandTarget()).run(args);
+        new ConnectorShell(new ConnectorShellCommandTarget()).run(args, DEFAULT_LOG_FILE);
     }
     
     protected boolean showHelpFor(String methodName) {

Modified: trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/CommandShell.java
===================================================================
--- trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/CommandShell.java	2009-03-24 04:52:28 UTC (rev 635)
+++ trunk/connector-sdk/src/main/java/com/metamatrix/core/commandshell/CommandShell.java	2009-03-24 15:10:39 UTC (rev 636)
@@ -52,12 +52,8 @@
     private static final String JAVA_LANG_PREFIX = "java.lang."; //$NON-NLS-1$
 
     
-    public final static String DEFAULT_LOG_FILE = "..\\log\\command_shell.log"; //$NON-NLS-1$
+    public final static String DEFAULT_LOG_FILE = "../log/command_shell.log"; //$NON-NLS-1$
     
-    private static final String PROPERTY_LOG_CONSOLE = "metamatrix.log.console"; //$NON-NLS-1$
-
-    
-    
     private CommandTarget commandTarget;
     private boolean exceptionHandlingOn = false;
     private boolean printStackTraceOnException = true;
@@ -113,8 +109,8 @@
     /**
      * Start reading commands from standard input.
      */
-    public void run(String[] args) {
-        redirectLogging();
+    public void run(String[] args, String logFile) {
+        redirectLogging(logFile);
         
         
         writeln(CorePlugin.Util.getString("CommandShell.Started")); //$NON-NLS-1$
@@ -142,9 +138,9 @@
     }
 
     
-    private void redirectLogging() {
+    private void redirectLogging(String logFile) {
         //add a listener that writes to a file
-        File file = new File(DEFAULT_LOG_FILE);
+        File file = new File(logFile);
 		FileLogWriter flw = new FileLogWriter(file);
 
         PlatformLog logger = new PlatformLog();

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	2009-03-24 04:52:28 UTC (rev 635)
+++ trunk/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestShell.java	2009-03-24 15:10:39 UTC (rev 636)
@@ -25,6 +25,7 @@
 import junit.framework.TestCase;
 import com.metamatrix.core.MetaMatrixRuntimeException;
 import com.metamatrix.core.util.StringUtilities;
+import com.metamatrix.core.util.UnitTestUtil;
 
 public class TestShell extends TestCase {
 
@@ -36,7 +37,7 @@
 
     public void testInvalidMethodNameViaRun() {
         try {
-            shell.run(new String[] {"foo"}); //$NON-NLS-1$
+            shell.run(new String[] {"foo"}, UnitTestUtil.getTestScratchPath() + "/connector_shell.log"); //$NON-NLS-1$ //$NON-NLS-2$
         } catch (MetaMatrixRuntimeException e) {
             assertEquals( "Could not find method 'com.metamatrix.core.commandshell.FakeCommandTarget.foo'.", e.getMessage() ); //$NON-NLS-1$
         }

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2009-03-24 04:52:28 UTC (rev 635)
+++ trunk/pom.xml	2009-03-24 15:10:39 UTC (rev 636)
@@ -12,6 +12,9 @@
 		<ant.version>1.7.0</ant.version>
 		<site.url>http://www.jboss.org/teiid</site.url>
 	</properties>
+	<scm>
+		<developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/trunk</developerConnection>
+	</scm>
 	<licenses>
 		<license>
 			<name>GNU Lesser General Public License</name>
@@ -456,4 +459,10 @@
 		<module>cache-jbosscache</module>
 		<module>server-installer</module>
 	</modules>
+	<distributionManagement>
+		<repository>
+			<id>repository.jboss.org</id>
+			<url>${jboss.repository.root}</url>
+		</repository>
+	</distributionManagement>
 </project>
\ No newline at end of file

Modified: trunk/test-integration/src/test/java/com/metamatrix/cdk/TestConnectorShell.java
===================================================================
--- trunk/test-integration/src/test/java/com/metamatrix/cdk/TestConnectorShell.java	2009-03-24 04:52:28 UTC (rev 635)
+++ trunk/test-integration/src/test/java/com/metamatrix/cdk/TestConnectorShell.java	2009-03-24 15:10:39 UTC (rev 636)
@@ -51,7 +51,7 @@
         connectorShell = new ConnectorShell(commandTarget);
         connectorShell.setSilent(true);
         connectorShell.setPrintStackTraceOnException(false);
-        connectorShell.setDefaultFilePath(UnitTestUtil.getTestDataPath() + File.separator); //$NON-NLS-1$
+        connectorShell.setDefaultFilePath(UnitTestUtil.getTestDataPath() + File.separator); 
     }
 
     public void testLoad() {
@@ -60,7 +60,7 @@
     }
     
     private String loadLoopBackConnector() {
-        return connectorShell.execute("load com.metamatrix.connector.loopback.LoopbackConnector partssupplier/PartsSupplier.vdb"); //$NON-NLS-1$  //$NON-NLS-2$
+        return connectorShell.execute("load com.metamatrix.connector.loopback.LoopbackConnector partssupplier/PartsSupplier.vdb"); //$NON-NLS-1$  
     }
     
     private void start() {
@@ -89,7 +89,7 @@
     }
     
     private void setScriptFile(String fileName) {
-        connectorShell.execute("setScriptFile " + UnitTestUtil.getTestDataPath() + File.separator + fileName); //$NON-NLS-1$ //$NON-NLS-2$
+        connectorShell.execute("setScriptFile " + UnitTestUtil.getTestDataPath() + File.separator + fileName); //$NON-NLS-1$ 
     }
     
     public void testCallingScriptFromAnotherScriptFile() {
@@ -119,25 +119,25 @@
     }
     
     public void testSetProperty() {
-        connectorShell.setDefaultFilePath(UnitTestUtil.getTestDataPath() + File.separator); //$NON-NLS-1$
+        connectorShell.setDefaultFilePath(UnitTestUtil.getTestDataPath() + File.separator); 
         setScriptFile();
         String result = connectorShell.execute("run testSetProperty"); //$NON-NLS-1$
-        assertEquals("", result); //$NON-NLS-1$ //$NON-NLS-2$
+        assertEquals("", result); //$NON-NLS-1$ 
     }
     
     public void testSetPropertyAfterConnectorHostStart() {
-        connectorShell.setDefaultFilePath(UnitTestUtil.getTestDataPath() + File.separator); //$NON-NLS-1$
+        connectorShell.setDefaultFilePath(UnitTestUtil.getTestDataPath() + File.separator); 
         setScriptFile();
         start();
         String result = connectorShell.execute("run testSetPropertyAfterConnectorHostStart"); //$NON-NLS-1$
-        assertEquals("", result); //$NON-NLS-1$ //$NON-NLS-2$
+        assertEquals("", result); //$NON-NLS-1$ 
     }
     
     public void testLoadingClearsProperties() {
-        connectorShell.setDefaultFilePath(UnitTestUtil.getTestDataPath() + File.separator); //$NON-NLS-1$
+        connectorShell.setDefaultFilePath(UnitTestUtil.getTestDataPath() + File.separator); 
         setScriptFile();
         String result = connectorShell.execute("run testLoadingClearsProperties"); //$NON-NLS-1$
-        assertEquals("", result); //$NON-NLS-1$ //$NON-NLS-2$
+        assertEquals("", result); //$NON-NLS-1$ 
     }
     
     public void testRunAllTestsWithoutSetup() {
@@ -156,7 +156,7 @@
     }
     
     public void testInvokingAsCommandLine() {
-        ConnectorShell.main(new String[] {"quit"});         //$NON-NLS-1$
+        new ConnectorShell(new ConnectorShellCommandTarget()).run(new String[] {"quit"}, UnitTestUtil.getTestScratchPath() + "/connector_shell.log"); //$NON-NLS-1$ //$NON-NLS-2$
     }
     
     




More information about the teiid-commits mailing list