Add renderer test files
[nemo.git] / nemo-renderers / openflow-renderer / src / test / java / org.opendaylight / nemo.renderer.openflow / entity / LinkBeanTest.java
1 package org.opendaylight.nemo.renderer.openflow.entity;
2
3 import junit.framework.TestCase;
4 import org.junit.Before;
5 import org.junit.Test;
6 import org.junit.*;
7 import java.util.LinkedList;
8 import org.opendaylight.nemo.renderer.openflow.entity.LinkBean;
9 import static org.mockito.Mockito.*;
10
11 import static org.junit.Assert.*;
12
13 /**
14  * Created by zhangmeng on 2015/11/8.
15  */
16 public class LinkBeanTest extends TestCase {
17     private LinkBean linkBean;
18
19     private String linkID;
20     private String leftNodeID;
21     private String leftPortID;
22     private String rightPortID;
23     private String rightNodeID;
24     private String linkBandwidth;
25
26     @Before
27     public void setUp() throws Exception {
28         linkBean = new LinkBean();
29         linkID = leftNodeID = leftPortID = rightPortID = rightNodeID = linkBandwidth = null;
30     }
31
32     @Test
33     public void testGetLinkID() throws Exception {
34         Assert.assertNull(linkBean.getLinkID());
35         linkID = "test";
36         linkBean.setLinkID(linkID);
37         Assert.assertEquals(linkID,linkBean.getLinkID());
38         linkID = null;
39     }
40
41     @Test
42     public void testSetLinkID() throws Exception {
43         Assert.assertNull(linkBean.getLinkID());
44         linkID = "test";
45         linkBean.setLinkID(linkID);
46         Assert.assertEquals(linkID,linkBean.getLinkID());
47     }
48
49     @Test
50     public void testGetLeftNodeID() throws Exception {
51         Assert.assertNull(linkBean.getLeftNodeID());
52         leftNodeID = "test";
53         linkBean.setLeftNodeID(leftNodeID);
54         Assert.assertEquals(leftNodeID,linkBean.getLeftNodeID());
55         leftNodeID = null;
56     }
57
58     @Test
59     public void testSetLeftNodeID() throws Exception {
60         Assert.assertNull(linkBean.getLeftNodeID());
61         leftNodeID = "test";
62         linkBean.setLeftNodeID(leftNodeID);
63         Assert.assertEquals(leftNodeID,linkBean.getLeftNodeID());
64     }
65
66     @Test
67     public void testGetLeftPortID() throws Exception {
68         Assert.assertNull(linkBean.getLeftPortID());
69         leftPortID = "test";
70         linkBean.setLeftPortID(leftPortID);
71         Assert.assertEquals(leftPortID,linkBean.getLeftPortID());
72         leftPortID = null;
73     }
74
75     @Test
76     public void testSetLeftPortID() throws Exception {
77         Assert.assertNull(linkBean.getLeftPortID());
78         leftPortID = "test";
79         linkBean.setLeftPortID(leftPortID);
80         Assert.assertEquals(leftPortID,linkBean.getLeftPortID());
81     }
82
83     @Test
84     public void testGetRightNodeID() throws Exception {
85         Assert.assertNull(linkBean.getRightNodeID());
86         rightNodeID = "test";
87         linkBean.setRightNodeID(rightNodeID);
88         Assert.assertEquals(rightNodeID,linkBean.getRightNodeID());
89         rightNodeID = null;
90     }
91
92     @Test
93     public void testSetRightNodeID() throws Exception {
94         Assert.assertNull(linkBean.getRightNodeID());
95         rightNodeID = "test";
96         linkBean.setRightNodeID(rightNodeID);
97         Assert.assertEquals(rightNodeID,linkBean.getRightNodeID());
98     }
99
100     @Test
101     public void testGetRightPortID() throws Exception {
102         Assert.assertNull(linkBean.getRightPortID());
103         rightPortID = "test";
104         linkBean.setRightPortID(rightPortID);
105         Assert.assertEquals(rightPortID,linkBean.getRightPortID());
106         rightPortID = null;
107     }
108
109     @Test
110     public void testSetRightPortID() throws Exception {
111         Assert.assertNull(linkBean.getRightPortID());
112         rightPortID = "test";
113         linkBean.setRightPortID(rightPortID);
114         Assert.assertEquals(rightPortID,linkBean.getRightPortID());
115     }
116
117     @Test
118     public void testGetLinkBandwidth() throws Exception {
119         Assert.assertNull(linkBean.getLinkBandwidth());
120         linkBandwidth = "test";
121         linkBean.setLinkBandwidth(linkBandwidth);
122         Assert.assertEquals(linkBandwidth,linkBean.getLinkBandwidth());
123         linkBandwidth = null;
124     }
125
126     @Test
127     public void testSetLinkBandwidth() throws Exception {
128         Assert.assertNull(linkBean.getLinkBandwidth());
129         linkBandwidth = "test";
130         linkBean.setLinkBandwidth(linkBandwidth);
131         Assert.assertEquals(linkBandwidth,linkBean.getLinkBandwidth());
132     }
133 }