1 package org.opendaylight.controller.topology.web;
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertNotNull;
7 import org.opendaylight.controller.sal.core.Node;
8 import org.opendaylight.controller.sal.utils.NodeCreator;
9 import org.opendaylight.controller.switchmanager.SwitchConfig;
10 import org.opendaylight.controller.topology.web.Topology.NodeBean;
12 public class TopologyTest {
15 public void testCreateNodeBean() {
16 Topology topology = new Topology();
17 Node node = NodeCreator.createOFNode(new Long(3));
18 SwitchConfig mockSwitchConfig = new SwitchConfig(node.getNodeIDString(), "foo", null, null);
20 NodeBean bean = topology.createNodeBean(mockSwitchConfig, node);
23 assertEquals(bean.id, node.toString());
24 assertEquals(bean.name, "foo");
26 bean = topology.createNodeBean(null, node);
29 assertEquals(bean.id, node.toString());
30 assertEquals(bean.name, bean.id);