From: Kalvin Hom Date: Thu, 28 Mar 2013 20:54:29 +0000 (-0700) Subject: JUnit test for forwarding.staticrouting.northbound X-Git-Tag: releasepom-0.1.0~618 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=4594ce9525b5f49218b1bd6af41d46af79ceb68f;ds=sidebyside JUnit test for forwarding.staticrouting.northbound Change-Id: I8c69f7e74aabfac429977087804d5e7bc182bbbc Signed-off-by: Kalvin Hom --- diff --git a/opendaylight/northbound/staticrouting/src/test/java/org/opendaylight/controller/forwarding/staticrouting/northbound/StaticRoutingNorthboundTest.java b/opendaylight/northbound/staticrouting/src/test/java/org/opendaylight/controller/forwarding/staticrouting/northbound/StaticRoutingNorthboundTest.java new file mode 100644 index 0000000000..2023d52561 --- /dev/null +++ b/opendaylight/northbound/staticrouting/src/test/java/org/opendaylight/controller/forwarding/staticrouting/northbound/StaticRoutingNorthboundTest.java @@ -0,0 +1,43 @@ +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 srl = new ArrayList(); + srs.setFlowConfig(srl); + Assert.assertTrue(srs.getFlowConfig().equals(srl)); + } + +}