[ 
https://issues.apache.org/jira/browse/SUREFIRE-1293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15562639#comment-15562639
 ] 

ASF GitHub Bot commented on SUREFIRE-1293:
------------------------------------------

Github user britter commented on a diff in the pull request:

    https://github.com/apache/maven-surefire/pull/127#discussion_r82631034
  
    --- Diff: 
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullStatisticsReporter.java
 ---
    @@ -35,7 +36,7 @@
     
         public NullStatisticsReporter()
         {
    -        super( FileUtils.getTempDirectory() );
    +        super( FileUtils.getFile( FileUtils.getTempDirectory(), 
RandomStringUtils.randomAlphabetic( 24 ) ) );
    --- End diff --
    
    @Tibor17 makes sense. If we change it like this, we don't need the test to 
make sure the null objects can be created. I'll modify the PR to incorporate 
protected default constructors and remove the empty tests.


> Simplify org.apache.maven.plugin.surefire.report.TestSetRunListener by using 
> the null object pattern
> ----------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1293
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1293
>             Project: Maven Surefire
>          Issue Type: Improvement
>          Components: Maven Surefire Plugin
>            Reporter: Benedikt Ritter
>              Labels: github
>             Fix For: 2.19.2
>
>
> The class org.apache.maven.plugin.surefire.report.TestSetRunListener has a 
> lot of checks like this:
> {code:java}
> if( field != null )
> {
>     // do something with field
> }
> {code}
> This can be simplified by providing fallback implementations for the fields 
> being used by TestSetRunListener.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to