X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Faction%2FActionTest.java;fp=opendaylight%2Fsal%2Fapi%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Faction%2FActionTest.java;h=4fd59790034d413034f7c4209e473c357f2aefa7;hb=678adf2ca80a0bbbff9953e9372695184e415aac;hp=6858494283a2ec6cf0ee0e56e57d88d5a3ce5960;hpb=ce75340226ce5f213a85572a744a8dde82864b9e;p=controller.git diff --git a/opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/action/ActionTest.java b/opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/action/ActionTest.java index 6858494283..4fd5979003 100644 --- a/opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/action/ActionTest.java +++ b/opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/action/ActionTest.java @@ -156,7 +156,7 @@ public class ActionTest { try { ip = InetAddress.getByName("2001:420:281:1003:f2de:f1ff:fe71:728d"); } catch (UnknownHostException e) { - logger.error("",e); + logger.error("", e); } action = new SetNwSrc(ip); Assert.assertTrue(action.isValid()); @@ -172,7 +172,7 @@ public class ActionTest { action = new SetNwTos(0x40); Assert.assertFalse(action.isValid()); - + action = new SetNwTos(0xff1); Assert.assertFalse(action.isValid()); @@ -206,6 +206,29 @@ public class ActionTest { Assert.assertFalse(action.isValid()); } + @Test + public void testNextHopActionCreation() { + SetNextHop action = null; + + InetAddress ip = null; + try { + ip = InetAddress.getByName("171.71.9.52"); + } catch (UnknownHostException e) { + logger.error("", e); + } + + action = new SetNextHop(ip); + Assert.assertTrue(action.getAddress().equals(ip)); + + try { + ip = InetAddress.getByName("2001:420:281:1003:f2de:f1ff:fe71:728d"); + } catch (UnknownHostException e) { + logger.error("", e); + } + action = new SetNextHop(ip); + Assert.assertTrue(action.getAddress().equals(ip)); + } + @Test public void testActionList() { List actions = new ArrayList();