jonnie
jonnie

Reputation: 12690

how do I set get junit to show correct error or exception stack trace

I have noticed when I run a Junit test using maven on the cli when ever there is an error or exception all I get is

com.x.blah.testmyclass : tried to access method 
org.apache.maven.surefire.report.SimpleReportEntry.<init>
  (Ljava/lang/String;Ljava/lang/String;Lorg/apache/maven/surefire/report/StackTraceWriter;)V from class
 org.apache.maven.surefire.common.junit4.JUnit4RunListener

Is there any way to:

  1. Get it to print out the actual test that caused the failure within the class
  2. Output the original exception that was thrown

I am not very experienced in Maven and have looked around online but can't see anything obvious and have been resorting to logging in my tests when they fail which can be very time consuming

Upvotes: 1

Views: 211

Answers (1)

rafaelim
rafaelim

Reputation: 683

Check your surefire-plugin version!

maven-surefire-plugin 2.10 has this SimpleReportEntry(String, StackTraceWriter) constructor but in version 2.19 doesn't have it.

Upvotes: 1

Related Questions