Checkstyle enforcer
[controller.git] / opendaylight / web / topology / src / test / java / org / opendaylight / controller / topology / web / TopologyTest.java
index e41d93deb87229aba7be36f8801a0d7ffeaec7a8..e33af082b6f630b52e8c8bbed5211b5bcb082826 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved. 
+ * 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,
@@ -16,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);
+        }
 
 }