2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2018 Ericsson. All rights reserved.
4 * Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
5 * Modifications Copyright (C) 2020 Nordix Foundation.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 * SPDX-License-Identifier: Apache-2.0
20 * ============LICENSE_END=========================================================
23 package org.onap.policy.apex.domains.onap.vcpe;
25 import static org.awaitility.Awaitility.await;
27 import java.util.concurrent.TimeUnit;
28 import org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain;
29 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
30 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
31 import org.onap.policy.apex.service.engine.main.ApexMain;
34 * Test the ONAP vCPE use case.
36 public class OnapVcpeRunner {
38 private OnapVcpeRunner() throws ApexException {
41 final String[] cliArgs = new String[] {
43 "src/main/resources/policy/ONAPvCPEPolicyModel.apex",
45 "target/ONAPvCPEPolicyModel.log",
47 "src/main/resources/examples/config/ONAPvCPE/ApexConfig_Sim.json",
49 "src/main/resources/tosca/ToscaTemplate.json",
51 "target/classes/ONAPvCPEPolicy.json"
55 new ApexCliToscaEditorMain(cliArgs);
58 final String[] apexArgs = {
62 "target/classes/ONAPvCPEPolicy.json"
66 final ApexMain apexMain = new ApexMain(apexArgs);
68 await().atMost(5000, TimeUnit.MILLISECONDS).until(() -> apexMain.isAlive());
70 // This test should be amended to start and shutdown the simulator as part of the test and not separately as
71 // is done in the gRPC test.
72 ThreadUtilities.sleep(1000000);
76 public static void main(String[] args) throws ApexException {