Merge "JUnit Test for Topology Northbound"
[controller.git] / opendaylight / northbound / flowprogrammer / src / test / java / org / opendaylight / controller / flowprogrammer / northbound / FlowProgrammerNorthboundTest.java
1 package org.opendaylight.controller.flowprogrammer.northbound;
2
3 import java.util.ArrayList;
4
5 import org.junit.Assert;
6 import org.junit.Test;
7 import org.opendaylight.controller.forwardingrulesmanager.FlowConfig;
8
9 public class FlowProgrammerNorthboundTest {
10
11     @Test
12     public void testFlowConfigs() {
13         FlowConfigs fc = new FlowConfigs(null);
14         Assert.assertNull(fc.getFlowConfig());
15
16         FlowConfig conf = new FlowConfig();
17         FlowConfig conf2 = new FlowConfig();
18         ArrayList<FlowConfig> list = new ArrayList<FlowConfig>();
19
20         list.add(conf);
21         list.add(conf2);
22         FlowConfigs fc2 = new FlowConfigs(list);
23         Assert.assertTrue(fc2.getFlowConfig().equals(list));
24
25         fc.setFlowConfig(list);
26         Assert.assertTrue(fc.getFlowConfig().equals(fc2.getFlowConfig()));
27
28         fc.setFlowConfig(null);
29         Assert.assertNull(fc.getFlowConfig());
30
31     }
32
33 }