Author: lfryc(a)redhat.com
Date: 2010-09-02 06:26:45 -0400 (Thu, 02 Sep 2010)
New Revision: 19090
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java
Log:
skip all method invocations when some of previous method invocations failed
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java 2010-09-02
10:23:29 UTC (rev 19089)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java 2010-09-02
10:26:45 UTC (rev 19090)
@@ -48,12 +48,12 @@
import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.richfaces.tests.metamer.ftest.annotations.Uses;
-import org.testng.IAnnotationTransformer;
import org.testng.IInvokedMethod;
import org.testng.IInvokedMethodListener;
import org.testng.IMethodInstance;
import org.testng.IMethodInterceptor;
import org.testng.ITestContext;
+import org.testng.ITestListener;
import org.testng.ITestNGMethod;
import org.testng.ITestResult;
import org.testng.annotations.ITestAnnotation;
@@ -62,8 +62,8 @@
* @author <a href="mailto:ppitonak@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
-public class MatrixConfigurator extends TestMethodSelector implements
IAnnotationTransformer, IInvokedMethodListener,
- IMethodInterceptor {
+public class MatrixConfigurator extends TestMethodSelector implements
IInvokedMethodListener, IMethodInterceptor,
+ ITestListener {
static Map<Field, Object> currentConfiguration;
@@ -98,6 +98,10 @@
}
}
+ public void onTestSkipped(ITestResult result) {
+ configureMethod(result);
+ }
+
private boolean isAfterConfiguration(ITestNGMethod m) {
return m.isAfterClassConfiguration() || m.isAfterGroupsConfiguration() ||
m.isAfterMethodConfiguration()
|| m.isAfterSuiteConfiguration() || m.isAfterTestConfiguration();
@@ -145,6 +149,7 @@
super.transform(annotation, testClass, testConstructor, testMethod);
int invocationCount = createConfiguration(testMethod.getDeclaringClass(),
testMethod);
annotation.setInvocationCount(invocationCount);
+ annotation.setSkipFailedInvocations(true);
}
public int createConfiguration(Class<?> realClass, Method realMethod) {
@@ -474,4 +479,22 @@
throw new UnsupportedOperationException();
}
}
+
+ public void onTestStart(ITestResult result) {
+ }
+
+ public void onTestSuccess(ITestResult result) {
+ }
+
+ public void onTestFailure(ITestResult result) {
+ }
+
+ public void onTestFailedButWithinSuccessPercentage(ITestResult result) {
+ }
+
+ public void onStart(ITestContext context) {
+ }
+
+ public void onFinish(ITestContext context) {
+ }
}
Show replies by date