This is an experiment to alter the default JUnit behaviour to mimic the behaviour of the Go testing framework, i.e. failed asserts will normally not end the execution of the test case, but instead all failed asserts are reported at the end. The project is inspired by (as well as have inspired) Dan Norths jgotesting that however supports the Go syntax and does not require AspectJ.
Some examples can be found in LazyFailExampleTest
In order to use this addon, you must first add a dependency to your Maven pom.xml
<dependency>
<groupId>se.jiderhamn</groupId>
<artifactId>junit-lazy-fail</artifactId>
<version>0.9.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
In that same POM, you need to configure AspectJ for compiling the tests
<build>
<plugins>
<!-- Compile with AspectJ compiler -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.8</version>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>se.jiderhamn</groupId>
<artifactId>junit-lazy-fail</artifactId>
</aspectLibrary>
</aspectLibraries>
<complianceLevel>1.8</complianceLevel>
<source>1.8</source>
<target>1.8</target>
</configuration>
<executions>
<execution>
<id>test-compile</id>
<configuration>
<skip>${maven.test.skip}</skip>
</configuration>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Last but not least, you need to annotate your test classes with
@RunWith(se.jiderhamn.lazyfail.LazyFailRunner.class)