Bug 1029: Remove dead code: samples/clustersession
[controller.git] / opendaylight / adsal / containermanager / it.implementation / src / test / java / org / opendaylight / controller / containermanager / internal / ContainerImplTest.java
1 \r
2 /*\r
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
4  *\r
5  * This program and the accompanying materials are made available under the\r
6  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
7  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
8  */\r
9 \r
10 package org.opendaylight.controller.containermanager.internal;\r
11 \r
12 import org.apache.felix.dm.impl.ComponentImpl;\r
13 import org.junit.Test;\r
14 import org.opendaylight.controller.sal.core.Node;\r
15 import org.opendaylight.controller.sal.utils.NodeCreator;\r
16 \r
17 import java.util.Hashtable;\r
18 \r
19 import static junit.framework.Assert.assertNull;\r
20 import static org.junit.Assert.assertEquals;\r
21 \r
22 public class ContainerImplTest {\r
23 \r
24         @Test\r
25         public void test() {\r
26 \r
27                 ContainerImpl container1 = new ContainerImpl();\r
28 \r
29                 //Create Component for init\r
30                 ComponentImpl component1 = new ComponentImpl(null, null, null);\r
31                 component1.setInterface("serviceTestName", null);\r
32 \r
33                 //container1 does not have name yet\r
34                 container1.init(component1);\r
35                 assertNull(container1.getName());\r
36 \r
37                 //Sets container1 name to TestName\r
38                 Hashtable<String, String> properties = new Hashtable<String, String>();\r
39                 properties.put("dummyKey", "dummyValue");\r
40                 properties.put("containerName", "TestName");\r
41                 component1.setInterface("serviceTestName", properties);\r
42 \r
43                 container1.init(component1);\r
44                 assertEquals("TestName", container1.getName());\r
45 \r
46                 //getContainerFlows always returns null for now\r
47                 assertNull(container1.getContainerFlows());\r
48 \r
49                 //getTag always returns 0 for now\r
50                 Node n = NodeCreator.createOFNode(1L);\r
51                 assertEquals(0, container1.getTag(n));\r
52 \r
53                 //getNodeConnectors always returns null for now\r
54                 assertNull(container1.getNodeConnectors());\r
55 \r
56                 //getNodes always returns null for now\r
57                 assertNull(container1.getNodes());\r
58 \r
59         }\r
60 \r
61 }\r