svn commit: r1229478 - in /ofbiz/trunk: build.xml framework/build.xml framework/testtools/config/TestToolsConfig.properties framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1229478 - in /ofbiz/trunk: build.xml framework/build.xml framework/testtools/config/TestToolsConfig.properties framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java

hansbak-2
Author: hansbak
Date: Tue Jan 10 07:13:31 2012
New Revision: 1229478

URL: http://svn.apache.org/viewvc?rev=1229478&view=rev
Log:
make test-results location configurable in a propoerties file

Added:
    ofbiz/trunk/framework/testtools/config/TestToolsConfig.properties   (with props)
Modified:
    ofbiz/trunk/build.xml
    ofbiz/trunk/framework/build.xml
    ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java

Modified: ofbiz/trunk/build.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/build.xml?rev=1229478&r1=1229477&r2=1229478&view=diff
==============================================================================
--- ofbiz/trunk/build.xml (original)
+++ ofbiz/trunk/build.xml Tue Jan 10 07:13:31 2012
@@ -847,12 +847,13 @@ under the License.
             <arg value="test"/>
             <env key="LC_ALL" value="C"/>
         </java>
-        <mkdir dir="runtime/logs/test-results/html"/>
-        <junitreport todir="runtime/logs/test-results">
-            <fileset dir="runtime/logs/test-results/">
+        <property file="${basedir}/framework/testtools/config/TestToolsConfig.properties"/>
+        <mkdir dir="${testtools.test-results-dir}html"/>
+        <junitreport todir="${testtools.test-results-dir}">
+            <fileset dir="${testtools.test-results-dir}">
                 <include name="*.xml"/>
             </fileset>
-            <report format="frames" todir="runtime/logs/test-results/html"/>
+            <report format="frames" todir="${testtools.test-results-dir}html"/>
         </junitreport>
         <fail message="Test run was unsuccessful">
             <condition>
@@ -891,10 +892,11 @@ under the License.
             <arg value="-case=${test.case}"/>
             <env key="LC_ALL" value="C"/>
         </java>
-        <delete dir="runtime/logs/test-results/${test.component}-${test.case}"/>
-        <mkdir dir="runtime/logs/test-results/${test.component}-${test.case}"/>
-        <move todir="runtime/logs/test-results/${test.component}-${test.case}">
-            <fileset dir="runtime/logs/test-results" includes="*.xml"/>
+        <property file="${basedir}/framework/testtools/config/TestToolsConfig.properties"/>
+        <delete dir="${testtools.test-results-dir}${test.component}-${test.case}"/>
+        <mkdir dir="${testtools.test-results-dir}${test.component}-${test.case}"/>
+        <move todir="${testtools.test-results-dir}${test.component}-${test.case}">
+            <fileset dir="${testtools.test-results-dir}" includes="*.xml"/>
         </move>
         <fail message="Test run was unsuccessful">
             <condition>
@@ -925,7 +927,7 @@ under the License.
     </target>
     <target name="run-test-list" depends="_setup-separated-test-run"
             description="Run all configured tests, stopping/starting ofbiz between each test">
-        <delete dir="runtime/logs/test-results"/>
+        <delete dir="${testtools.test-results-dir}"/>
         <ant antfile="runtime/test-list-build.xml" target="all-tests"/>
     </target>
 

Modified: ofbiz/trunk/framework/build.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/build.xml?rev=1229478&r1=1229477&r2=1229478&view=diff
==============================================================================
--- ofbiz/trunk/framework/build.xml (original)
+++ ofbiz/trunk/framework/build.xml Tue Jan 10 07:13:31 2012
@@ -49,7 +49,6 @@ under the License.
         <mkdir dir="../runtime"/>
         <mkdir dir="../runtime/output"/>
         <mkdir dir="../runtime/logs"/>
-        <mkdir dir="../runtime/logs/test-results"/>
         <mkdir dir="../runtime/data"/>
         <mkdir dir="../runtime/data/derby"/>
         <mkdir dir="../runtime/data/hsql"/>
@@ -92,7 +91,8 @@ under the License.
     </target>
 
     <target name="clean-logs">
-        <delete verbose="on" dir="../runtime/logs/test-results"/>
+        <property file="${basedir}/framework/testtools/config/TestTools.properties"/>
+        <delete verbose="on" dir="../${testtools.test-results-dir}"/>
         <delete dir="../runtime/logs/cobertura-report"/>
         <delete verbose="on">
             <fileset dir="../runtime/logs" includes="*">

Added: ofbiz/trunk/framework/testtools/config/TestToolsConfig.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/config/TestToolsConfig.properties?rev=1229478&view=auto
==============================================================================
--- ofbiz/trunk/framework/testtools/config/TestToolsConfig.properties (added)
+++ ofbiz/trunk/framework/testtools/config/TestToolsConfig.properties Tue Jan 10 07:13:31 2012
@@ -0,0 +1,22 @@
+###############################################################################
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+###############################################################################
+
+# define the test results directory
+testtools.test-results-dir=runtime/logs/test-results/
+

Propchange: ofbiz/trunk/framework/testtools/config/TestToolsConfig.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/testtools/config/TestToolsConfig.properties
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/framework/testtools/config/TestToolsConfig.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java?rev=1229478&r1=1229477&r2=1229478&view=diff
==============================================================================
--- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java (original)
+++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java Tue Jan 10 07:13:31 2012
@@ -40,6 +40,7 @@ import org.apache.tools.ant.taskdefs.opt
 import org.ofbiz.base.container.Container;
 import org.ofbiz.base.container.ContainerException;
 import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilProperties;
 import org.ofbiz.entity.Delegator;
 
 /**
@@ -48,7 +49,6 @@ import org.ofbiz.entity.Delegator;
 public class TestRunContainer implements Container {
 
     public static final String module = TestRunContainer.class.getName();
-    public static final String logDir = "runtime/logs/test-results/";
 
     protected String configFile = null;
     protected String component = null;
@@ -93,7 +93,7 @@ public class TestRunContainer implements
                 }
             }
         }
-
+        String logDir = UtilProperties.getPropertyValue("TestToolsConfig", "test-results-dir");
         // make sure the log dir exists
         File dir = new File(logDir);
         if (!dir.exists())
@@ -120,6 +120,9 @@ public class TestRunContainer implements
             throw new ContainerException("No tests found (" + component + " / " + suiteName + " / " + testCase + ")");
         }
 
+        // get logdir
+        String logDir = UtilProperties.getPropertyValue("TestToolsConfig", "test-results-dir");
+        
         boolean failedRun = false;
         for (ModelTestSuite modelSuite: jsWrapper.getModelTestSuites()) {
             Delegator testDelegator = modelSuite.getDelegator();