Author: doogie
Date: Thu Mar 5 06:52:40 2009 New Revision: 750341 URL: http://svn.apache.org/viewvc?rev=750341&view=rev Log: Add support for limiting the test run based on suite-name. Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/JunitSuiteWrapper.java ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java Modified: ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/JunitSuiteWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/JunitSuiteWrapper.java?rev=750341&r1=750340&r2=750341&view=diff ============================================================================== --- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/JunitSuiteWrapper.java (original) +++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/JunitSuiteWrapper.java Thu Mar 5 06:52:40 2009 @@ -41,7 +41,7 @@ protected List<ModelTestSuite> modelTestSuiteList = FastList.newInstance(); - public JunitSuiteWrapper(String componentName, String testCase) { + public JunitSuiteWrapper(String componentName, String suiteName, String testCase) { for (ComponentConfig.TestSuiteInfo testSuiteInfo: ComponentConfig.getAllTestSuiteInfos(componentName)) { ResourceHandler testSuiteResource = testSuiteInfo.createResourceHandler(); @@ -53,6 +53,9 @@ ModelTestSuite modelTestSuite = new ModelTestSuite(documentElement, testCase); // make sure there are test-cases configured for the suite + if (suiteName != null && !modelTestSuite.getSuiteName().equals(suiteName)) { + continue; + } if (modelTestSuite.getTestList().size() > 0) { this.modelTestSuiteList.add(modelTestSuite); } 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=750341&r1=750340&r2=750341&view=diff ============================================================================== --- ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java (original) +++ ofbiz/trunk/framework/testtools/src/org/ofbiz/testtools/TestRunContainer.java Thu Mar 5 06:52:40 2009 @@ -43,6 +43,7 @@ protected String configFile = null; protected String component = null; + protected String suiteName = null; protected String testCase = null; protected String logLevel = null; @@ -71,6 +72,9 @@ if ("component".equalsIgnoreCase(argumentName)) { this.component = argumentVal; } + if ("suitename".equalsIgnoreCase(argumentName)) { + this.suiteName = argumentVal; + } if ("case".equalsIgnoreCase(argumentName)) { this.testCase = argumentVal; } @@ -102,9 +106,9 @@ } // get the tests to run - JunitSuiteWrapper jsWrapper = new JunitSuiteWrapper(component, testCase); + JunitSuiteWrapper jsWrapper = new JunitSuiteWrapper(component, suiteName, testCase); if (jsWrapper.getAllTestList().size() == 0) { - throw new ContainerException("No tests found (" + component + " / " + testCase + ")"); + throw new ContainerException("No tests found (" + component + " / " + suiteName + " / " + testCase + ")"); } for (TestSuite suite: jsWrapper.makeTestSuites()) { |
Free forum by Nabble | Edit this page |