[teiid-commits] teiid SVN: r631 - in branches/6.0.x: connector-sdk/src/main/java/com/metamatrix/cdk and 3 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Mon Mar 23 21:49:39 EDT 2009


Author: shawkins
Date: 2009-03-23 21:49:39 -0400 (Mon, 23 Mar 2009)
New Revision: 631

Modified:
   branches/6.0.x/connector-sdk/src/main/java/com/metamatrix/cdk/ConnectorShell.java
   branches/6.0.x/connector-sdk/src/main/java/com/metamatrix/core/commandshell/CommandShell.java
   branches/6.0.x/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestShell.java
   branches/6.0.x/pom.xml
   branches/6.0.x/test-integration/src/test/java/com/metamatrix/cdk/TestConnectorShell.java
Log:
release preparation changes

Modified: branches/6.0.x/connector-sdk/src/main/java/com/metamatrix/cdk/ConnectorShell.java
===================================================================
--- branches/6.0.x/connector-sdk/src/main/java/com/metamatrix/cdk/ConnectorShell.java	2009-03-23 23:53:51 UTC (rev 630)
+++ branches/6.0.x/connector-sdk/src/main/java/com/metamatrix/cdk/ConnectorShell.java	2009-03-24 01:49:39 UTC (rev 631)
@@ -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: branches/6.0.x/connector-sdk/src/main/java/com/metamatrix/core/commandshell/CommandShell.java
===================================================================
--- branches/6.0.x/connector-sdk/src/main/java/com/metamatrix/core/commandshell/CommandShell.java	2009-03-23 23:53:51 UTC (rev 630)
+++ branches/6.0.x/connector-sdk/src/main/java/com/metamatrix/core/commandshell/CommandShell.java	2009-03-24 01:49:39 UTC (rev 631)
@@ -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: branches/6.0.x/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestShell.java
===================================================================
--- branches/6.0.x/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestShell.java	2009-03-23 23:53:51 UTC (rev 630)
+++ branches/6.0.x/connector-sdk/src/test/java/com/metamatrix/core/commandshell/TestShell.java	2009-03-24 01:49:39 UTC (rev 631)
@@ -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: branches/6.0.x/pom.xml
===================================================================
--- branches/6.0.x/pom.xml	2009-03-23 23:53:51 UTC (rev 630)
+++ branches/6.0.x/pom.xml	2009-03-24 01:49:39 UTC (rev 631)
@@ -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/branches/6.0.x</developerConnection>
+	</scm>
 	<licenses>
 		<license>
 			<name>GNU Lesser General Public License</name>

Modified: branches/6.0.x/test-integration/src/test/java/com/metamatrix/cdk/TestConnectorShell.java
===================================================================
--- branches/6.0.x/test-integration/src/test/java/com/metamatrix/cdk/TestConnectorShell.java	2009-03-23 23:53:51 UTC (rev 630)
+++ branches/6.0.x/test-integration/src/test/java/com/metamatrix/cdk/TestConnectorShell.java	2009-03-24 01:49:39 UTC (rev 631)
@@ -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