1 package org.opendaylight.nemo.renderer.openflow.entity;
3 import junit.framework.TestCase;
4 import org.junit.Assert;
5 import org.junit.Before;
7 import org.opendaylight.nemo.renderer.openflow.entity.HostBean;
8 import org.opendaylight.nemo.renderer.openflow.entity.LinkBean;
9 import org.opendaylight.nemo.renderer.openflow.entity.NodeBean;
10 import org.opendaylight.nemo.renderer.openflow.entity.ResourceBean;
11 import java.util.LinkedList;
13 import java.util.List;
15 import static org.junit.Assert.*;
17 import static org.mockito.Mockito.*;
18 import static org.junit.Assert.*;
20 * Created by zhangmeng on 2015/11/8.
22 public class ResourceBeanTest extends TestCase {
24 private ResourceBean resourceBean;
25 private List<NodeBean> nodelist;
26 private List<LinkBean> linklist;
27 private List<HostBean> hostlist;
30 public void setUp() throws Exception {
31 resourceBean = new ResourceBean();
32 nodelist = new LinkedList<NodeBean>();
33 linklist = new LinkedList<LinkBean>();
34 hostlist = new LinkedList<HostBean>();
38 public void testGetNodelist() throws Exception {
39 Assert.assertNull(resourceBean.getNodelist());
40 nodelist.add(new NodeBean());
41 resourceBean.setNodelist(nodelist);
42 Assert.assertNotNull(resourceBean.getNodelist());
47 public void testSetNodelist() throws Exception {
48 Assert.assertNull(resourceBean.getNodelist());
49 nodelist.add(new NodeBean());
50 resourceBean.setNodelist(nodelist);
51 Assert.assertNotNull(resourceBean.getNodelist());
55 public void testGetLinklist() throws Exception {
56 Assert.assertNull(resourceBean.getLinklist());
57 linklist.add(new LinkBean());
58 resourceBean.setLinklist(linklist);
59 Assert.assertNotNull(resourceBean.getLinklist());
64 public void testSetLinklist() throws Exception {
65 Assert.assertNull(resourceBean.getLinklist());
66 linklist.add(new LinkBean());
67 resourceBean.setLinklist(linklist);
68 Assert.assertNotNull(resourceBean.getLinklist());
72 public void testGetHostlist() throws Exception {
73 Assert.assertNull(resourceBean.getHostlist());
74 hostlist.add(new HostBean());
75 resourceBean.setHostlist(hostlist);
76 Assert.assertNotNull(resourceBean.getHostlist());
81 public void testSetHostlist() throws Exception {
82 Assert.assertNull(resourceBean.getHostlist());
83 hostlist.add(new HostBean());
84 resourceBean.setHostlist(hostlist);
85 Assert.assertNotNull(resourceBean.getHostlist());