Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1293

Simplify org.apache.maven.plugin.surefire.report.TestSetRunListener by using the null object pattern

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.20
    • Component/s: Maven Surefire Plugin
    • Labels:

      Description

      The class org.apache.maven.plugin.surefire.report.TestSetRunListener has a lot of checks like this:

      if( field != null )
      {
          // do something with field
      }
      

      This can be simplified by providing fallback implementations for the fields being used by TestSetRunListener.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/maven-surefire/pull/127#discussion_r82527079

          — Diff: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java —
          @@ -76,7 +76,7 @@ public TestSetRunListener( ConsoleReporter consoleReporter, FileReporter fileRep
          StatisticsReporter statisticsReporter, boolean trimStackTrace,
          boolean isPlainFormat, boolean briefOrPlainFormat )
          {

          • this.consoleReporter = consoleReporter;
            + this.consoleReporter = consoleReporter != null ? consoleReporter : new NullConsoleReporter();
              • End diff –

          All of these classes are in `surefire-common` project. Therefor it would be nice not to create a new object
          `new NullConsoleReporter()` but instead keep it as static final constant in abstract Factory in surefire-common.
          This would mean that such null-check may be embedded in the factory, e.g. `buildConsoleReporter()`. I would say that the caller should pass non-null consistent object into this class `TestSetRunListener` via constructor and the called class should not make any guess about it (means if == null => guess hide the error). If we accepted such paradigm then all such occurrences in this PR would have to change it.

          Show
          githubbot ASF GitHub Bot added a comment - Github user Tibor17 commented on a diff in the pull request: https://github.com/apache/maven-surefire/pull/127#discussion_r82527079 — Diff: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java — @@ -76,7 +76,7 @@ public TestSetRunListener( ConsoleReporter consoleReporter, FileReporter fileRep StatisticsReporter statisticsReporter, boolean trimStackTrace, boolean isPlainFormat, boolean briefOrPlainFormat ) { this.consoleReporter = consoleReporter; + this.consoleReporter = consoleReporter != null ? consoleReporter : new NullConsoleReporter(); End diff – All of these classes are in `surefire-common` project. Therefor it would be nice not to create a new object `new NullConsoleReporter()` but instead keep it as static final constant in abstract Factory in surefire-common. This would mean that such null-check may be embedded in the factory, e.g. `buildConsoleReporter()`. I would say that the caller should pass non-null consistent object into this class `TestSetRunListener` via constructor and the called class should not make any guess about it (means if == null => guess hide the error). If we accepted such paradigm then all such occurrences in this PR would have to change it.
          Hide
          githubbot ASF GitHub Bot added a comment -

          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.

          Show
          githubbot ASF GitHub Bot added a comment - 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.
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/maven-surefire/pull/127#discussion_r82631691

          — Diff: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java —
          @@ -76,7 +76,7 @@ public TestSetRunListener( ConsoleReporter consoleReporter, FileReporter fileRep
          StatisticsReporter statisticsReporter, boolean trimStackTrace,
          boolean isPlainFormat, boolean briefOrPlainFormat )
          {

          • this.consoleReporter = consoleReporter;
            + this.consoleReporter = consoleReporter != null ? consoleReporter : new NullConsoleReporter();
              • End diff –

          > All of these classes are in surefire-common project. Therefore it would be nice not to create a new object new NullConsoleReporter() but instead keep it as static final constant in abstract Factory in surefire-common.

          Agreed, I can change this.

          > I would say that the caller should pass non-null consistent object into this class TestSetRunListener via constructor

          Yes it would certainly be better to enforce this kinds of invariants. We can do it like this, but then the constructor of `TestSetRunListener` has to check for null parameters and throw an exception if null is passed.

          > If we accepted such paradigm then all such occurrences in this PR would have to change it.

          I don't understand. Change the whole surefire code base for all occurrences of this pattern?

          Show
          githubbot ASF GitHub Bot added a comment - Github user britter commented on a diff in the pull request: https://github.com/apache/maven-surefire/pull/127#discussion_r82631691 — Diff: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java — @@ -76,7 +76,7 @@ public TestSetRunListener( ConsoleReporter consoleReporter, FileReporter fileRep StatisticsReporter statisticsReporter, boolean trimStackTrace, boolean isPlainFormat, boolean briefOrPlainFormat ) { this.consoleReporter = consoleReporter; + this.consoleReporter = consoleReporter != null ? consoleReporter : new NullConsoleReporter(); End diff – > All of these classes are in surefire-common project. Therefore it would be nice not to create a new object new NullConsoleReporter() but instead keep it as static final constant in abstract Factory in surefire-common. Agreed, I can change this. > I would say that the caller should pass non-null consistent object into this class TestSetRunListener via constructor Yes it would certainly be better to enforce this kinds of invariants. We can do it like this, but then the constructor of `TestSetRunListener` has to check for null parameters and throw an exception if null is passed. > If we accepted such paradigm then all such occurrences in this PR would have to change it. I don't understand. Change the whole surefire code base for all occurrences of this pattern?
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/maven-surefire/pull/127#discussion_r82699403

          — Diff: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleOutputReceiver.java —
          @@ -31,7 +31,13 @@
          implements TestcycleConsoleOutputReceiver
          {

          • public void testSetStarting( ReportEntry reportEntry )
            + static final NullConsoleOutputReceiver INSTANCE = new NullConsoleOutputReceiver();
            +
            + private NullConsoleOutputReceiver()
            + { + }

            +
            + public void testSetStarting(ReportEntry reportEntry )

              • End diff –

          here is checkstyle error

          Show
          githubbot ASF GitHub Bot added a comment - Github user Tibor17 commented on a diff in the pull request: https://github.com/apache/maven-surefire/pull/127#discussion_r82699403 — Diff: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleOutputReceiver.java — @@ -31,7 +31,13 @@ implements TestcycleConsoleOutputReceiver { public void testSetStarting( ReportEntry reportEntry ) + static final NullConsoleOutputReceiver INSTANCE = new NullConsoleOutputReceiver(); + + private NullConsoleOutputReceiver() + { + } + + public void testSetStarting(ReportEntry reportEntry ) End diff – here is checkstyle error
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/maven-surefire/pull/127#discussion_r82699554

          — Diff: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleReporter.java —
          @@ -33,7 +33,10 @@
          class NullConsoleReporter
          extends ConsoleReporter
          {

          • NullConsoleReporter() {
            +
            + static final NullConsoleReporter INSTANCE = new NullConsoleReporter();
            +
            + private NullConsoleReporter() {
              • End diff –

          here as well
          pls run the build. it explores checkstyle erros.
          Did you get your IntelliJ Idea now working with our Maven checkstyle?

          Show
          githubbot ASF GitHub Bot added a comment - Github user Tibor17 commented on a diff in the pull request: https://github.com/apache/maven-surefire/pull/127#discussion_r82699554 — Diff: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleReporter.java — @@ -33,7 +33,10 @@ class NullConsoleReporter extends ConsoleReporter { NullConsoleReporter() { + + static final NullConsoleReporter INSTANCE = new NullConsoleReporter(); + + private NullConsoleReporter() { End diff – here as well pls run the build. it explores checkstyle erros. Did you get your IntelliJ Idea now working with our Maven checkstyle?
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/maven-surefire/pull/127#discussion_r82699845

          — Diff: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java —
          @@ -76,7 +76,7 @@ public TestSetRunListener( ConsoleReporter consoleReporter, FileReporter fileRep
          StatisticsReporter statisticsReporter, boolean trimStackTrace,
          boolean isPlainFormat, boolean briefOrPlainFormat )
          {

          • this.consoleReporter = consoleReporter;
            + this.consoleReporter = consoleReporter != null ? consoleReporter : new NullConsoleReporter();
              • End diff –

          no no, I meant only the scope of this PR. Not whole Surefire of course.

          Show
          githubbot ASF GitHub Bot added a comment - Github user Tibor17 commented on a diff in the pull request: https://github.com/apache/maven-surefire/pull/127#discussion_r82699845 — Diff: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java — @@ -76,7 +76,7 @@ public TestSetRunListener( ConsoleReporter consoleReporter, FileReporter fileRep StatisticsReporter statisticsReporter, boolean trimStackTrace, boolean isPlainFormat, boolean briefOrPlainFormat ) { this.consoleReporter = consoleReporter; + this.consoleReporter = consoleReporter != null ? consoleReporter : new NullConsoleReporter(); End diff – no no, I meant only the scope of this PR. Not whole Surefire of course.
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/maven-surefire/pull/127#discussion_r82700832

          — Diff: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java —
          @@ -76,7 +76,7 @@ public TestSetRunListener( ConsoleReporter consoleReporter, FileReporter fileRep
          StatisticsReporter statisticsReporter, boolean trimStackTrace,
          boolean isPlainFormat, boolean briefOrPlainFormat )
          {

          • this.consoleReporter = consoleReporter;
            + this.consoleReporter = consoleReporter != null ? consoleReporter : new NullConsoleReporter();
              • End diff –

          @britter
          >>does this belong into DefaultReporterFactory.createReporter()
          If you mean this code:
          `ConsoleReporter consoleReporter = shouldReportToConsole() ? new ConsoleReporter( consoleLogger ) : null;`

          Then I would keep the responsibility of creating anew reporter yet in the method `createReporter()`. I am going to fix a bug exactly in this part of code after you. We can still improve the code by small incremental changes.

          Show
          githubbot ASF GitHub Bot added a comment - Github user Tibor17 commented on a diff in the pull request: https://github.com/apache/maven-surefire/pull/127#discussion_r82700832 — Diff: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java — @@ -76,7 +76,7 @@ public TestSetRunListener( ConsoleReporter consoleReporter, FileReporter fileRep StatisticsReporter statisticsReporter, boolean trimStackTrace, boolean isPlainFormat, boolean briefOrPlainFormat ) { this.consoleReporter = consoleReporter; + this.consoleReporter = consoleReporter != null ? consoleReporter : new NullConsoleReporter(); End diff – @britter >>does this belong into DefaultReporterFactory.createReporter() If you mean this code: `ConsoleReporter consoleReporter = shouldReportToConsole() ? new ConsoleReporter( consoleLogger ) : null;` Then I would keep the responsibility of creating anew reporter yet in the method `createReporter()`. I am going to fix a bug exactly in this part of code after you. We can still improve the code by small incremental changes.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user Tibor17 commented on the issue:

          https://github.com/apache/maven-surefire/pull/127

          After we are done with all commits, would you be able to safely squash them in one single commit?

          Show
          githubbot ASF GitHub Bot added a comment - Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/127 After we are done with all commits, would you be able to safely squash them in one single commit?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user britter commented on the issue:

          https://github.com/apache/maven-surefire/pull/127

          Hello @Tibor17, I'll fix the checkstyle violations and squash everything into one single commit!

          Show
          githubbot ASF GitHub Bot added a comment - Github user britter commented on the issue: https://github.com/apache/maven-surefire/pull/127 Hello @Tibor17, I'll fix the checkstyle violations and squash everything into one single commit!
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user britter commented on the issue:

          https://github.com/apache/maven-surefire/pull/127

          @Tibor17 fixed checkstyle issues, moved creation of null objects to DefaultRepoterFactory and squasched everything into one commit. Hope you like it!

          Show
          githubbot ASF GitHub Bot added a comment - Github user britter commented on the issue: https://github.com/apache/maven-surefire/pull/127 @Tibor17 fixed checkstyle issues, moved creation of null objects to DefaultRepoterFactory and squasched everything into one commit. Hope you like it!
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user Tibor17 commented on the issue:

          https://github.com/apache/maven-surefire/pull/127

          @britter
          Done

          Show
          githubbot ASF GitHub Bot added a comment - Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/127 @britter Done
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user britter closed the pull request at:

          https://github.com/apache/maven-surefire/pull/127

          Show
          githubbot ASF GitHub Bot added a comment - Github user britter closed the pull request at: https://github.com/apache/maven-surefire/pull/127
          Hide
          hudson Hudson added a comment -

          UNSTABLE: Integrated in Jenkins build maven-surefire #1638 (See https://builds.apache.org/job/maven-surefire/1638/)
          SUREFIRE-1293 Simplify (tibor17: rev fd9f6e5598e7ce6cdb4168ce15cf6ca138b7753f)

          • (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullStatelessXmlReporter.java
          • (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleReporter.java
          • (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/runorder/StatisticsReporter.java
          • (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java
          • (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullFileReporter.java
          • (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleOutputReceiver.java
          • (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullStatisticsReporter.java
          • (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java
          Show
          hudson Hudson added a comment - UNSTABLE: Integrated in Jenkins build maven-surefire #1638 (See https://builds.apache.org/job/maven-surefire/1638/ ) SUREFIRE-1293 Simplify (tibor17: rev fd9f6e5598e7ce6cdb4168ce15cf6ca138b7753f) (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullStatelessXmlReporter.java (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleReporter.java (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/runorder/StatisticsReporter.java (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullFileReporter.java (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleOutputReceiver.java (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullStatisticsReporter.java (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user Tibor17 commented on the issue:

          https://github.com/apache/maven-surefire/pull/127

          @britter
          The build failed [1]. Did you run a local build on your side?
          [1] https://builds.apache.org/job/maven-surefire/1638/console

          Show
          githubbot ASF GitHub Bot added a comment - Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/127 @britter The build failed [1] . Did you run a local build on your side? [1] https://builds.apache.org/job/maven-surefire/1638/console
          Hide
          tibor17 Tibor Digana added a comment -

          commit fd9f6e5598e7ce6cdb4168ce15cf6ca138b7753f

          Show
          tibor17 Tibor Digana added a comment - commit fd9f6e5598e7ce6cdb4168ce15cf6ca138b7753f
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user Tibor17 commented on the issue:

          https://github.com/apache/maven-surefire/pull/127

          @britter
          It seems you forgot to add `ASF commons` dependency.

          Show
          githubbot ASF GitHub Bot added a comment - Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/127 @britter It seems you forgot to add `ASF commons` dependency.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user britter commented on the issue:

          https://github.com/apache/maven-surefire/pull/127

          @Tibor17 I don't understand. `mvn clean compile` works. Why does this fail on Jenkins?

          Show
          githubbot ASF GitHub Bot added a comment - Github user britter commented on the issue: https://github.com/apache/maven-surefire/pull/127 @Tibor17 I don't understand. `mvn clean compile` works. Why does this fail on Jenkins?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user Tibor17 commented on the issue:

          https://github.com/apache/maven-surefire/pull/127

          Try to clone Surefire master and just run "mvn test"

          Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang3/ObjectUtils
          at org.apache.maven.plugin.surefire.report.DefaultReporterFactory.createFileReporter(DefaultReporterFactory.java:111)
          at org.apache.maven.plugin.surefire.report.DefaultReporterFactory.createReporter(DefaultReporterFactory.java:92)
          at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:102)

          On Wed, Oct 12, 2016 at 2:57 PM, Benedikt Ritter <notifications@github.com>
          wrote:

          > @Tibor17 <https://github.com/Tibor17> I don't understand. mvn clean
          > compile works. Why does this fail on Jenkins?
          >
          > —
          > You are receiving this because you were mentioned.
          > Reply to this email directly, view it on GitHub
          > <https://github.com/apache/maven-surefire/pull/127#issuecomment-253205875>,
          > or mute the thread
          > <https://github.com/notifications/unsubscribe-auth/AA_yR1I15EmeNcuXoehEwBCwAB3Al1vwks5qzNk6gaJpZM4KSBgs>
          > .
          >


          Cheers
          Tibor

          Show
          githubbot ASF GitHub Bot added a comment - Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/127 Try to clone Surefire master and just run "mvn test" Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang3/ObjectUtils at org.apache.maven.plugin.surefire.report.DefaultReporterFactory.createFileReporter(DefaultReporterFactory.java:111) at org.apache.maven.plugin.surefire.report.DefaultReporterFactory.createReporter(DefaultReporterFactory.java:92) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:102) On Wed, Oct 12, 2016 at 2:57 PM, Benedikt Ritter <notifications@github.com> wrote: > @Tibor17 < https://github.com/Tibor17 > I don't understand. mvn clean > compile works. Why does this fail on Jenkins? > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > < https://github.com/apache/maven-surefire/pull/127#issuecomment-253205875 >, > or mute the thread > < https://github.com/notifications/unsubscribe-auth/AA_yR1I15EmeNcuXoehEwBCwAB3Al1vwks5qzNk6gaJpZM4KSBgs > > . > – Cheers Tibor
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user Tibor17 commented on the issue:

          https://github.com/apache/maven-surefire/pull/127

          @britter
          After using one integration tests only
          `<include>org/apache/**/JUnit47ParallelIT.java</include>`
          I got same errors as in Jenkins.
          I think the dependency `commons-lang3` is not propagated to the forked jvm. Maybe somewhere some scope but not in our code.
          If you run the test and go to `target/surefire` you will see a jar file. Download it and lookup `commons` in manifest.

          Show
          githubbot ASF GitHub Bot added a comment - Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/127 @britter After using one integration tests only `<include>org/apache/**/JUnit47ParallelIT.java</include>` I got same errors as in Jenkins. I think the dependency `commons-lang3` is not propagated to the forked jvm. Maybe somewhere some scope but not in our code. If you run the test and go to `target/surefire` you will see a jar file. Download it and lookup `commons` in manifest.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user Tibor17 commented on the issue:

          https://github.com/apache/maven-surefire/pull/127

          I fixed this issue where I removed [1]. The reason behind is the `IsolatedClassLoader` in plugin process which did not have shaded `commons-lang3` in original jar file of `surefire-common`. Because of one method in `commons-lang3` we should not pass such a big library. Instead I created `ObjectUtils` which has only few method and most of them is already in Java 7 utility class `java.util.Objects`. In Surefire on the top of Java 7 I will delete them and use Java 7 facilities.
          [1] import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;

          Show
          githubbot ASF GitHub Bot added a comment - Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/127 I fixed this issue where I removed [1] . The reason behind is the `IsolatedClassLoader` in plugin process which did not have shaded `commons-lang3` in original jar file of `surefire-common`. Because of one method in `commons-lang3` we should not pass such a big library. Instead I created `ObjectUtils` which has only few method and most of them is already in Java 7 utility class `java.util.Objects`. In Surefire on the top of Java 7 I will delete them and use Java 7 facilities. [1] import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
          Hide
          tibor17 Tibor Digana added a comment -

          commit 5e9f5637cead161f5e210b86febcc23d502d3f67

          Show
          tibor17 Tibor Digana added a comment - commit 5e9f5637cead161f5e210b86febcc23d502d3f67
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user britter commented on the issue:

          https://github.com/apache/maven-surefire/pull/127

          > I fixed this issue where I removed [1]

          Thank you!

          > Because of one method in commons-lang3 we should not pass such a big library.

          ACK

          > Instead I created ObjectUtils which has only few method and most of them is already in Java 7 utility class java.util.Objects. In Surefire on the top of Java 7 I will delete them and use Java 7 facilities.

          Good Idea! Sorry for causing the problems.

          Show
          githubbot ASF GitHub Bot added a comment - Github user britter commented on the issue: https://github.com/apache/maven-surefire/pull/127 > I fixed this issue where I removed [1] Thank you! > Because of one method in commons-lang3 we should not pass such a big library. ACK > Instead I created ObjectUtils which has only few method and most of them is already in Java 7 utility class java.util.Objects. In Surefire on the top of Java 7 I will delete them and use Java 7 facilities. Good Idea! Sorry for causing the problems.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user Tibor17 commented on the issue:

          https://github.com/apache/maven-surefire/pull/127

          @britter No big problem. Can you always run build locally? AFAIK your PC is running the build two hours. Normally 45 minutes in Jenkins and my PC Intel i7 4Core 3GHz SSD disk.

          Show
          githubbot ASF GitHub Bot added a comment - Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/127 @britter No big problem. Can you always run build locally? AFAIK your PC is running the build two hours. Normally 45 minutes in Jenkins and my PC Intel i7 4Core 3GHz SSD disk.
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build maven-surefire-junit5 #8 (See https://builds.apache.org/job/maven-surefire-junit5/8/)
          SUREFIRE-1293 Simplify (tibor17: rev fd9f6e5598e7ce6cdb4168ce15cf6ca138b7753f)

          • (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleOutputReceiver.java
          • (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleReporter.java
          • (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullStatelessXmlReporter.java
          • (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java
          • (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullStatisticsReporter.java
          • (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java
          • (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullFileReporter.java
          • (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/runorder/StatisticsReporter.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build maven-surefire-junit5 #8 (See https://builds.apache.org/job/maven-surefire-junit5/8/ ) SUREFIRE-1293 Simplify (tibor17: rev fd9f6e5598e7ce6cdb4168ce15cf6ca138b7753f) (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleOutputReceiver.java (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleReporter.java (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullStatelessXmlReporter.java (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullStatisticsReporter.java (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java (add) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullFileReporter.java (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/runorder/StatisticsReporter.java

            People

            • Assignee:
              tibor17 Tibor Digana
              Reporter:
              britter Benedikt Ritter
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development