ISSUE: Topology does not show Node description as learned by the OFA
[controller.git] / opendaylight / web / topology / src / test / java / org / opendaylight / controller / topology / web / TopologyTest.java
index 16d1754ce77f4d69eae6f604b1f23c930b6618fe..e26e7c666b1a37a5ad1c3cf524162deb3548753c 100644 (file)
@@ -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;
@@ -15,9 +23,9 @@ public class TopologyTest {
        public void testCreateNodeBean() {
                Topology topology = new Topology();
                Node node = NodeCreator.createOFNode(new Long(3));
-               SwitchConfig mockSwitchConfig = new SwitchConfig(node.getNodeIDString(), "foo", null, null);
+               String description = "foo";
                
-               NodeBean bean = topology.createNodeBean(mockSwitchConfig, node);
+               NodeBean bean = topology.createNodeBean(description, node);
                
                assertNotNull(bean);
                assertEquals(bean.id, node.toString());
@@ -28,6 +36,12 @@ public class TopologyTest {
                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);
        }
 
 }