portfolio-performance / portfolio

Track and evaluate the performance of your investment portfolio across stocks, cryptocurrencies, and other assets.
http://www.portfolio-performance.info
Eclipse Public License 1.0
2.87k stars 592 forks source link

Test fails on maven build with version 0.44.0 #1363

Closed l-ray closed 4 years ago

l-ray commented 4 years ago

When building the project using maven, I get the following failing unit test

Tests run: 23, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.09 s <<< FAILURE! - in name.abuchen.portfolio.datatransfer.pdf.comdirect.ComdirectPDFExtractorTest
testWertpapierVerkauf2(name.abuchen.portfolio.datatransfer.pdf.comdirect.ComdirectPDFExtractorTest)  Time elapsed: 0.019 s
testWertpapierVerkauf3(name.abuchen.portfolio.datatransfer.pdf.comdirect.ComdirectPDFExtractorTest)  Time elapsed: 0.002 s
testWertpapierKauf(name.abuchen.portfolio.datatransfer.pdf.comdirect.ComdirectPDFExtractorTest)  Time elapsed: 0.005 s
testDividende3withTax(name.abuchen.portfolio.datatransfer.pdf.comdirect.ComdirectPDFExtractorTest)  Time elapsed: 0.008 s
testVorabsteuerpauschale(name.abuchen.portfolio.datatransfer.pdf.comdirect.ComdirectPDFExtractorTest)  Time elapsed: 0.003 s
testWertpapierVerkauf(name.abuchen.portfolio.datatransfer.pdf.comdirect.ComdirectPDFExtractorTest)  Time elapsed: 0.003 s
testInvestmentAusschuettung01(name.abuchen.portfolio.datatransfer.pdf.comdirect.ComdirectPDFExtractorTest)  Time elapsed: 0.004 s  <<< ERROR!
java.lang.NullPointerException: source
    at java.util.Objects.requireNonNull(Objects.java:228)
    at java.util.Scanner.<init>(Scanner.java:578)
    at name.abuchen.portfolio.datatransfer.pdf.PDFInputFile.loadTestCase(PDFInputFile.java:41)
    at name.abuchen.portfolio.datatransfer.pdf.comdirect.ComdirectPDFExtractorTest.testInvestmentAusschuettung01(ComdirectPDFExtractorTest.java:823)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:206)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:161)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:84)
    at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:113)
    at org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(HeadlessTestApplication.java:21)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:590)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:201)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:391)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:246)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1501)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1474)

testDividende1(name.abuchen.portfolio.datatransfer.pdf.comdirect.ComdirectPDFExtractorTest)  Time elapsed: 0.001 s

The full log is available at https://copr-be.cloud.fedoraproject.org/results/lray/PortfolioPerformance/fedora-31-x86_64/01169653-portfolio-performance/builder-live.log.gz

buchen commented 4 years ago

Interesting. My local build passed, the Travis build passed: https://travis-ci.org/buchen/portfolio/builds/639647604?utm_medium=notification&utm_source=email

It fails when loading this file: https://github.com/buchen/portfolio/blob/master/name.abuchen.portfolio.tests/src/name/abuchen/portfolio/datatransfer/pdf/comdirect/comdirectInvestmentAusschüttung01.txt

Are you running the build with UTF-8?

I will fix the file name. The umlaut is ugly.

l-ray commented 4 years ago

Fair point, actually am not sure what encoding is used on the fedora copr build. The build spec itself is at https://copr-be.cloud.fedoraproject.org/results/lray/PortfolioPerformance/fedora-31-x86_64/01169653-portfolio-performance/PortfolioPerformance.spec In the end, renaming the loading file already does the trick. :-)