X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fweb%2Ftopology%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Ftopology%2Fweb%2FTopologyTest.java;h=e33af082b6f630b52e8c8bbed5211b5bcb082826;hb=ff1b4a79cca00743a00c3b0b1100bd0ab2b2fb31;hp=16d1754ce77f4d69eae6f604b1f23c930b6618fe;hpb=29f7cfb54b580928c7feac63abce028a7014b0d5;p=controller.git diff --git a/opendaylight/web/topology/src/test/java/org/opendaylight/controller/topology/web/TopologyTest.java b/opendaylight/web/topology/src/test/java/org/opendaylight/controller/topology/web/TopologyTest.java index 16d1754ce7..e33af082b6 100644 --- a/opendaylight/web/topology/src/test/java/org/opendaylight/controller/topology/web/TopologyTest.java +++ b/opendaylight/web/topology/src/test/java/org/opendaylight/controller/topology/web/TopologyTest.java @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + package org.opendaylight.controller.topology.web; import static org.junit.Assert.assertEquals; @@ -8,26 +16,32 @@ import org.opendaylight.controller.sal.core.Node; import org.opendaylight.controller.sal.utils.NodeCreator; import org.opendaylight.controller.switchmanager.SwitchConfig; import org.opendaylight.controller.topology.web.Topology.NodeBean; - + public class TopologyTest { - @Test - public void testCreateNodeBean() { - Topology topology = new Topology(); - Node node = NodeCreator.createOFNode(new Long(3)); - SwitchConfig mockSwitchConfig = new SwitchConfig(node.getNodeIDString(), "foo", null, null); - - NodeBean bean = topology.createNodeBean(mockSwitchConfig, node); - - assertNotNull(bean); - assertEquals(bean.id, node.toString()); - assertEquals(bean.name, "foo"); - - bean = topology.createNodeBean(null, node); - - assertNotNull(bean); - assertEquals(bean.id, node.toString()); - assertEquals(bean.name, bean.id); - } + @Test + public void testCreateNodeBean() { + Topology topology = new Topology(); + Node node = NodeCreator.createOFNode(new Long(3)); + String description = "foo"; + + NodeBean bean = topology.createNodeBean(description, node); + + assertNotNull(bean); + assertEquals(bean.id, node.toString()); + assertEquals(bean.name, "foo"); + + bean = topology.createNodeBean(null, node); + + assertNotNull(bean); + assertEquals(bean.id, node.toString()); + assertEquals(bean.name, bean.id); + + bean = topology.createNodeBean(" ", node); + + assertNotNull(bean); + assertEquals(bean.id, node.toString()); + assertEquals(bean.name, bean.id); + } }