From b31ed6c1c492ce2c5fb1c451c36e0ed9944dc221 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Wed, 19 Sep 2018 16:37:01 +0200 Subject: [PATCH 1/3] Fixes #2940. Upgrading to use JUnit 5 using Jupiter 5.3 Engine combined with JUnit 4.12 Vintage Engine. This allows us to have both versions active in parallel and make the migration easier. Fixed `IngestableDataCheckerTest.testTestSAVformat()` unit test, which was failing with 4.12. This was not an engine fault but a mistake within the test case itself. --- pom.xml | 24 +++++++++++++++++-- .../ingest/IngestableDataCheckerTest.java | 4 ++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 188959f80f5..d636db874e3 100644 --- a/pom.xml +++ b/pom.xml @@ -17,6 +17,11 @@ UTC en US + + 4.12 + 5.3.1 + 5.3.1 + 1.3.1 @@ -66,12 +71,27 @@ passay 1.1.0 + + org.junit.jupiter + junit-jupiter-api + ${junit.jupiter.version} + test + junit junit - 4.8.1 + ${junit.version} test - jar + + + org.junit.jupiter + junit-jupiter-engine + ${junit.jupiter.version} + + + org.junit.vintage + junit-vintage-engine + ${junit.vintage.version} org.glassfish diff --git a/src/test/java/edu/harvard/iq/dataverse/ingest/IngestableDataCheckerTest.java b/src/test/java/edu/harvard/iq/dataverse/ingest/IngestableDataCheckerTest.java index 2c69393963f..ea9e378739b 100644 --- a/src/test/java/edu/harvard/iq/dataverse/ingest/IngestableDataCheckerTest.java +++ b/src/test/java/edu/harvard/iq/dataverse/ingest/IngestableDataCheckerTest.java @@ -165,7 +165,7 @@ public void testTestSAVformat() throws IOException { assertEquals(result, "application/x-spss-sav"); msgt("(2b) File is empty string"); - buff = createTempFileAndGetBuffer("testNotSAV.txt", ""); + buff = createTempFileAndGetBuffer("testNotSAV-empty.txt", ""); instance = new IngestableDataChecker(); result = instance.testSAVformat(buff); @@ -173,7 +173,7 @@ public void testTestSAVformat() throws IOException { assertEquals(result, null); msgt("(2c) File is non-SAV string"); - buff = createTempFileAndGetBuffer("testNotSAV.txt", "i-am-not-a-x-spss-sav-file"); + buff = createTempFileAndGetBuffer("testNotSAV-string.txt", "i-am-not-a-x-spss-sav-file"); instance = new IngestableDataChecker(); result = instance.testSAVformat(buff); msg("result 2c: " + result); From 792dd1c2750f903d4b3d6670a76299c21c9ab711 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Thu, 20 Sep 2018 13:47:09 +0200 Subject: [PATCH 2/3] Hotfixing #5061 that broke coverage reports because of missing '@{argLine}' in surefire plugin argLine option. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d636db874e3..dd7d2653877 100644 --- a/pom.xml +++ b/pom.xml @@ -658,7 +658,7 @@ ${testsToExclude} - -Duser.timezone=${project.timezone} -Dfile.encoding=${project.build.sourceEncoding} -Duser.language=${project.language} -Duser.region=${project.region} + ${argLine} -Duser.timezone=${project.timezone} -Dfile.encoding=${project.build.sourceEncoding} -Duser.language=${project.language} -Duser.region=${project.region} From 82ed295bfb018feef8a4941fd00b8e8b980b2dff Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Thu, 20 Sep 2018 14:07:04 +0200 Subject: [PATCH 3/3] Update Mockito from 1.10 to 2.22 to be up-to-date and enable proper JUnit 5 support. --- pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index dd7d2653877..a809c635e30 100644 --- a/pom.xml +++ b/pom.xml @@ -374,11 +374,12 @@ org.slf4j slf4j-log4j12 1.7.7 - + org.mockito mockito-core - 1.10.19 + 2.22.0 + test