Bug 1029: Remove dead code: p2site
[controller.git] / opendaylight / web / topology / src / test / java / org / opendaylight / controller / topology / web / TopologyTest.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.controller.topology.web;
10
11 import static org.junit.Assert.assertEquals;
12 import static org.junit.Assert.assertNotNull;
13
14 import org.junit.Test;
15 import org.opendaylight.controller.sal.core.Node;
16 import org.opendaylight.controller.sal.utils.NodeCreator;
17 import org.opendaylight.controller.topology.web.Topology.NodeBean;
18
19 public class TopologyTest {
20
21         @Test
22         public void testCreateNodeBean() {
23                 Topology topology = new Topology();
24                 Node node = NodeCreator.createOFNode(new Long(3));
25                 String description = "foo";
26
27                 NodeBean bean = topology.createNodeBean(description, node);
28
29                 assertNotNull(bean);
30                 assertEquals(bean.id, node.toString());
31                 assertEquals(bean.name, "foo");
32
33                 bean = topology.createNodeBean(null, node);
34
35                 assertNotNull(bean);
36                 assertEquals(bean.id, node.toString());
37                 assertEquals(bean.name, bean.id);
38
39                 bean = topology.createNodeBean("   ", node);
40
41                 assertNotNull(bean);
42                 assertEquals(bean.id, node.toString());
43                 assertEquals(bean.name, bean.id);
44         }
45
46 }