Author: jkuhnert
Date: Sat Apr 28 07:51:18 2007
New Revision: 533351
URL: http://svn.apache.org/viewvc?view=rev&rev=533351
Log:
TestNGReporter wasn't calling the contextFinished cleanup method for each
specific context finish so the reporters were all stuffing their contents into
one gigantic test set.
Modified:
maven/sandbox/branches/surefire/surefire-collaboration/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGReporter.java
Modified:
maven/sandbox/branches/surefire/surefire-collaboration/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGReporter.java
URL:
http://svn.apache.org/viewvc/maven/sandbox/branches/surefire/surefire-collaboration/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGReporter.java?view=diff&rev=533351&r1=533350&r2=533351
==============================================================================
---
maven/sandbox/branches/surefire/surefire-collaboration/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGReporter.java
(original)
+++
maven/sandbox/branches/surefire/surefire-collaboration/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGReporter.java
Sat Apr 28 07:51:18 2007
@@ -24,13 +24,7 @@
import org.apache.maven.surefire.report.ReporterException;
import org.apache.maven.surefire.report.ReporterManager;
import org.apache.maven.surefire.suite.SurefireTestSuite;
-import org.testng.IResultMap;
-import org.testng.ISuite;
-import org.testng.ISuiteListener;
-import org.testng.ITestContext;
-import org.testng.ITestListener;
-import org.testng.ITestResult;
-import org.testng.TestNG;
+import org.testng.*;
import java.lang.reflect.Method;
import java.util.Iterator;
@@ -86,15 +80,17 @@
String rawString = bundle.getString( "testStarting" );
String group = groupString( result.getMethod().getGroups(),
result.getTestClass().getName() );
ReportEntry report = new ReportEntry( source, getUserFriendlyTestName(
result ), group, rawString );
-
+
reportManager.testStarting( report );
}
public void onTestSuccess( ITestResult result )
{
testStarted = false;
- ReportEntry report =
- new ReportEntry( source, getUserFriendlyTestName( result ),
bundle.getString( "testSuccessful" ) );
+
+ String group = groupString( result.getMethod().getGroups(),
result.getTestClass().getName() );
+ ReportEntry report = new ReportEntry( source, getUserFriendlyTestName(
result ), group, bundle.getString( "testSuccessful" ) );
+
reportManager.testSucceeded( report );
}
@@ -149,7 +145,6 @@
String rawString = bundle.getString( "testSetStarting" );
String group = groupString( context.getIncludedGroups(),
context.getName() );
-
ReportEntry report = new ReportEntry( source, context.getName(),
group, rawString );
try
@@ -165,6 +160,7 @@
public void onFinish( ITestContext context )
{
_finishContext = context;
+ cleanupAfterTestsRun();
}
public void onFinish( ISuite suite )