From b918b699ad033321d5c94e3a34123ee38b53fc37 Mon Sep 17 00:00:00 2001 From: Jorge Hernandez Date: Wed, 20 Sep 2017 23:12:27 -0500 Subject: pdp-d feature to simulate aai/mso/vfc in lab implemented as an optional loadable feature, this capability enables to bring up simulators used by junits in a pdp-d lab configuration. After lab installation, perform: 1. features enable controlloop-util 2. policy start Now the simulators are opened at ports 6666, 6667, and 6668. netstat output: tcp6 0 0 127.0.0.1:6666 :::* LISTEN 21562/java tcp6 0 0 127.0.0.1:6667 :::* LISTEN 21562/java tcp6 0 0 127.0.0.1:6668 :::* LISTEN 21562/java 21562 is the pdp-d PID in the lab. curl http://localhost:6666/aai/v11/network/generic-vnfs/generic-vnf/vnfIdA { "vnf-id": "5e49ca06-2972-4532-9ed4-6d071588d792", ... } Change-Id: I3f05333ce5549b2274eb967b2b8866189b7f8843 Issue-ID: POLICY-259 Signed-off-by: Jorge Hernandez --- .../feature/utils/ControlLoopUtilsFeatureTest.java | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 controlloop/common/feature-controlloop-utils/src/test/java/org/onap/policy/drools/apps/controlloop/feature/utils/ControlLoopUtilsFeatureTest.java (limited to 'controlloop/common/feature-controlloop-utils/src/test/java') diff --git a/controlloop/common/feature-controlloop-utils/src/test/java/org/onap/policy/drools/apps/controlloop/feature/utils/ControlLoopUtilsFeatureTest.java b/controlloop/common/feature-controlloop-utils/src/test/java/org/onap/policy/drools/apps/controlloop/feature/utils/ControlLoopUtilsFeatureTest.java new file mode 100644 index 000000000..5ba375847 --- /dev/null +++ b/controlloop/common/feature-controlloop-utils/src/test/java/org/onap/policy/drools/apps/controlloop/feature/utils/ControlLoopUtilsFeatureTest.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.policy.drools.apps.controlloop.feature.utils; + +import static org.junit.Assert.assertNotNull; + +import org.junit.Test; +import org.onap.policy.drools.http.server.HttpServletServer; +import org.onap.policy.drools.system.PolicyEngine; +import org.onap.policy.drools.utils.LoggerUtil; +import org.onap.policy.simulators.Util; + +/** + * ControlLoopUtilsFeature JUnit Tests + */ +public class ControlLoopUtilsFeatureTest { + + @Test + public void simulate() { + LoggerUtil.setLevel("ROOT", "INFO"); + LoggerUtil.setLevel("org.eclipse.jetty", "WARN"); + final ControlLoopUtilsFeature feature = new ControlLoopUtilsFeature(); + feature.afterStart(PolicyEngine.manager); + assertNotNull(HttpServletServer.factory.get(Util.AAISIM_SERVER_PORT)); + assertNotNull(HttpServletServer.factory.get(Util.SOSIM_SERVER_PORT)); + assertNotNull(HttpServletServer.factory.get(Util.SOSIM_SERVER_PORT)); + } + +} -- cgit 1.2.3-korg