2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 * ============LICENSE_END=========================================================
25 package org.onap.appc.listener.LCM.impl;
27 import static org.junit.Assert.fail;
29 import java.util.Properties;
30 import org.junit.Before;
31 import org.junit.Ignore;
32 import org.junit.Test;
33 import org.onap.appc.listener.Listener;
34 import org.onap.appc.listener.ListenerProperties;
35 import org.onap.appc.listener.demo.impl.ListenerImpl;
38 public class ListenerImplTest {
40 private static final String PROP_FILE = "/org/onap/appc/default.properties";
42 private Listener listener;
43 private Properties props;
47 props = new Properties();
49 props.load(getClass().getResourceAsStream(PROP_FILE));
50 props.setProperty("topic.read", "DCAE-CLOSED-LOOP-EVENTS-DEV1510SIM");
51 } catch (Exception e) {
53 fail("Failed to setup test: " + e.getMessage());
55 listener = new ListenerImpl(new ListenerProperties("appc.ClosedLoop", props));
59 public void testRun() {
61 Thread t = new Thread(listener);
68 System.out.println(listener.getBenchmark());
70 } catch (Exception e) {
77 public void printSampleData() {
79 props.setProperty("threads.queuesize.min", "1");
80 props.setProperty("threads.queuesize.max", "1");
81 props.setProperty("threads.poolsize.min", "1");
82 props.setProperty("threads.poolsize.max", "1");
84 Thread t = new Thread(listener);
91 System.out.println(listener.getBenchmark());
93 } catch (Exception e) {