final String outString = outContent.toString();
System.setOut(stdout);
-
+
assertTrue(outString.contains("Apex configuration file was not specified as an argument"));
}
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();
final String outString = outContent.toString();
System.setOut(stdout);
-
+
assertTrue(outString.contains("invalid command line arguments specified : Unrecognized option: -whee"));
}
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();
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();
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);
}
@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);