aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Test cases in Maven build fails though they passed in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Test cases in Maven build fails though they passed in eclipse" Watch "Test cases in Maven build fails though they passed in eclipse" New topic
Author

Test cases in Maven build fails though they passed in eclipse

Vineela Jyothi
Greenhorn

Joined: Jun 02, 2008
Posts: 3
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30309
    
150

It looks like Maven is failing on trying to write the report. Does the directory have write permissions? Does it exist?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Test cases in Maven build fails though they passed in eclipse