Author: pete.muir(a)jboss.org
Date: 2009-03-11 09:17:20 -0400 (Wed, 11 Mar 2009)
New Revision: 1913
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/runner/BufferedListener.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/runner/TestResultImpl.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/runner/TestRunner.java
Log:
Switch to using harness project
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/runner/BufferedListener.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/runner/BufferedListener.java 2009-03-11
13:16:34 UTC (rev 1912)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/runner/BufferedListener.java 2009-03-11
13:17:20 UTC (rev 1913)
@@ -1,78 +0,0 @@
-package org.jboss.jsr299.tck.impl.runner;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.testng.ITestContext;
-import org.testng.ITestListener;
-import org.testng.ITestResult;
-
-public class BufferedListener implements ITestListener
-{
-
- private ITestContext context;
-
-
- public BufferedListener()
- {
- }
-
- public void onFinish(ITestContext context)
- {
- this.context = context;
- }
-
- public void onStart(ITestContext context)
- {
- // No-op
- }
-
- public void onTestFailedButWithinSuccessPercentage(ITestResult result)
- {
- // No-op
- }
-
- public void onTestFailure(ITestResult result)
- {
- // No-op
- }
-
- public void onTestSkipped(ITestResult result)
- {
- // No-op
- }
-
- public void onTestStart(ITestResult result)
- {
- // No-op
- }
-
- public void onTestSuccess(ITestResult result)
- {
- // No-op
- }
-
- public ITestContext getContext()
- {
- return context;
- }
-
- public List<ITestResult> getTestResults()
- {
- List<ITestResult> results = new ArrayList<ITestResult>();
- results.addAll(context.getFailedTests().getAllResults());
- results.addAll(context.getPassedTests().getAllResults());
- results.addAll(context.getSkippedTests().getAllResults());
- return results;
- }
-
- public List<ITestResult> getConfigurationResults()
- {
- List<ITestResult> results = new ArrayList<ITestResult>();
- results.addAll(context.getFailedConfigurations().getAllResults());
- results.addAll(context.getPassedConfigurations().getAllResults());
- results.addAll(context.getSkippedConfigurations().getAllResults());
- return results;
- }
-
-}
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/runner/TestResultImpl.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/runner/TestResultImpl.java 2009-03-11
13:16:34 UTC (rev 1912)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/runner/TestResultImpl.java 2009-03-11
13:17:20 UTC (rev 1913)
@@ -1,55 +0,0 @@
-package org.jboss.jsr299.tck.impl.runner;
-
-import java.io.Serializable;
-
-import org.jboss.jsr299.tck.api.TestResult;
-import org.testng.ITestResult;
-
-public class TestResultImpl implements Serializable, TestResult
-{
-
- private static final long serialVersionUID = -6608901483105666644L;
-
- private Throwable throwable;
- private Status status;
-
-
-
- public TestResultImpl(Status status, Throwable throwable)
- {
- super();
- this.throwable = throwable;
- this.status = status;
- }
-
- public Status getStatus()
- {
- return status;
- }
-
- public Throwable getThrowable()
- {
- return throwable;
- }
-
- public static TestResult of(ITestResult testNGResult)
- {
- if (testNGResult.getStatus() == 1)
- {
- return new TestResultImpl(Status.PASSED, null);
- }
- else if (testNGResult.getStatus() == 2)
- {
- return new TestResultImpl(Status.FAILED, testNGResult.getThrowable());
- }
- else if (testNGResult.getStatus() == 3)
- {
- return new TestResultImpl(Status.SKIPPED, testNGResult.getThrowable());
- }
- else
- {
- return null;
- }
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/runner/TestRunner.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/runner/TestRunner.java 2009-03-11
13:16:34 UTC (rev 1912)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/runner/TestRunner.java 2009-03-11
13:17:20 UTC (rev 1913)
@@ -1,104 +0,0 @@
-package org.jboss.jsr299.tck.impl.runner;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.jsr299.tck.AbstractDeclarativeTest;
-import org.jboss.jsr299.tck.impl.testng.RemoveExpectedExceptionsAnnotationTransformer;
-import org.jboss.jsr299.tck.impl.util.DeploymentProperties;
-import org.testng.ITestContext;
-import org.testng.ITestResult;
-import org.testng.TestNG;
-import org.testng.xml.XmlClass;
-import org.testng.xml.XmlSuite;
-import org.testng.xml.XmlTest;
-
-public class TestRunner
-{
-
- private List<String> classNames;
- private List<String> methodNames;
- private ITestContext context;
- private List<ITestResult> testResults;
- private List<ITestResult> configurationResults;
-
- public TestRunner()
- {
- methodNames = new ArrayList<String>();
- classNames = new ArrayList<String>();
-
- }
-
- public List<String> getClassNames()
- {
- return classNames;
- }
-
- public List<String> getMethodNames()
- {
- return methodNames;
- }
-
- public void run(boolean ignoreExpectedExceptions)
- {
- AbstractDeclarativeTest.setInContainer(true);
- if (classNames.size() == 0)
- {
- DeploymentProperties deploymentProperties = new DeploymentProperties();
- this.classNames =
deploymentProperties.getPropertyValues("className");
- }
- TestNG testNG = new TestNG(false);
- testNG.setVerbose(0);
- BufferedListener listener = new BufferedListener();
- testNG.addListener(listener);
- List<XmlSuite> xmlSuites = new ArrayList<XmlSuite>();
- testNG.setXmlSuites(xmlSuites);
- xmlSuites.add(createSuite());
- if (ignoreExpectedExceptions)
- {
- testNG.setAnnotationTransformer(new
RemoveExpectedExceptionsAnnotationTransformer());
- }
- testNG.run();
- this.context = listener.getContext();
- this.testResults = listener.getTestResults();
- this.configurationResults = listener.getConfigurationResults();
- }
-
-
- private XmlSuite createSuite()
- {
- XmlSuite suite = new XmlSuite();
- suite.setName("JSR-299 TCK");
- suite.setAnnotations("JDK5_ANNOTATION_TYPE");
- for (String className : classNames)
- {
- XmlTest test = new XmlTest(suite);
- test.setName("JSR-299 TCK" + className);
- List<XmlClass> testClasses = new ArrayList<XmlClass>();
- XmlClass testClass = new XmlClass(className);
- for (String methodName : getMethodNames())
- {
- testClass.getIncludedMethods().add(methodName);
- }
- testClasses.add(testClass);
- test.setXmlClasses(testClasses);
- }
- return suite;
- }
-
- public ITestContext getContext()
- {
- return context;
- }
-
- public List<ITestResult> getTestResults()
- {
- return testResults;
- }
-
- public List<ITestResult> getConfigurationResults()
- {
- return configurationResults;
- }
-
-}
Show replies by date