--- /dev/null
+package org.opendaylight.controller.flowprogrammer.northbound;
+
+import java.util.ArrayList;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.controller.forwardingrulesmanager.FlowConfig;
+
+public class FlowProgrammerNorthboundTest {
+
+ @Test
+ public void testFlowConfigs() {
+ FlowConfigs fc = new FlowConfigs(null);
+ Assert.assertNull(fc.getFlowConfig());
+
+ FlowConfig conf = new FlowConfig();
+ FlowConfig conf2 = new FlowConfig();
+ ArrayList<FlowConfig> list = new ArrayList<FlowConfig>();
+
+ list.add(conf);
+ list.add(conf2);
+ FlowConfigs fc2 = new FlowConfigs(list);
+ Assert.assertTrue(fc2.getFlowConfig().equals(list));
+
+ fc.setFlowConfig(list);
+ Assert.assertTrue(fc.getFlowConfig().equals(fc2.getFlowConfig()));
+
+ fc.setFlowConfig(null);
+ Assert.assertNull(fc.getFlowConfig());
+
+ }
+
+}
--- /dev/null
+package org.opendaylight.controller.hosttracker.northbound;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
+import org.opendaylight.controller.sal.core.ConstructionException;
+
+public class HostTrackerNorthboundTest {
+
+ @Test
+ public void testHosts() throws UnknownHostException, ConstructionException {
+ Hosts h1 = new Hosts();
+ Assert.assertNull(h1.getHostNodeConnector());
+
+ Hosts h2 = new Hosts(null);
+ Assert.assertNull(h2.getHostNodeConnector());
+
+ Set<HostNodeConnector> conn = new HashSet<HostNodeConnector>();
+ InetAddress addr = InetAddress.getByName("10.1.1.1");
+ HostNodeConnector c1 = new HostNodeConnector(addr);
+ conn.add(c1);
+ h1.setHostNodeConnector(conn);
+ Assert.assertTrue(h1.getHostNodeConnector().equals(conn));
+
+ Hosts h3 = new Hosts(conn);
+ Assert.assertTrue(h3.getHostNodeConnector().equals(conn));
+ h3.setHostNodeConnector(null);
+ Assert.assertNull(h3.getHostNodeConnector());
+
+ }
+}
--- /dev/null
+package org.opendaylight.controller.forwarding.staticrouting.northbound;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import junit.framework.TestCase;
+
+public class StaticRoutingNorthboundTest extends TestCase {
+
+ @Test
+ public void testStaticRoute() {
+ StaticRoute sr = new StaticRoute();
+ Assert.assertTrue(sr.getName() == null);
+ Assert.assertTrue(sr.getPrefix() == null);
+ Assert.assertTrue(sr.getNextHop() == null);
+
+ sr = new StaticRoute("Static Route 1", "192.168.100.0/24", "170.0.0.1");
+ Assert.assertTrue(sr.getName().equals("Static Route 1"));
+ Assert.assertTrue(sr.getPrefix().equals("192.168.100.0/24"));
+ Assert.assertTrue(sr.getNextHop().equals("170.0.0.1"));
+
+ sr.setName("Static Route 2");
+ Assert.assertTrue(sr.getName().equals("Static Route 2"));
+ sr.setPrefix("192.168.100.0/26");
+ Assert.assertTrue(sr.getPrefix().equals("192.168.100.0/26"));
+ sr.setNextHop("170.0.2.1");
+ Assert.assertTrue(sr.getNextHop().equals("170.0.2.1"));
+ }
+
+ @Test
+ public void testStaticRoutes() {
+ StaticRoutes srs = new StaticRoutes(null);
+ Assert.assertTrue(srs.getFlowConfig() == null);
+
+ List<StaticRoute> srl = new ArrayList<StaticRoute>();
+ srs.setFlowConfig(srl);
+ Assert.assertTrue(srs.getFlowConfig().equals(srl));
+ }
+
+}
--- /dev/null
+package org.opendaylight.controller.subnets.northbound;
+
+import java.util.ArrayList;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.controller.switchmanager.SubnetConfig;
+
+public class SubnetsNorthboundTest {
+
+ @Test
+ public void testSubnetConfigs() {
+ SubnetConfigs sc1 = new SubnetConfigs(null);
+ Assert.assertNull(sc1.getSubnetConfig());
+
+ ArrayList<SubnetConfig> list = new ArrayList<SubnetConfig>();
+ SubnetConfig s1 = new SubnetConfig();
+ list.add(s1);
+ sc1.setSubnetConfig(list);
+ Assert.assertTrue(sc1.getSubnetConfig().equals(list));
+
+ sc1.setSubnetConfig(null);
+ Assert.assertNull(sc1.getSubnetConfig());
+ }
+
+}