summaryrefslogtreecommitdiffstats
path: root/services/services-engine/src/test/java
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-01-15 15:54:45 +0000
committerliamfallon <liam.fallon@est.tech>2019-01-15 15:54:45 +0000
commit2d948a9099e2b000cc061fb77dc0502c5d721ac9 (patch)
treea8239885c3b7a8114e2727c42d36a4e88d1b2629 /services/services-engine/src/test/java
parentcd7fbbcec7e864d2bfd33ac32fe046e827d93468 (diff)
Fix crashing unit tests in Apex
Issue-ID: POLICY-1403 Change-Id: Ie9d2cc46f3daf4d6b2eb2774a8be8c35e0c45754 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'services/services-engine/src/test/java')
-rw-r--r--services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexMainTest.java29
1 files changed, 15 insertions, 14 deletions
diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexMainTest.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexMainTest.java
index c6118108f..6ed3c755d 100644
--- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexMainTest.java
+++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexMainTest.java
@@ -48,7 +48,7 @@ public class ApexMainTest {
final String outString = outContent.toString();
System.setOut(stdout);
-
+
assertTrue(outString.contains("Apex configuration file was not specified as an argument"));
}
@@ -57,8 +57,8 @@ public class ApexMainTest {
OutputStream outContent = new ByteArrayOutputStream();
System.setOut(new PrintStream(outContent));
- String[] args = {"-whee"};
-
+ String[] args = { "-whee" };
+
final ApexMain apexMain = new ApexMain(args);
ThreadUtilities.sleep(200);
apexMain.shutdown();
@@ -66,7 +66,7 @@ public class ApexMainTest {
final String outString = outContent.toString();
System.setOut(stdout);
-
+
assertTrue(outString.contains("invalid command line arguments specified : Unrecognized option: -whee"));
}
@@ -75,8 +75,8 @@ public class ApexMainTest {
OutputStream outContent = new ByteArrayOutputStream();
System.setOut(new PrintStream(outContent));
- String[] args = {"-h"};
-
+ String[] args = { "-h" };
+
final ApexMain apexMain = new ApexMain(args);
ThreadUtilities.sleep(200);
apexMain.shutdown();
@@ -93,8 +93,8 @@ public class ApexMainTest {
OutputStream outContent = new ByteArrayOutputStream();
System.setOut(new PrintStream(outContent));
- String[] args = {"-c", "src/test/resources/parameters/badParams.json"};
-
+ String[] args = { "-c", "src/test/resources/parameters/badParams.json" };
+
final ApexMain apexMain = new ApexMain(args);
ThreadUtilities.sleep(200);
apexMain.shutdown();
@@ -111,8 +111,8 @@ public class ApexMainTest {
OutputStream outContent = new ByteArrayOutputStream();
System.setOut(new PrintStream(outContent));
- String[] args = {"-c", "src/test/resources/parameters/correctParams.json"};
-
+ String[] args = { "-c", "src/test/resources/parameters/correctParams.json" };
+
final ApexMain apexMain = new ApexMain(args);
assertEquals("MyApexEngine", apexMain.getParameters().getEngineServiceParameters().getName());
ThreadUtilities.sleep(200);
@@ -126,20 +126,21 @@ public class ApexMainTest {
}
@Test
- public void testjavaProperties() throws ApexException {
+ public void testJavaProperties() throws ApexException {
OutputStream outContent = new ByteArrayOutputStream();
System.setOut(new PrintStream(outContent));
- String[] args = {"-c", "src/test/resources/parameters/correctParamsJavaProperties.json"};
-
+ String[] args = { "-c", "src/test/resources/parameters/correctParamsJavaProperties.json" };
+
final ApexMain apexMain = new ApexMain(args);
assertEquals("MyApexEngine", apexMain.getParameters().getEngineServiceParameters().getName());
-
+
assertEquals("trust-store-file", System.getProperty("javax.net.ssl.trustStore"));
assertEquals("Pol1cy_0nap", System.getProperty("javax.net.ssl.trustStorePassword"));
ThreadUtilities.sleep(200);
apexMain.shutdown();
+ ThreadUtilities.sleep(10000);
final String outString = outContent.toString();
System.setOut(stdout);