2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Copyright (C) 2017 Amdocs
8 * =============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * ============LICENSE_END=========================================================
24 package org.onap.appc.listener.LCM.impl;
26 import static org.junit.Assert.fail;
28 import java.util.Properties;
29 import org.junit.Before;
30 import org.junit.Ignore;
31 import org.junit.Test;
32 import org.onap.appc.listener.Listener;
33 import org.onap.appc.listener.ListenerProperties;
34 import org.onap.appc.listener.demo.impl.ListenerImpl;
37 public class ListenerImplTest {
39 private static final String PROP_FILE = "/org/onap/appc/default.properties";
41 private Listener listener;
42 private Properties props;
46 props = new Properties();
48 props.load(getClass().getResourceAsStream(PROP_FILE));
49 props.setProperty("topic.read", "DCAE-CLOSED-LOOP-EVENTS-DEV1510SIM");
50 } catch (Exception e) {
52 fail("Failed to setup test: " + e.getMessage());
54 listener = new ListenerImpl(new ListenerProperties("appc.ClosedLoop", props));
58 public void testRun() {
60 Thread t = new Thread(listener);
67 System.out.println(listener.getBenchmark());
69 } catch (Exception e) {
76 public void printSampleData() {
78 props.setProperty("threads.queuesize.min", "1");
79 props.setProperty("threads.queuesize.max", "1");
80 props.setProperty("threads.poolsize.min", "1");
81 props.setProperty("threads.poolsize.max", "1");
83 Thread t = new Thread(listener);
90 System.out.println(listener.getBenchmark());
92 } catch (Exception e) {