diff options
author | Jim Hahn <jrh3@att.com> | 2020-11-16 16:20:11 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-11-16 16:20:11 +0000 |
commit | e267120c204303088f3c15e580a5e1a364e014f5 (patch) | |
tree | 6dc51f9a39c8c5268507829013ecce071179fea7 /examples/examples-onap-vcpe/src/test | |
parent | 6a84e64998c749182c1a49301a245918724123d9 (diff) | |
parent | da12c1c622ebc2304965ff1f646dc9783c5363c6 (diff) |
Merge "Update vCPE example for JSON Stringify"
Diffstat (limited to 'examples/examples-onap-vcpe/src/test')
4 files changed, 19 insertions, 1 deletions
diff --git a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/OnapVcpeRunner.java b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/OnapVcpeRunner.java index 768f372de..2c2cf5204 100644 --- a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/OnapVcpeRunner.java +++ b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/OnapVcpeRunner.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2020 Bell Canada. All rights reserved. + * Modifications Copyright (C) 2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +22,9 @@ package org.onap.policy.apex.domains.onap.vcpe; +import static org.awaitility.Awaitility.await; + +import java.util.concurrent.TimeUnit; import org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain; import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities; import org.onap.policy.apex.model.basicmodel.concepts.ApexException; @@ -61,6 +65,10 @@ public class OnapVcpeRunner { final ApexMain apexMain = new ApexMain(apexArgs); + await().atMost(5000, TimeUnit.MILLISECONDS).until(() -> apexMain.isAlive()); + + // This test should be amended to start and shutdown the simulator as part of the test and not separately as + // is done in the gRPC test. ThreadUtilities.sleep(1000000); apexMain.shutdown(); } diff --git a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/OnapVcpeStandaloneRunner.java b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/OnapVcpeStandaloneRunner.java index 310c0c08b..61c2df700 100644 --- a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/OnapVcpeStandaloneRunner.java +++ b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/OnapVcpeStandaloneRunner.java @@ -20,6 +20,9 @@ package org.onap.policy.apex.domains.onap.vcpe; +import static org.awaitility.Awaitility.await; + +import java.util.concurrent.TimeUnit; import org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain; import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities; import org.onap.policy.apex.model.basicmodel.concepts.ApexException; @@ -55,6 +58,10 @@ public class OnapVcpeStandaloneRunner { // @formatter:on final ApexMain apexMain = new ApexMain(apexArgs); + await().atMost(5000, TimeUnit.MILLISECONDS).until(() -> apexMain.isAlive()); + + // This test should be amended to start and shutdown the simulator as part of the test and not separately as + // is done in the gRPC test. ThreadUtilities.sleep(1000000); apexMain.shutdown(); } diff --git a/examples/examples-onap-vcpe/src/test/resources/etc/Notes.txt b/examples/examples-onap-vcpe/src/test/resources/etc/Notes.txt index d0a5a698e..aa378af6c 100644 --- a/examples/examples-onap-vcpe/src/test/resources/etc/Notes.txt +++ b/examples/examples-onap-vcpe/src/test/resources/etc/Notes.txt @@ -50,3 +50,6 @@ Run the engine in Docker, running with pasting into console using standard input On an extraction of the Apex tarball, run the Apex client bin/apexApps.sh full-client + +Run standalone version using Maven +mvn exec:java -Dexec.classpathScope="test" -Dexec.mainClass=org.onap.policy.apex.domains.onap.vcpe.OnapVcpeStandaloneRunner diff --git a/examples/examples-onap-vcpe/src/test/resources/logback-test.xml b/examples/examples-onap-vcpe/src/test/resources/logback-test.xml index b3a202ced..e48e25b1e 100644 --- a/examples/examples-onap-vcpe/src/test/resources/logback-test.xml +++ b/examples/examples-onap-vcpe/src/test/resources/logback-test.xml @@ -2,6 +2,7 @@ <!-- ============LICENSE_START======================================================= Copyright (C) 2016-2018 Ericsson. All rights reserved. + Modifications Copyright (C) 2020 Nordix Foundation. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,7 +24,6 @@ <contextName>Apex</contextName> <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> - <property name="LOG_DIR" value="${java.io.tmpdir}/apex_logging/" /> <!-- USE FOR STD OUT ONLY --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |