CLOSER-Cohorts / Extract2DDI

Tool to extract DDI metadata from SPSS and Stata
Other
1 stars 0 forks source link

More tests; output a potential problematic column; remove 3.3 format as an input parameter #42

Closed alkondrashov closed 7 months ago

alkondrashov commented 7 months ago
  1. Add a test for reading invalid value labels. Here is the output now:
2024-04-09 22:53:17,431 [main] INFO  edu.cornell.ncrn.ced2ar.stata.StataReaderFactory - Stata Data file /Users/kondrashov/Projects/DDI-L-Writer/target/test-classes/test-file-data-types-118-new.dta is not a Format 115.
2024-04-09 22:53:17,432 [main] INFO  edu.cornell.ncrn.ced2ar.stata.StataReaderFactory - Stata Data file /Users/kondrashov/Projects/DDI-L-Writer/target/test-classes/test-file-data-types-118-new.dta is not a Format 114.
2024-04-09 22:53:17,432 [main] INFO  edu.cornell.ncrn.ced2ar.stata.StataReaderFactory - Stata Data file /Users/kondrashov/Projects/DDI-L-Writer/target/test-classes/test-file-data-types-118-new.dta is not a Format 113.
2024-04-09 22:53:17,433 [main] INFO  edu.cornell.ncrn.ced2ar.stata.StataReaderFactory - Stata Data file /Users/kondrashov/Projects/DDI-L-Writer/target/test-classes/test-file-data-types-118-new.dta is not a Format 117

2024-04-09 22:53:17,434 [main] ERROR edu.cornell.ncrn.ced2ar.stata.impl.DtaReader - Error reading Value Labels for variable: TestCodeValue3

java.lang.IllegalArgumentException: 1 > 0

    at java.base/java.util.Arrays.copyOfRange(Arrays.java:3821)
    at edu.cornell.ncrn.ced2ar.stata.impl.DtaReader.readValueLabels(DtaReader.java:437)
    at edu.cornell.ncrn.ced2ar.stata.impl.Dta118Reader.readVariables(Dta118Reader.java:222)
    at edu.cornell.ncrn.ced2ar.stata.impl.Dta117Reader.<init>(Dta117Reader.java:65)
    at edu.cornell.ncrn.ced2ar.stata.impl.Dta118Reader.<init>(Dta118Reader.java:49)
    at edu.cornell.ncrn.ced2ar.stata.StataReaderFactory.getStataReader(StataReaderFactory.java:42)
    at edu.cornell.ncrn.ced2ar.ddigen.csv.StataCsvGenerator.generateVariablesCsv(StataCsvGenerator.java:40)
    at edu.cornell.ncrn.ced2ar.ddigen.DdiLifecycleGenerator.generateVariablesCsv(DdiLifecycleGenerator.java:43)
    at edu.cornell.ncrn.ced2ar.ddigen.GenerateDDI33.generateDDI(GenerateDDI33.java:35)
    at edu.cornell.ncrn.ced2ar.ddigen.Format118Test.testGenerateDdi(Format118Test.java:26)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
    at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
    at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
    at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
    at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
    at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
    at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)
    at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)

Process finished with exit code 255
  1. Add tests for statistics exclusion
  2. Remove 3.3 as an input parameter in preparation for 4 format