• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Test cases in Maven build fails though they passed in eclipse

 
Vineela Jyothi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Few of the test cases fail when i run a Maven install/ Maven package showing weird exceptions. But these tests were successful when i run them individually on eclipse.
Below is the error trace for reference -

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.ubs.suezeq.CleanupProcessTest
log4j:WARN No appenders could be found for logger (CleanupProcessTest.java).
log4j:WARN Please initialize the log4j system properly.
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.562 sec
Running com.ubs.suezeq.dao.TradeDaoImplTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.078 sec <<< FAILURE!
Running com.ubs.suezeq.util.FileUtilTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.328 sec
Running com.ubs.test.util.TestConfig
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.015 sec <<< FAILURE!
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.125 sec <<< FAILURE!
Running com.ubs.suezeq.service.DuplicateImportFileHandlerServiceTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.172 sec
org.apache.maven.surefire.booter.SurefireExecutionException: null; nested exception is java.lang.NullPointerException: null
java.lang.NullPointerException
at java.io.Writer.write(Writer.java:157)
at java.io.PrintWriter.newLine(PrintWriter.java:480)
at java.io.PrintWriter.println(PrintWriter.java:629)
at java.io.PrintWriter.println(PrintWriter.java:740)
at org.apache.maven.surefire.report.AbstractFileReporter.testSetStarting(AbstractFileReporter.java:59)
at org.apache.maven.surefire.report.ReporterManager.testSetStarting(ReporterManager.java:219)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)


Please advise
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34870
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like Maven is failing on trying to write the report. Does the directory have write permissions? Does it exist?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic