2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.groupbasedpolicy.neutron.vpp.mapper.hostconfigs;
11 import static org.junit.Assert.assertFalse;
12 import static org.junit.Assert.assertTrue;
14 import java.util.concurrent.ExecutionException;
16 import org.junit.After;
17 import org.junit.Before;
18 import org.junit.Test;
19 import org.opendaylight.groupbasedpolicy.neutron.vpp.mapper.SocketInfo;
20 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
21 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
22 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
23 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
25 public class VppNodeListenerTest extends TestResources {
27 private TopologyId topologyId = new TopologyId("topology1");
28 private NodeId nodeId = new NodeId("node1");
29 private InstanceIdentifier<Node> nodeIid = createNodeIid(topologyId, nodeId);
30 private VppNodeListener vppNodeListener;
33 public void init() throws InterruptedException, ExecutionException {
34 String socketPath = "/tmp/";
35 String socketPrefix = "socket_";
37 vppNodeListener = new VppNodeListener(dataBroker, new SocketInfo(socketPath, socketPrefix));
38 writeTopologyNode(topologyId, nodeId);
39 writeRendererNode(createNodeIid(topologyId, nodeId));
43 public void writeDataTest() throws InterruptedException, ExecutionException {
44 assertTrue(readHostconfig(nodeId).isPresent());
48 public void deleteDataTest() throws InterruptedException, ExecutionException {
49 deleteRendererNode(nodeIid);
50 assertFalse(readHostconfig(nodeId).isPresent());
55 vppNodeListener.close();