From 06ef690aa789789c4c3edc18629af1859e659091 Mon Sep 17 00:00:00 2001 From: Philip Durbin Date: Thu, 31 May 2018 13:12:15 -0400 Subject: [PATCH] add tests for Stata 14 files from Brooke #2301 --- .../plugins/dta/DTA118FileReaderTest.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/test/java/edu/harvard/iq/dataverse/ingest/tabulardata/impl/plugins/dta/DTA118FileReaderTest.java b/src/test/java/edu/harvard/iq/dataverse/ingest/tabulardata/impl/plugins/dta/DTA118FileReaderTest.java index adf6902e26f..e4da5632cd4 100644 --- a/src/test/java/edu/harvard/iq/dataverse/ingest/tabulardata/impl/plugins/dta/DTA118FileReaderTest.java +++ b/src/test/java/edu/harvard/iq/dataverse/ingest/tabulardata/impl/plugins/dta/DTA118FileReaderTest.java @@ -58,4 +58,36 @@ public void testStrls() throws Exception { assertEquals(13, result.getDataTable().getDataVariables().size()); } + @Ignore + @Test + public void testBrooke3079508() throws IOException { + // https://dataverse.harvard.edu/file.xhtml?fileId=3079508 Stata 14: Brooke_Ketchley_APSR_replicationII.dta + TabularDataIngest result = instance.read(new BufferedInputStream(new FileInputStream(new File("/tmp/Brooke_Ketchley_APSR_replicationII.dta"))), nullDataFile); + assertEquals("application/x-stata", result.getDataTable().getOriginalFileFormat()); + assertEquals("STATA 14", result.getDataTable().getOriginalFormatVersion()); + assertEquals(2, result.getDataTable().getDataVariables().size()); + DataVariable year = result.getDataTable().getDataVariables().get(0); + assertEquals("year", year.getName()); + assertEquals("year", year.getLabel()); + DataVariable missionaries = result.getDataTable().getDataVariables().get(1); + assertEquals("missionaries", missionaries.getName()); + assertEquals("Number of Church Missionary Society missionaries", missionaries.getLabel()); + } + + @Ignore + @Test + public void testBrooke3079511() throws IOException { + // https://dataverse.harvard.edu/file.xhtml?fileId=3079511 Stata 14: Brooke_Ketchley_APSR_replicationI.dta + TabularDataIngest result = instance.read(new BufferedInputStream(new FileInputStream(new File("/tmp/Brooke_Ketchley_APSR_replicationI.dta"))), nullDataFile); + assertEquals("application/x-stata", result.getDataTable().getOriginalFileFormat()); + assertEquals("STATA 14", result.getDataTable().getOriginalFormatVersion()); + assertEquals(40, result.getDataTable().getDataVariables().size()); + DataVariable muhafatha = result.getDataTable().getDataVariables().get(0); + assertEquals("muhafatha", muhafatha.getName()); + assertEquals("muhafatha", muhafatha.getLabel()); + DataVariable qism = result.getDataTable().getDataVariables().get(1); + assertEquals("qism", qism.getName()); + assertEquals("qism", qism.getLabel()); + } + }