From dda2f96c2e7868f083641e8014f218a1b37f82e7 Mon Sep 17 00:00:00 2001 From: "arkadiusz.adamski" Date: Thu, 22 Apr 2021 12:24:48 +0100 Subject: Code coverage for File Carrier Plugin - Increase code coverage for file carrier plugin in service engine Issue-ID: POLICY-3092 Signed-off-by: arkadiusz.adamski Change-Id: I8c08ee55c9d31792e35a1acc79330c8eef42af56 --- .../model/basicmodel/handling/ApexSchemaGeneratorTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'model/basic-model') diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/ApexSchemaGeneratorTest.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/ApexSchemaGeneratorTest.java index 0b18abcb1..3385830e2 100644 --- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/ApexSchemaGeneratorTest.java +++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/ApexSchemaGeneratorTest.java @@ -28,9 +28,16 @@ import java.io.FileDescriptor; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream; +import org.junit.After; import org.junit.Test; public class ApexSchemaGeneratorTest { + private final PrintStream stdout = System.out; + + @After + public void tearDown() throws Exception { + System.setOut(stdout); + } @Test public void test() throws IOException { @@ -78,12 +85,11 @@ public class ApexSchemaGeneratorTest { System.setOut(new PrintStream(baos5)); final File tempFile = File.createTempFile("ApexSchemaGeneratorTest", "xsd"); + tempFile.deleteOnExit(); final String[] args5 = { "org.onap.policy.apex.model.basicmodel.concepts.AxModel", tempFile.getCanonicalPath() }; ApexSchemaGenerator.main(args5); assertTrue(tempFile.length() > 100); - System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out))); - tempFile.delete(); } } -- cgit 1.2.3-korg