From 86f7b9dc356d1339b21018fa6c3462133dada993 Mon Sep 17 00:00:00 2001 From: Jreyno77 Date: Mon, 6 Dec 2021 08:57:01 -0700 Subject: [PATCH 1/2] Move resourceDirectories reset to RefreshTest class Move clearDevicePaths call to RefreshTest class --- src/test/java/org/opencds/cqf/tooling/RefreshTest.java | 3 +++ .../opencds/cqf/tooling/library/LibraryProcessorTest.java | 5 ----- .../org/opencds/cqf/tooling/processor/IGProcessorTest.java | 2 -- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/test/java/org/opencds/cqf/tooling/RefreshTest.java b/src/test/java/org/opencds/cqf/tooling/RefreshTest.java index 3aedb10ff..115d3949f 100644 --- a/src/test/java/org/opencds/cqf/tooling/RefreshTest.java +++ b/src/test/java/org/opencds/cqf/tooling/RefreshTest.java @@ -16,6 +16,7 @@ import java.io.File; import java.io.IOException; import java.net.URL; +import java.util.ArrayList; import com.google.common.base.Strings; @@ -34,6 +35,8 @@ public RefreshTest(FhirContext fhirContext) { @BeforeMethod public void setUp() throws Exception { + IOUtils.resourceDirectories = new ArrayList(); + IOUtils.clearDevicePaths(); if (!Strings.isNullOrEmpty(testName)) { System.out.println("Beginning Test: " + testName); } diff --git a/src/test/java/org/opencds/cqf/tooling/library/LibraryProcessorTest.java b/src/test/java/org/opencds/cqf/tooling/library/LibraryProcessorTest.java index a553f46f8..adc585718 100644 --- a/src/test/java/org/opencds/cqf/tooling/library/LibraryProcessorTest.java +++ b/src/test/java/org/opencds/cqf/tooling/library/LibraryProcessorTest.java @@ -1,10 +1,7 @@ package org.opencds.cqf.tooling.library; -import java.util.ArrayList; - import org.opencds.cqf.tooling.RefreshTest; import org.opencds.cqf.tooling.parameter.RefreshLibraryParameters; -import org.opencds.cqf.tooling.utilities.IOUtils; import org.opencds.cqf.tooling.utilities.IOUtils.Encoding; import org.testng.annotations.BeforeMethod; @@ -16,8 +13,6 @@ public abstract class LibraryProcessorTest extends RefreshTest { // When running mvn package there is some collisions between tests running while trying to delete this directory @BeforeMethod public void setUp() throws Exception { - IOUtils.resourceDirectories = new ArrayList(); - IOUtils.clearDevicePaths(); // File dir = new File("target/refreshLibraries"); // if (dir.exists()) { // FileUtils.deleteDirectory(dir); diff --git a/src/test/java/org/opencds/cqf/tooling/processor/IGProcessorTest.java b/src/test/java/org/opencds/cqf/tooling/processor/IGProcessorTest.java index d937aa5ab..677177600 100644 --- a/src/test/java/org/opencds/cqf/tooling/processor/IGProcessorTest.java +++ b/src/test/java/org/opencds/cqf/tooling/processor/IGProcessorTest.java @@ -59,8 +59,6 @@ public IGProcessorTest() { @BeforeMethod public void setUp() throws Exception { - IOUtils.resourceDirectories = new ArrayList(); - IOUtils.clearDevicePaths(); System.setOut(new PrintStream(this.console)); File dir = new File("target" + separator + "refreshIG"); if (dir.exists()) { From c0093b8b1d825aba58fc43d4fe21f3387db8bb12 Mon Sep 17 00:00:00 2001 From: Jreyno77 Date: Mon, 6 Dec 2021 09:04:17 -0700 Subject: [PATCH 2/2] Add clearPaths to all RefreshTest extensions --- src/test/java/org/opencds/cqf/tooling/RefreshTest.java | 2 -- .../cqf/tooling/library/r4/R4LibraryProcessorTest.java | 4 ++++ .../cqf/tooling/library/stu3/STU3LibraryProcessorTest.java | 4 ++++ .../cqf/tooling/measure/r4/R4MeasureProcessorTest.java | 4 ++++ .../cqf/tooling/measure/r4/RefreshR4MeasureOperationTest.java | 4 ++++ .../tooling/measure/stu3/RefreshStu3MeasureOperationTest.java | 4 ++++ .../org/opencds/cqf/tooling/processor/IGProcessorTest.java | 2 ++ 7 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/opencds/cqf/tooling/RefreshTest.java b/src/test/java/org/opencds/cqf/tooling/RefreshTest.java index 115d3949f..68961808e 100644 --- a/src/test/java/org/opencds/cqf/tooling/RefreshTest.java +++ b/src/test/java/org/opencds/cqf/tooling/RefreshTest.java @@ -35,8 +35,6 @@ public RefreshTest(FhirContext fhirContext) { @BeforeMethod public void setUp() throws Exception { - IOUtils.resourceDirectories = new ArrayList(); - IOUtils.clearDevicePaths(); if (!Strings.isNullOrEmpty(testName)) { System.out.println("Beginning Test: " + testName); } diff --git a/src/test/java/org/opencds/cqf/tooling/library/r4/R4LibraryProcessorTest.java b/src/test/java/org/opencds/cqf/tooling/library/r4/R4LibraryProcessorTest.java index 1b9f94831..a466f63a4 100644 --- a/src/test/java/org/opencds/cqf/tooling/library/r4/R4LibraryProcessorTest.java +++ b/src/test/java/org/opencds/cqf/tooling/library/r4/R4LibraryProcessorTest.java @@ -1,9 +1,11 @@ package org.opencds.cqf.tooling.library.r4; import java.io.File; +import java.util.ArrayList; import org.apache.commons.io.FileUtils; import org.opencds.cqf.tooling.library.LibraryProcessorTest; +import org.opencds.cqf.tooling.utilities.IOUtils; import org.opencds.cqf.tooling.RefreshTest; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -21,6 +23,8 @@ public R4LibraryProcessorTest() { @BeforeMethod public void setUp() throws Exception { + IOUtils.resourceDirectories = new ArrayList(); + IOUtils.clearDevicePaths(); File dir = new File("target" + separator + "refreshLibraries" + separator + "r4"); if (dir.exists()) { FileUtils.deleteDirectory(dir); diff --git a/src/test/java/org/opencds/cqf/tooling/library/stu3/STU3LibraryProcessorTest.java b/src/test/java/org/opencds/cqf/tooling/library/stu3/STU3LibraryProcessorTest.java index 23ab55d56..fd9991b43 100644 --- a/src/test/java/org/opencds/cqf/tooling/library/stu3/STU3LibraryProcessorTest.java +++ b/src/test/java/org/opencds/cqf/tooling/library/stu3/STU3LibraryProcessorTest.java @@ -1,9 +1,11 @@ package org.opencds.cqf.tooling.library.stu3; import java.io.File; +import java.util.ArrayList; import org.apache.commons.io.FileUtils; import org.opencds.cqf.tooling.library.LibraryProcessorTest; +import org.opencds.cqf.tooling.utilities.IOUtils; import org.opencds.cqf.tooling.RefreshTest; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -22,6 +24,8 @@ public STU3LibraryProcessorTest() { @BeforeMethod public void setUp() throws Exception { + IOUtils.resourceDirectories = new ArrayList(); + IOUtils.clearDevicePaths(); File dir = new File("target" + separator + "refreshLibraries" + separator + "stu3"); if (dir.exists()) { FileUtils.deleteDirectory(dir); diff --git a/src/test/java/org/opencds/cqf/tooling/measure/r4/R4MeasureProcessorTest.java b/src/test/java/org/opencds/cqf/tooling/measure/r4/R4MeasureProcessorTest.java index 6c2906f91..e0e1eb4cf 100644 --- a/src/test/java/org/opencds/cqf/tooling/measure/r4/R4MeasureProcessorTest.java +++ b/src/test/java/org/opencds/cqf/tooling/measure/r4/R4MeasureProcessorTest.java @@ -1,9 +1,11 @@ package org.opencds.cqf.tooling.measure.r4; import java.io.File; +import java.util.ArrayList; import org.apache.commons.io.FileUtils; import org.opencds.cqf.tooling.measure.MeasureProcessorTest; +import org.opencds.cqf.tooling.utilities.IOUtils; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -18,6 +20,8 @@ public R4MeasureProcessorTest() { @BeforeMethod public void setUp() throws Exception { + IOUtils.resourceDirectories = new ArrayList(); + IOUtils.clearDevicePaths(); File dir = new File("target" + separator + "refreshMeasures" + separator + "r4"); if (dir.exists()) { FileUtils.deleteDirectory(dir); diff --git a/src/test/java/org/opencds/cqf/tooling/measure/r4/RefreshR4MeasureOperationTest.java b/src/test/java/org/opencds/cqf/tooling/measure/r4/RefreshR4MeasureOperationTest.java index 9bab34b06..20444679e 100644 --- a/src/test/java/org/opencds/cqf/tooling/measure/r4/RefreshR4MeasureOperationTest.java +++ b/src/test/java/org/opencds/cqf/tooling/measure/r4/RefreshR4MeasureOperationTest.java @@ -1,9 +1,11 @@ package org.opencds.cqf.tooling.measure.r4; import java.io.File; +import java.util.ArrayList; import org.apache.commons.io.FileUtils; import org.opencds.cqf.tooling.RefreshTest; +import org.opencds.cqf.tooling.utilities.IOUtils; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -21,6 +23,8 @@ public RefreshR4MeasureOperationTest() { @BeforeMethod public void setUp() throws Exception { + IOUtils.resourceDirectories = new ArrayList(); + IOUtils.clearDevicePaths(); File dir = new File("target" + separator + "refreshMeasures" + separator + "r4"); if (dir.exists()) { FileUtils.deleteDirectory(dir); diff --git a/src/test/java/org/opencds/cqf/tooling/measure/stu3/RefreshStu3MeasureOperationTest.java b/src/test/java/org/opencds/cqf/tooling/measure/stu3/RefreshStu3MeasureOperationTest.java index b74c89e4f..44d8e49c0 100644 --- a/src/test/java/org/opencds/cqf/tooling/measure/stu3/RefreshStu3MeasureOperationTest.java +++ b/src/test/java/org/opencds/cqf/tooling/measure/stu3/RefreshStu3MeasureOperationTest.java @@ -1,9 +1,11 @@ package org.opencds.cqf.tooling.measure.stu3; import java.io.File; +import java.util.ArrayList; import org.apache.commons.io.FileUtils; import org.opencds.cqf.tooling.RefreshTest; +import org.opencds.cqf.tooling.utilities.IOUtils; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -21,6 +23,8 @@ public RefreshStu3MeasureOperationTest() { @BeforeMethod public void setUp() throws Exception { + IOUtils.resourceDirectories = new ArrayList(); + IOUtils.clearDevicePaths(); File dir = new File("target" + separator + "refreshMeasures" + separator + "stu3"); if (dir.exists()) { FileUtils.deleteDirectory(dir); diff --git a/src/test/java/org/opencds/cqf/tooling/processor/IGProcessorTest.java b/src/test/java/org/opencds/cqf/tooling/processor/IGProcessorTest.java index 677177600..d937aa5ab 100644 --- a/src/test/java/org/opencds/cqf/tooling/processor/IGProcessorTest.java +++ b/src/test/java/org/opencds/cqf/tooling/processor/IGProcessorTest.java @@ -59,6 +59,8 @@ public IGProcessorTest() { @BeforeMethod public void setUp() throws Exception { + IOUtils.resourceDirectories = new ArrayList(); + IOUtils.clearDevicePaths(); System.setOut(new PrintStream(this.console)); File dir = new File("target" + separator + "refreshIG"); if (dir.exists()) {