Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROCrateExporterTest.testExportDataset failing #1

Open
pdurbin opened this issue Aug 5, 2024 · 2 comments
Open

ROCrateExporterTest.testExportDataset failing #1

pdurbin opened this issue Aug 5, 2024 · 2 comments

Comments

@pdurbin
Copy link
Member

pdurbin commented Aug 5, 2024

I'm on 2927c37 and there's a test failing:

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running be.libis.rdm.export.ROCrateExporterTest
Test dataset file not found.
[ERROR] Tests run: 6, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.034 s <<< FAILURE! -- in be.libis.rdm.export.ROCrateExporterTest
[ERROR] be.libis.rdm.export.ROCrateExporterTest.testExportDataset -- Time elapsed: 0.015 s <<< ERROR!
io.gdcc.spi.export.ExportException: java.lang.NullPointerException: Cannot invoke "java.io.InputStream.read()" because "this.in" is null
	at be.libis.rdm.export.ROCrate.ROCrateExporter.exportDataset(ROCrateExporter.java:607)
	at be.libis.rdm.export.ROCrateExporterTest.testExportDataset(ROCrateExporterTest.java:124)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   ROCrateExporterTest.testExportDataset:124 » Export java.lang.NullPointerException: Cannot invoke "java.io.InputStream.read()" because "this.in" is null
[INFO] 
[ERROR] Tests run: 6, Failures: 0, Errors: 1, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.632 s
[INFO] Finished at: 2024-08-05T16:58:57-04:00
[INFO] ------------------------------------------------------------------------

For more context, I'm just starting to look at this exporter, as I mentioned here: IQSS/dataverse#10086 (comment)

@pdurbin
Copy link
Member Author

pdurbin commented Aug 6, 2024

Test dataset file not found.

The error above is thrown because this file can't be found: ./src/test/resources/testDataset/datasetJson.json

I'm assume it's related to the NPE. 🤷

@pdurbin
Copy link
Member Author

pdurbin commented Aug 6, 2024

this file can't be found: ./src/test/resources

Ah, that directory is in .gitignore:

% cat .gitignore 
target
src/test/resources
.vscode

Maybe it shouldn't be? 🤔 So the tests can pass?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant