chalmagr commented on code in PR #516:
URL: https://github.com/apache/maven-surefire/pull/516#discussion_r889474392
##########
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java:
##########
@@ -312,7 +312,7 @@ private void addTestMethodStats()
for ( WrappedReportEntry reportEntry :
detailsForThis.getReportEntries() )
{
TestMethodStats methodStats =
- new TestMethodStats( reportEntry.getClassMethodName(),
reportEntry.getReportEntryType(),
+ new TestMethodStats( reportEntry.getReportClassMethodName(),
reportEntry.getReportEntryType(),
Review Comment:
I may need to dive a bit more and verify, but seems that even though JUnit
is providing the source as you describe we are removing the (source) piece and
splitting it between class and method
org.apache.maven.surefire.common.junit4.JUnit4RunListener#testFailure
```java
...
ClassMethod classMethod = toClassMethod(
failure.getDescription() );
long testRunId = classMethodIndexer.indexClassMethod(
classMethod.getClazz(), classMethod.getMethod() );
ReportEntry report = withException( runMode, testRunId,
classMethod.getClazz(), null,
classMethod.getMethod(), null, stackTrace );
...
```
org.apache.maven.surefire.common.junit4.JUnit4ProviderUtil#toClassMethod
```java
public static ClassMethod toClassMethod( Description description )
{
String clazz = extractClassName( description.getDisplayName() );
...
String method = extractMethodName( description.getDisplayName() );
return new ClassMethod( clazz, method );
}
```
org.apache.maven.surefire.api.util.internal.TestClassMethodNameUtils#extractClassName
```java
public static String extractClassName( String displayName )
{
String clazz = displayName;
if ( displayName.endsWith( ")" ) )
{
int paren = displayName.lastIndexOf( '(' );
if ( paren != -1 )
{
clazz = displayName.substring( paren + 1,
displayName.length() - 1 );
}
}
return clazz;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]