[teiid-commits] teiid SVN: r1304 - in trunk: client/src/main/java/com/metamatrix/dqp/embedded and 10 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Wed Sep 2 11:28:04 EDT 2009


Author: rareddy
Date: 2009-09-02 11:28:03 -0400 (Wed, 02 Sep 2009)
New Revision: 1304

Modified:
   trunk/build/kit-runtime/deploy/log4j.xml
   trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java
   trunk/runtime/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactoryImpl.java
   trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestAdminApi.java
   trunk/test-integration/src/test/java/org/teiid/runtime/adminapi/TestDqpReDeployment.java
   trunk/test-integration/src/test/resources/admin/dqp-membership.properties
   trunk/test-integration/src/test/resources/admin/dqp.properties
   trunk/test-integration/src/test/resources/authcheck/bqt.properties
   trunk/test-integration/src/test/resources/bqt/bqt.properties
   trunk/test-integration/src/test/resources/metadata/dqp.properties
   trunk/test-integration/src/test/resources/partssupplier/dqp.properties
   trunk/test-integration/src/test/resources/vdbless/dqp.properties
   trunk/test-integration/src/test/resources/xml-vp/xmlvp.properties
Log:
TEIID-812: setting a system property for teiid.home contributed to making the following tests to use the previously set teiid.home instead of the current test.  Logging is now using ${teiid.logdir} as the system property, but a teiid configuration specifies it with dqp.logdir, so they will never collide and provides the accepted behavior.

Modified: trunk/build/kit-runtime/deploy/log4j.xml
===================================================================
--- trunk/build/kit-runtime/deploy/log4j.xml	2009-09-01 21:42:42 UTC (rev 1303)
+++ trunk/build/kit-runtime/deploy/log4j.xml	2009-09-02 15:28:03 UTC (rev 1304)
@@ -7,7 +7,7 @@
    </appender>
 
    <appender name="FILE" class="org.apache.log4j.RollingFileAppender">
-     <param name="File" value="${teiid.home}/log/teiid.log"/>
+     <param name="File" value="${teiid.logdir}/teiid.log"/>
      <param name="MaxFileSize" value="1000KB"/>
      <param name="MaxBackupIndex" value="25"/>
 
@@ -28,7 +28,7 @@
       
    <!-- un-comment to enable COMMAND log
    <appender name="COMMAND" class="org.apache.log4j.RollingFileAppender">
-     <param name="File" value="log/command.log"/>
+     <param name="File" value="${teiid.logdir}/command.log"/>
      <param name="MaxFileSize" value="1000KB"/>
      <param name="MaxBackupIndex" value="25"/>
       <layout class="org.apache.log4j.PatternLayout">
@@ -39,7 +39,7 @@
       
    <!-- Un-comment to enable AUDIT log    
    <appender name="AUDIT" class="org.apache.log4j.RollingFileAppender">
-     <param name="File" value="log/audit.log"/>
+     <param name="File" value="${teiid.logdir}/audit.log"/>
      <param name="MaxFileSize" value="1000KB"/>
      <param name="MaxBackupIndex" value="25"/>
       <layout class="org.apache.log4j.PatternLayout">
@@ -50,7 +50,7 @@
 
    <!-- Un-comment to enable Process Info log    
    <appender name="PROCESS_INFO" class="org.apache.log4j.RollingFileAppender">
-     <param name="File" value="log/process_info.log"/>
+     <param name="File" value="${teiid.logdir}/process_info.log"/>
      <param name="MaxFileSize" value="1000KB"/>
      <param name="MaxBackupIndex" value="25"/>
       <layout class="org.apache.log4j.PatternLayout">

Modified: trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java	2009-09-01 21:42:42 UTC (rev 1303)
+++ trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java	2009-09-02 15:28:03 UTC (rev 1304)
@@ -30,6 +30,7 @@
     public static final String COMMON_EXTENSION_CLASPATH = "dqp.extension.CommonClasspath"; //$NON-NLS-1$
     public static final String DQP_WORKDIR = "dqp.workdir"; //$NON-NLS-1$
     public static final String DQP_DEPLOYDIR = "dqp.deploydir"; //$NON-NLS-1$
+    public static final String DQP_LOGDIR = "dqp.logdir"; //$NON-NLS-1$
     public static final String DQP_LIBDIR = "dqp.lib"; //$NON-NLS-1$
     public static final String PROCESSNAME = "processName"; //$NON-NLS-1$
     public static final String CLUSTERNAME = "clusterName"; //$NON-NLS-1$
