Skip to content

Commit

Permalink
Correcting test
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Chicoine committed Oct 23, 2023
1 parent 2b4ab88 commit 57e06f8
Showing 1 changed file with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,33 @@ public void run() {
assertEquals(16, files.length);
}

@Test
public void TestExtractMatBundleWithDirectoryAndSubDirectories() throws IOException {
ClassLoader classLoader = getClass().getClassLoader();
String resourcePath = "org/opencds/cqf/tooling/operation/ExtractMatBundle/bundles_mixed/";
URL resourceUrl = classLoader.getResource(resourcePath);
if (resourceUrl == null) {
throw new IllegalArgumentException("Resource not found: " + resourcePath);
}

File emptyDir = tempFolder.newFolder("bundles");
Thread executionThread = new Thread(new Runnable() {
public void run() {
operation.execute(new String[]{"-ExtractMATBundle", resourceUrl.getFile(), "-dir", "-op=" + emptyDir.getAbsolutePath()});
}
});

executionThread.start();
try {
executionThread.join();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
File[] files = emptyDir.listFiles();
assertNotNull(files);
assertTrue(files.length >= 40);
}

@Test
public void TestExtractMatBundleWithDuplicateBundleXmlJson() throws IOException {
ClassLoader classLoader = getClass().getClassLoader();
Expand All @@ -219,6 +246,6 @@ public void run() {
}
File[] files = emptyDir.listFiles();
assertNotNull(files);
assertEquals(11, files.length);
assertEquals(8, files.length);
}
}

0 comments on commit 57e06f8

Please sign in to comment.