gdcc / exporter-ro-crate

0 stars 0 forks source link

ROCrateExporterTest.testExportDataset failing #1

Open pdurbin opened 3 months ago

pdurbin commented 3 months ago

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: https://github.com/IQSS/dataverse/pull/10086#issuecomment-2269897752

pdurbin commented 3 months ago

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 commented 3 months ago

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?