From f207e9cd22c2017941e4d2fc2ac2e5d737ae4f3b Mon Sep 17 00:00:00 2001 From: Hans Bakker Date: Tue, 10 Jan 2012 07:13:31 +0000 Subject: [PATCH] make test-results location configurable in a propoerties file git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1229478 13f79535-47bb-0310-9956-ffa450edef68 --- build.xml | 20 +++++++++-------- framework/build.xml | 4 ++-- .../config/TestToolsConfig.properties | 22 +++++++++++++++++++ .../org/ofbiz/testtools/TestRunContainer.java | 7 ++++-- 4 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 framework/testtools/config/TestToolsConfig.properties diff --git a/build.xml b/build.xml index bec6f8d9ca..799ae93f10 100644 --- a/build.xml +++ b/build.xml @@ -847,12 +847,13 @@ under the License. - - - + + + + - + @@ -891,10 +892,11 @@ under the License. - - - - + + + + + @@ -925,7 +927,7 @@ under the License. - + diff --git a/framework/build.xml b/framework/build.xml index 1d84b4920b..359680e8ab 100644 --- a/framework/build.xml +++ b/framework/build.xml @@ -49,7 +49,6 @@ under the License. - @@ -92,7 +91,8 @@ under the License. - + + diff --git a/framework/testtools/config/TestToolsConfig.properties b/framework/testtools/config/TestToolsConfig.properties new file mode 100644 index 0000000000..fb3ac48876 --- /dev/null +++ b/framework/testtools/config/TestToolsConfig.properties @@ -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/ + diff --git a/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java b/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java index 0dba16eaaa..91b6c893bd 100644 --- a/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java +++ b/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java @@ -40,6 +40,7 @@ import org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter; 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 Container { } } } - + 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 Container { 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();