@@ -69,6 +70,7 @@
     public static final String HOST_ADDRESS = "hostAddress"; //$NON-NLS-1$
     public static final String DQP_BOOTSTRAP_FILE = "bootstrapFile"; //$NON-NLS-1$
     public static final String TEIID_HOME = "teiid.home"; //$NON-NLS-1$
+    public static final String TEIID_LOGDIR = "teiid.logdir"; //$NON-NLS-1$
 	
     
     /**

Modified: trunk/runtime/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactoryImpl.java
===================================================================
--- trunk/runtime/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactoryImpl.java	2009-09-01 21:42:42 UTC (rev 1303)
+++ trunk/runtime/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactoryImpl.java	2009-09-02 15:28:03 UTC (rev 1304)
@@ -119,9 +119,6 @@
         	bootstrapURL = URLHelper.buildURL(props.getProperty(DQPEmbeddedProperties.BOOTURL));
 	        // Create a temporary workspace directory
 			String teiidHome = props.getProperty(DQPEmbeddedProperties.TEIID_HOME);
-			if (System.getProperty(DQPEmbeddedProperties.TEIID_HOME) == null) {
-				System.setProperty(DQPEmbeddedProperties.TEIID_HOME, teiidHome);
-			}
 			
 	        this.workspaceDirectory = createWorkspace(teiidHome, props.getProperty(DQPEmbeddedProperties.DQP_WORKDIR, "work"), processName); //$NON-NLS-1$
 	        props.setProperty(DQPEmbeddedProperties.DQP_WORKDIR, this.workspaceDirectory);
@@ -138,6 +135,14 @@
 	        if (vdbDefinitions == null) {
 	        	props.setProperty(DQPEmbeddedProperties.VDB_DEFINITION, deployDirectory.getCanonicalPath());
 	        }
+	        
+	        // set the log directory
+	        File logDir = new File(teiidHome, props.getProperty(DQPEmbeddedProperties.DQP_LOGDIR, "log")); //$NON-NLS-1$
+	        if (!logDir.exists()) {
+	        	logDir.mkdirs();
+	        }
+	        System.setProperty(DQPEmbeddedProperties.TEIID_LOGDIR, logDir.getCanonicalPath());
+	        
 		} catch (IOException e) {
 			throw new ApplicationInitializationException(e);
 		}

Modified: trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestAdminApi.java
===================================================================
--- trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestAdminApi.java	2009-09-01 21:42:42 UTC (rev 1303)
+++ trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestAdminApi.java	2009-09-02 15:28:03 UTC (rev 1304)
@@ -72,8 +72,8 @@
 	
     @Before
 	public void setUp() throws Exception {
-		FileUtils.copy(UnitTestUtil.getTestDataPath()+"/admin/Admin.vdb", UnitTestUtil.getTestScratchPath()+"/Admin.vdb"); //$NON-NLS-1$ //$NON-NLS-2$
-		FileUtils.copy(UnitTestUtil.getTestDataPath()+"/ServerConfig.xml", UnitTestUtil.getTestScratchPath()+"/configuration.xml"); //$NON-NLS-1$ //$NON-NLS-2$
+		FileUtils.copy(UnitTestUtil.getTestDataPath()+"/admin/Admin.vdb", UnitTestUtil.getTestScratchPath()+"/adminapi/deploy/Admin.vdb"); //$NON-NLS-1$ //$NON-NLS-2$
+		FileUtils.copy(UnitTestUtil.getTestDataPath()+"/ServerConfig.xml", UnitTestUtil.getTestScratchPath()+"/adminapi/deploy/configuration.xml"); //$NON-NLS-1$ //$NON-NLS-2$
 	}
 	
     private void cleanDeploy() throws Exception {
@@ -705,7 +705,7 @@
 		addVDB(BQT, UnitTestUtil.getTestDataPath()+"/admin/QT_Ora9DSwDEF.vdb"); //$NON-NLS-1$
 		
 	    // make susre it exists as file
-	    File vdb = new File(UnitTestUtil.getTestScratchPath()+"/BQT_1.vdb"); //$NON-NLS-1$
+	    File vdb = new File(UnitTestUtil.getTestScratchPath()+"/adminapi/deploy/BQT_1.vdb"); //$NON-NLS-1$
 	    assertTrue("Persisted VDB file does not exists", vdb.exists()); //$NON-NLS-1$
 	    
 	    // Check when it last modified
@@ -807,7 +807,7 @@
 	    // testcase (1) (here the file should still exist; but report as non existent from API)
 	    deleteVDB(BQT, "1"); //$NON-NLS-1$
 	    assertFalse("VDB should exist because we still have an active user", hasVDB(BQT, "1")); //$NON-NLS-1$ //$NON-NLS-2$
-	    File f = new File(UnitTestUtil.getTestScratchPath()+"/BQT_1.vdb"); //$NON-NLS-1$
+	    File f = new File(UnitTestUtil.getTestScratchPath()+"/adminapi/deploy/BQT_1.vdb"); //$NON-NLS-1$
 	    assertTrue("since the connection is still open this file should exist", f.exists()); //$NON-NLS-1$
 	        
 	    // testcase (2)
@@ -875,7 +875,7 @@
 	    // here it should be gone we call delete
 	    deleteVDB(BQT, "2"); //$NON-NLS-1$
 	    assertFalse("VDB should exist because we still have an active user", hasVDB(BQT, "2")); //$NON-NLS-1$ //$NON-NLS-2$
-	    f = new File(UnitTestUtil.getTestScratchPath()+"/BQT_2.vdb"); //$NON-NLS-1$
+	    f = new File(UnitTestUtil.getTestScratchPath()+"/adminapi/deploy/BQT_2.vdb"); //$NON-NLS-1$
 	    assertFalse("since the connection is still open this file should exist", f.exists()); //$NON-NLS-1$
 	    
 	    // close the 1st connection
@@ -916,7 +916,7 @@
 		helpConnectorBindingAddTest(AdminOptions.OnConflict.OVERWRITE, 1);
 	}
 	
-	@Test public void testAddConnectorBindingWithProeprties() throws Exception {
+	@Test public void testAddConnectorBindingWithProperties() throws Exception {
 		getConnection(ADMIN, PROPS_FILE);
 		cleanDeploy();
 	              

Modified: trunk/test-integration/src/test/java/org/teiid/runtime/adminapi/TestDqpReDeployment.java
===================================================================
--- trunk/test-integration/src/test/java/org/teiid/runtime/adminapi/TestDqpReDeployment.java	2009-09-01 21:42:42 UTC (rev 1303)
+++ trunk/test-integration/src/test/java/org/teiid/runtime/adminapi/TestDqpReDeployment.java	2009-09-02 15:28:03 UTC (rev 1304)
@@ -25,8 +25,8 @@
     
 	@Before
 	public void setUp() throws Exception {
-		FileUtils.copy(UnitTestUtil.getTestDataPath()+"/admin/Admin.vdb", UnitTestUtil.getTestScratchPath()+"/Admin.vdb"); //$NON-NLS-1$ //$NON-NLS-2$
-		FileUtils.copy(UnitTestUtil.getTestDataPath()+"/ServerConfig.xml", UnitTestUtil.getTestScratchPath()+"/configuration.xml"); //$NON-NLS-1$ //$NON-NLS-2$	
+		FileUtils.copy(UnitTestUtil.getTestDataPath()+"/admin/Admin.vdb", UnitTestUtil.getTestScratchPath()+"/adminapi/deploy/Admin.vdb"); //$NON-NLS-1$ //$NON-NLS-2$
+		FileUtils.copy(UnitTestUtil.getTestDataPath()+"/ServerConfig.xml", UnitTestUtil.getTestScratchPath()+"/adminapi/deploy/configuration.xml"); //$NON-NLS-1$ //$NON-NLS-2$
 	}
     
 	@After

Modified: trunk/test-integration/src/test/resources/admin/dqp-membership.properties
===================================================================
--- trunk/test-integration/src/test/resources/admin/dqp-membership.properties	2009-09-01 21:42:42 UTC (rev 1303)
+++ trunk/test-integration/src/test/resources/admin/dqp-membership.properties	2009-09-02 15:28:03 UTC (rev 1304)
@@ -1,8 +1,6 @@
-dqp.configFile=../../../../target/scratch/configuration.xml
+dqp.configFile=../../../../target/scratch/adminapi/deploy/configuration.xml
 dqp.buffer.usedisk=false
 xa.enable_recovery=false
-dqp.deploydir=../../../../target/scratch
-dqp.workdir=../../../../target/scratch/work
 
 membership.enabled=true
 membership.superUser=admin
@@ -18,4 +16,6 @@
 
 dqp.userDefinedFunctionsFile=extensionjar:FunctionDefinitions.xmi
 processName=localhost
-dqp.extensions=../../../../target/scratch/extensions/;./extensions
\ No newline at end of file
+dqp.extensions=../../../../target/scratch/adminapi/extensions/;./extensions
+
+teiid.home=target/scratch/adminapi
\ No newline at end of file

Modified: trunk/test-integration/src/test/resources/admin/dqp.properties
===================================================================
--- trunk/test-integration/src/test/resources/admin/dqp.properties	2009-09-01 21:42:42 UTC (rev 1303)
+++ trunk/test-integration/src/test/resources/admin/dqp.properties	2009-09-02 15:28:03 UTC (rev 1304)
@@ -1,12 +1,15 @@
-dqp.configFile=../../../../target/scratch/configuration.xml
+dqp.configFile=../../../../target/scratch/adminapi/deploy/configuration.xml
 dqp.buffer.usedisk=false
 xa.enable_recovery=false
-dqp.deploydir=../../../../target/scratch
-dqp.workdir=../../../../target/scratch/work
+#dqp.deploydir=../../../../target/scratch
+#dqp.workdir=../../../../target/scratch/work
 membership.enabled=true
 membership.superUser=admin
 membership.superUserPassword=teiid
 auth.check_entitlements=false
 dqp.userDefinedFunctionsFile=extensionjar:FunctionDefinitions.xmi
 processName=localhost
-dqp.extensions=../../../../target/scratch/extensions/;./extensions
\ No newline at end of file
+dqp.extensions=../../../../target/scratch/adminapi/extensions/;./extensions
+
+
+teiid.home=target/scratch/adminapi
\ No newline at end of file

Modified: trunk/test-integration/src/test/resources/authcheck/bqt.properties
===================================================================
--- trunk/test-integration/src/test/resources/authcheck/bqt.properties	2009-09-01 21:42:42 UTC (rev 1303)
+++ trunk/test-integration/src/test/resources/authcheck/bqt.properties	2009-09-02 15:28:03 UTC (rev 1304)
@@ -38,6 +38,6 @@
 
 entitlements.enabled=true
 
-teiid.home=target/scratch
+teiid.home=target/scratch/authcheck
 
 processName=auth
\ No newline at end of file

Modified: trunk/test-integration/src/test/resources/bqt/bqt.properties
===================================================================
--- trunk/test-integration/src/test/resources/bqt/bqt.properties	2009-09-01 21:42:42 UTC (rev 1303)
+++ trunk/test-integration/src/test/resources/bqt/bqt.properties	2009-09-02 15:28:03 UTC (rev 1304)
@@ -28,5 +28,5 @@
 
 
 
-teiid.home=target/scratch
+teiid.home=target/scratch/bqt
 processName=bqt
\ No newline at end of file

Modified: trunk/test-integration/src/test/resources/metadata/dqp.properties
===================================================================
--- trunk/test-integration/src/test/resources/metadata/dqp.properties	2009-09-01 21:42:42 UTC (rev 1303)
+++ trunk/test-integration/src/test/resources/metadata/dqp.properties	2009-09-02 15:28:03 UTC (rev 1304)
@@ -29,5 +29,5 @@
 xa.enable_recovery=false
 
 
-teiid.home=target/scratch
+teiid.home=target/scratch/metadata
 processName=metadata
\ No newline at end of file

Modified: trunk/test-integration/src/test/resources/partssupplier/dqp.properties
===================================================================
--- trunk/test-integration/src/test/resources/partssupplier/dqp.properties	2009-09-01 21:42:42 UTC (rev 1303)
+++ trunk/test-integration/src/test/resources/partssupplier/dqp.properties	2009-09-02 15:28:03 UTC (rev 1304)
@@ -33,6 +33,6 @@
 xa.enable_recovery=false
 
 
-teiid.home=target/scratch
+teiid.home=target/scratch/parts
 
 processName=partssupplier

Modified: trunk/test-integration/src/test/resources/vdbless/dqp.properties
===================================================================
--- trunk/test-integration/src/test/resources/vdbless/dqp.properties	2009-09-01 21:42:42 UTC (rev 1303)
+++ trunk/test-integration/src/test/resources/vdbless/dqp.properties	2009-09-02 15:28:03 UTC (rev 1304)
@@ -27,6 +27,6 @@
 #only for testing, as this takes more time to start and shutdown
 xa.enable_recovery=false
 
-teiid.home=target/scratch
+teiid.home=target/scratch/vdbsless
 
 processName=vdbless
\ No newline at end of file

Modified: trunk/test-integration/src/test/resources/xml-vp/xmlvp.properties
===================================================================
--- trunk/test-integration/src/test/resources/xml-vp/xmlvp.properties	2009-09-01 21:42:42 UTC (rev 1303)
+++ trunk/test-integration/src/test/resources/xml-vp/xmlvp.properties	2009-09-02 15:28:03 UTC (rev 1304)
@@ -32,6 +32,6 @@
 #only for testing, as this takes more time to start and shutdown
 xa.enable_recovery=false
 
-teiid.home=target/scratch
+teiid.home=target/scratch/xml-vp
 
 processName=xml-vp



More information about the teiid-commits mailing list