2 * Copyright (C) 2014 Cisco Systems, Inc.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 * Authors : Thomas Bachman
11 package org.opendaylight.groupbasedpolicy.renderer.opflex.jsonrpc;
14 import org.junit.Before;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
18 public class RpcServerTest implements ConnectionService, RpcBroker {
19 protected static final Logger logger = LoggerFactory.getLogger(JsonRpcEndpoint.class);
21 private static final String TEST_IP = "127.0.0.1";
22 private static final int TEST_PORT = 53670;
26 public void addConnection(JsonRpcEndpoint endpoint) {
30 public void channelClosed(JsonRpcEndpoint peer) throws Exception {
34 public void publish(JsonRpcEndpoint endpoint, RpcMessage message) {
38 public void subscribe(RpcMessage message, RpcCallback callback) {
42 public void setUp() throws Exception {
44 RpcServer server = new RpcServer(TEST_IP, TEST_PORT);
45 server.setConnectionService(this);
46 server.setRpcBroker(this);
52 public void testStartup() throws Exception {
57 public void testShutdown() throws Exception {