Fix checkstyle whitespace issues - WHITESPACE ONLY
Change-Id: Ic205c1afd639c6008d61d9de95cb764eeb6238ca
diff --git a/src/test/java/net/onrc/onos/core/util/FlowEntryActionTest.java b/src/test/java/net/onrc/onos/core/util/FlowEntryActionTest.java
index 1283bb0..4377c8c 100644
--- a/src/test/java/net/onrc/onos/core/util/FlowEntryActionTest.java
+++ b/src/test/java/net/onrc/onos/core/util/FlowEntryActionTest.java
@@ -1,6 +1,7 @@
package net.onrc.onos.core.util;
import static org.junit.Assert.assertEquals;
+
import net.floodlightcontroller.util.MACAddress;
import net.onrc.onos.core.util.FlowEntryAction.ActionEnqueue;
import net.onrc.onos.core.util.FlowEntryAction.ActionOutput;
@@ -16,412 +17,412 @@
public class FlowEntryActionTest {
- @Test
- public void testSetActionOutputActionOutput(){
- FlowEntryAction act = new FlowEntryAction();
- ActionOutput actout = new FlowEntryAction.ActionOutput(new Port((short)42));
- act.setActionOutput(actout);
+ @Test
+ public void testSetActionOutputActionOutput() {
+ FlowEntryAction act = new FlowEntryAction();
+ ActionOutput actout = new FlowEntryAction.ActionOutput(new Port((short) 42));
+ act.setActionOutput(actout);
- assertEquals("action output",FlowEntryAction.ActionValues.ACTION_OUTPUT , act.actionType());
- assertEquals("actionOutput port should be the same", actout.port(), act.actionOutput().port());
- assertEquals("actionOutput maxlen should be the same", actout.maxLen(), act.actionOutput().maxLen());
+ assertEquals("action output", FlowEntryAction.ActionValues.ACTION_OUTPUT, act.actionType());
+ assertEquals("actionOutput port should be the same", actout.port(), act.actionOutput().port());
+ assertEquals("actionOutput maxlen should be the same", actout.maxLen(), act.actionOutput().maxLen());
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionOutputPort(){
- FlowEntryAction act = new FlowEntryAction();
- act.setActionOutput(new Port((short)42));
+ @Test
+ public void testSetActionOutputPort() {
+ FlowEntryAction act = new FlowEntryAction();
+ act.setActionOutput(new Port((short) 42));
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionOutputToController(){
- FlowEntryAction act = new FlowEntryAction();
- act.setActionOutputToController((short)0);
+ @Test
+ public void testSetActionOutputToController() {
+ FlowEntryAction act = new FlowEntryAction();
+ act.setActionOutputToController((short) 0);
- FlowEntryAction act_copy = new FlowEntryAction();
- act_copy.setActionOutput(new Port(Port.PortValues.PORT_CONTROLLER));
- ;
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction();
+ act_copy.setActionOutput(new Port(Port.PortValues.PORT_CONTROLLER));
+ ;
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionSetVlanIdActionSetVlanId(){
- FlowEntryAction act = new FlowEntryAction();
- ActionSetVlanId actVlan = new FlowEntryAction.ActionSetVlanId((short)42);
- act.setActionSetVlanId(actVlan);
+ @Test
+ public void testSetActionSetVlanIdActionSetVlanId() {
+ FlowEntryAction act = new FlowEntryAction();
+ ActionSetVlanId actVlan = new FlowEntryAction.ActionSetVlanId((short) 42);
+ act.setActionSetVlanId(actVlan);
- assertEquals("action type",FlowEntryAction.ActionValues.ACTION_SET_VLAN_VID , act.actionType());
- assertEquals("vlanid should be the same", actVlan.vlanId(), act.actionSetVlanId().vlanId());
+ assertEquals("action type", FlowEntryAction.ActionValues.ACTION_SET_VLAN_VID, act.actionType());
+ assertEquals("vlanid should be the same", actVlan.vlanId(), act.actionSetVlanId().vlanId());
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionSetVlanIdShort(){
- FlowEntryAction act = new FlowEntryAction();
- act.setActionSetVlanId((short)42);
+ @Test
+ public void testSetActionSetVlanIdShort() {
+ FlowEntryAction act = new FlowEntryAction();
+ act.setActionSetVlanId((short) 42);
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionSetVlanPriorityActionSetVlanPriority(){
- FlowEntryAction act = new FlowEntryAction();
- ActionSetVlanPriority actVlan = new FlowEntryAction.ActionSetVlanPriority((byte)42);
- act.setActionSetVlanPriority(actVlan);
+ @Test
+ public void testSetActionSetVlanPriorityActionSetVlanPriority() {
+ FlowEntryAction act = new FlowEntryAction();
+ ActionSetVlanPriority actVlan = new FlowEntryAction.ActionSetVlanPriority((byte) 42);
+ act.setActionSetVlanPriority(actVlan);
- assertEquals("action type",FlowEntryAction.ActionValues.ACTION_SET_VLAN_PCP , act.actionType());
- assertEquals("vlan priority should be the same", actVlan.vlanPriority(), act.actionSetVlanPriority().vlanPriority());
+ assertEquals("action type", FlowEntryAction.ActionValues.ACTION_SET_VLAN_PCP, act.actionType());
+ assertEquals("vlan priority should be the same", actVlan.vlanPriority(), act.actionSetVlanPriority().vlanPriority());
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionSetVlanPriorityByte(){
- FlowEntryAction act = new FlowEntryAction();
- act.setActionSetVlanPriority((byte)42);
+ @Test
+ public void testSetActionSetVlanPriorityByte() {
+ FlowEntryAction act = new FlowEntryAction();
+ act.setActionSetVlanPriority((byte) 42);
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionStripVlanActionStripVlan(){
- FlowEntryAction act = new FlowEntryAction();
- ActionStripVlan actVlan = new FlowEntryAction.ActionStripVlan();
- act.setActionStripVlan(actVlan);
+ @Test
+ public void testSetActionStripVlanActionStripVlan() {
+ FlowEntryAction act = new FlowEntryAction();
+ ActionStripVlan actVlan = new FlowEntryAction.ActionStripVlan();
+ act.setActionStripVlan(actVlan);
- assertEquals("action type",FlowEntryAction.ActionValues.ACTION_STRIP_VLAN , act.actionType());
- assertEquals("vlanid should be the same", actVlan.stripVlan(), act.actionStripVlan().stripVlan());
+ assertEquals("action type", FlowEntryAction.ActionValues.ACTION_STRIP_VLAN, act.actionType());
+ assertEquals("vlanid should be the same", actVlan.stripVlan(), act.actionStripVlan().stripVlan());
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionStripVlanBoolean(){
- FlowEntryAction act = new FlowEntryAction();
- act.setActionStripVlan(true);
+ @Test
+ public void testSetActionStripVlanBoolean() {
+ FlowEntryAction act = new FlowEntryAction();
+ act.setActionStripVlan(true);
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionSetEthernetSrcAddrActionSetEthernetAddr(){
- FlowEntryAction act = new FlowEntryAction();
- byte[] mac = { 1, 2, 3, 4, 5, 6 };
- ActionSetEthernetAddr setEth = new FlowEntryAction.ActionSetEthernetAddr(new MACAddress(mac));
- act.setActionSetEthernetSrcAddr( setEth );
+ @Test
+ public void testSetActionSetEthernetSrcAddrActionSetEthernetAddr() {
+ FlowEntryAction act = new FlowEntryAction();
+ byte[] mac = {1, 2, 3, 4, 5, 6};
+ ActionSetEthernetAddr setEth = new FlowEntryAction.ActionSetEthernetAddr(new MACAddress(mac));
+ act.setActionSetEthernetSrcAddr(setEth);
- assertEquals("action type",FlowEntryAction.ActionValues.ACTION_SET_DL_SRC , act.actionType());
- assertEquals("addr should be the same", setEth.addr(), act.actionSetEthernetSrcAddr().addr());
+ assertEquals("action type", FlowEntryAction.ActionValues.ACTION_SET_DL_SRC, act.actionType());
+ assertEquals("addr should be the same", setEth.addr(), act.actionSetEthernetSrcAddr().addr());
-
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- @Test
- public void testSetActionSetEthernetSrcAddrMACAddress(){
- FlowEntryAction act = new FlowEntryAction();
- byte[] mac = { 1, 2, 3, 4, 5, 6 };
- act.setActionSetEthernetSrcAddr(new MACAddress(mac));
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ @Test
+ public void testSetActionSetEthernetSrcAddrMACAddress() {
+ FlowEntryAction act = new FlowEntryAction();
+ byte[] mac = {1, 2, 3, 4, 5, 6};
+ act.setActionSetEthernetSrcAddr(new MACAddress(mac));
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- @Test
- public void testSetActionSetEthernetDstAddrActionSetEthernetAddr(){
- FlowEntryAction act = new FlowEntryAction();
- byte[] mac = { 1, 2, 3, 4, 5, 6 };
- ActionSetEthernetAddr setEth = new FlowEntryAction.ActionSetEthernetAddr(new MACAddress(mac));
- act.setActionSetEthernetDstAddr( setEth );
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- assertEquals("action type",FlowEntryAction.ActionValues.ACTION_SET_DL_DST , act.actionType());
- assertEquals("addr should be the same", setEth.addr(), act.actionSetEthernetDstAddr().addr());
+ @Test
+ public void testSetActionSetEthernetDstAddrActionSetEthernetAddr() {
+ FlowEntryAction act = new FlowEntryAction();
+ byte[] mac = {1, 2, 3, 4, 5, 6};
+ ActionSetEthernetAddr setEth = new FlowEntryAction.ActionSetEthernetAddr(new MACAddress(mac));
+ act.setActionSetEthernetDstAddr(setEth);
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ assertEquals("action type", FlowEntryAction.ActionValues.ACTION_SET_DL_DST, act.actionType());
+ assertEquals("addr should be the same", setEth.addr(), act.actionSetEthernetDstAddr().addr());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- @Test
- public void testSetActionSetEthernetDstAddrMACAddress(){
- FlowEntryAction act = new FlowEntryAction();
- byte[] mac = { 1, 2, 3, 4, 5, 6 };
- act.setActionSetEthernetDstAddr(new MACAddress(mac));
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
+
+ @Test
+ public void testSetActionSetEthernetDstAddrMACAddress() {
+ FlowEntryAction act = new FlowEntryAction();
+ byte[] mac = {1, 2, 3, 4, 5, 6};
+ act.setActionSetEthernetDstAddr(new MACAddress(mac));
+
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ @Test
+ public void testSetActionSetIPv4SrcAddrActionSetIPv4Addr() {
+ FlowEntryAction act = new FlowEntryAction();
+ ActionSetIPv4Addr setIp = new FlowEntryAction.ActionSetIPv4Addr(new IPv4("127.0.0.1"));
+ act.setActionSetIPv4SrcAddr(setIp);
- @Test
- public void testSetActionSetIPv4SrcAddrActionSetIPv4Addr(){
- FlowEntryAction act = new FlowEntryAction();
- ActionSetIPv4Addr setIp = new FlowEntryAction.ActionSetIPv4Addr(new IPv4("127.0.0.1"));
- act.setActionSetIPv4SrcAddr( setIp );
+ assertEquals("action type", FlowEntryAction.ActionValues.ACTION_SET_NW_SRC, act.actionType());
+ assertEquals("addr should be the same", setIp.addr(), act.actionSetIPv4SrcAddr().addr());
- assertEquals("action type",FlowEntryAction.ActionValues.ACTION_SET_NW_SRC , act.actionType());
- assertEquals("addr should be the same", setIp.addr(), act.actionSetIPv4SrcAddr().addr());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
-
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionSetIPv4SrcAddrIPv4(){
- FlowEntryAction act = new FlowEntryAction();
- act.setActionSetIPv4SrcAddr(new IPv4("127.0.0.1"));
+ @Test
+ public void testSetActionSetIPv4SrcAddrIPv4() {
+ FlowEntryAction act = new FlowEntryAction();
+ act.setActionSetIPv4SrcAddr(new IPv4("127.0.0.1"));
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionSetIPv4DstAddrActionSetIPv4Addr(){
- FlowEntryAction act = new FlowEntryAction();
- ActionSetIPv4Addr setIp = new FlowEntryAction.ActionSetIPv4Addr(new IPv4("127.0.0.1"));
- act.setActionSetIPv4DstAddr( setIp );
+ @Test
+ public void testSetActionSetIPv4DstAddrActionSetIPv4Addr() {
+ FlowEntryAction act = new FlowEntryAction();
+ ActionSetIPv4Addr setIp = new FlowEntryAction.ActionSetIPv4Addr(new IPv4("127.0.0.1"));
+ act.setActionSetIPv4DstAddr(setIp);
- assertEquals("action type",FlowEntryAction.ActionValues.ACTION_SET_NW_DST , act.actionType());
- assertEquals("addr should be the same", setIp.addr(), act.actionSetIPv4DstAddr().addr());
+ assertEquals("action type", FlowEntryAction.ActionValues.ACTION_SET_NW_DST, act.actionType());
+ assertEquals("addr should be the same", setIp.addr(), act.actionSetIPv4DstAddr().addr());
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionSetIPv4DstAddrIPv4(){
- FlowEntryAction act = new FlowEntryAction();
- act.setActionSetIPv4DstAddr(new IPv4("127.0.0.1"));
+ @Test
+ public void testSetActionSetIPv4DstAddrIPv4() {
+ FlowEntryAction act = new FlowEntryAction();
+ act.setActionSetIPv4DstAddr(new IPv4("127.0.0.1"));
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionSetIpToSActionSetIpToS(){
- FlowEntryAction act = new FlowEntryAction();
- ActionSetIpToS setIpTos = new FlowEntryAction.ActionSetIpToS((byte)42);
- act.setActionSetIpToS( setIpTos );
+ @Test
+ public void testSetActionSetIpToSActionSetIpToS() {
+ FlowEntryAction act = new FlowEntryAction();
+ ActionSetIpToS setIpTos = new FlowEntryAction.ActionSetIpToS((byte) 42);
+ act.setActionSetIpToS(setIpTos);
- assertEquals("action type",FlowEntryAction.ActionValues.ACTION_SET_NW_TOS , act.actionType());
- assertEquals("tos should be the same", setIpTos.ipToS(), act.actionSetIpToS().ipToS());
+ assertEquals("action type", FlowEntryAction.ActionValues.ACTION_SET_NW_TOS, act.actionType());
+ assertEquals("tos should be the same", setIpTos.ipToS(), act.actionSetIpToS().ipToS());
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionSetIpToSByte(){
- FlowEntryAction act = new FlowEntryAction();
- act.setActionSetIpToS((byte)1);
+ @Test
+ public void testSetActionSetIpToSByte() {
+ FlowEntryAction act = new FlowEntryAction();
+ act.setActionSetIpToS((byte) 1);
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionSetTcpUdpSrcPortActionSetTcpUdpPort(){
- FlowEntryAction act = new FlowEntryAction();
- ActionSetTcpUdpPort setPorts = new FlowEntryAction.ActionSetTcpUdpPort((short)42);
- act.setActionSetTcpUdpSrcPort( setPorts );
+ @Test
+ public void testSetActionSetTcpUdpSrcPortActionSetTcpUdpPort() {
+ FlowEntryAction act = new FlowEntryAction();
+ ActionSetTcpUdpPort setPorts = new FlowEntryAction.ActionSetTcpUdpPort((short) 42);
+ act.setActionSetTcpUdpSrcPort(setPorts);
- assertEquals("action type",FlowEntryAction.ActionValues.ACTION_SET_TP_SRC , act.actionType());
- assertEquals("port should be the same", setPorts.port(), act.actionSetTcpUdpSrcPort().port());
+ assertEquals("action type", FlowEntryAction.ActionValues.ACTION_SET_TP_SRC, act.actionType());
+ assertEquals("port should be the same", setPorts.port(), act.actionSetTcpUdpSrcPort().port());
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionSetTcpUdpSrcPortShort(){
- FlowEntryAction act = new FlowEntryAction();
- act.setActionSetTcpUdpSrcPort((short)1);
+ @Test
+ public void testSetActionSetTcpUdpSrcPortShort() {
+ FlowEntryAction act = new FlowEntryAction();
+ act.setActionSetTcpUdpSrcPort((short) 1);
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionSetTcpUdpDstPortActionSetTcpUdpPort(){
- FlowEntryAction act = new FlowEntryAction();
- ActionSetTcpUdpPort setPorts = new FlowEntryAction.ActionSetTcpUdpPort((short)42);
- act.setActionSetTcpUdpDstPort( setPorts );
+ @Test
+ public void testSetActionSetTcpUdpDstPortActionSetTcpUdpPort() {
+ FlowEntryAction act = new FlowEntryAction();
+ ActionSetTcpUdpPort setPorts = new FlowEntryAction.ActionSetTcpUdpPort((short) 42);
+ act.setActionSetTcpUdpDstPort(setPorts);
- assertEquals("action type",FlowEntryAction.ActionValues.ACTION_SET_TP_DST , act.actionType());
- assertEquals("port should be the same", setPorts.port(), act.actionSetTcpUdpDstPort().port());
+ assertEquals("action type", FlowEntryAction.ActionValues.ACTION_SET_TP_DST, act.actionType());
+ assertEquals("port should be the same", setPorts.port(), act.actionSetTcpUdpDstPort().port());
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionSetTcpUdpDstPortShort(){
- FlowEntryAction act = new FlowEntryAction();
- act.setActionSetTcpUdpDstPort((short)1);
+ @Test
+ public void testSetActionSetTcpUdpDstPortShort() {
+ FlowEntryAction act = new FlowEntryAction();
+ act.setActionSetTcpUdpDstPort((short) 1);
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionEnqueueActionEnqueue(){
- FlowEntryAction act = new FlowEntryAction();
- ActionEnqueue enq = new FlowEntryAction.ActionEnqueue(new Port((short)42), 1);
- act.setActionEnqueue( enq );
+ @Test
+ public void testSetActionEnqueueActionEnqueue() {
+ FlowEntryAction act = new FlowEntryAction();
+ ActionEnqueue enq = new FlowEntryAction.ActionEnqueue(new Port((short) 42), 1);
+ act.setActionEnqueue(enq);
- assertEquals("action type",FlowEntryAction.ActionValues.ACTION_ENQUEUE , act.actionType());
- assertEquals("port should be the same", enq.port(), act.actionEnqueue().port());
- assertEquals("queue id should be the same", enq.queueId(), act.actionEnqueue().queueId());
+ assertEquals("action type", FlowEntryAction.ActionValues.ACTION_ENQUEUE, act.actionType());
+ assertEquals("port should be the same", enq.port(), act.actionEnqueue().port());
+ assertEquals("queue id should be the same", enq.queueId(), act.actionEnqueue().queueId());
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
- @Test
- public void testSetActionEnqueuePortInt(){
- FlowEntryAction act = new FlowEntryAction();
- act.setActionEnqueue(new Port((short)42), 1);
+ @Test
+ public void testSetActionEnqueuePortInt() {
+ FlowEntryAction act = new FlowEntryAction();
+ act.setActionEnqueue(new Port((short) 42), 1);
- FlowEntryAction act_copy = new FlowEntryAction(act);
- FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
+ FlowEntryAction act_copy = new FlowEntryAction(act);
+ FlowEntryAction act_copy2 = new FlowEntryAction(act.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy.toString());
- assertEquals("toString must match between copies", act.toString(),
- act_copy2.toString());
- }
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy.toString());
+ assertEquals("toString must match between copies", act.toString(),
+ act_copy2.toString());
+ }
}
diff --git a/src/test/java/net/onrc/onos/core/util/FlowEntryMatchTest.java b/src/test/java/net/onrc/onos/core/util/FlowEntryMatchTest.java
index 515a631..353b8ab 100644
--- a/src/test/java/net/onrc/onos/core/util/FlowEntryMatchTest.java
+++ b/src/test/java/net/onrc/onos/core/util/FlowEntryMatchTest.java
@@ -3,6 +3,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+
import net.floodlightcontroller.util.MACAddress;
import org.junit.Before;
@@ -10,303 +11,303 @@
public class FlowEntryMatchTest {
- FlowEntryMatch match;
-
- Port inport = new Port((short)1);
- byte[] byte1 = { 1, 2, 3, 4, 5, 6 };
- byte[] byte2 = { 6, 5, 4, 3, 2, 1 };
- MACAddress mac1 = new MACAddress(byte1);
- MACAddress mac2 = new MACAddress(byte2);
- Short ether = Short.valueOf((short)2);
- Short vlanid = Short.valueOf((short)3);
- Byte vlanprio = Byte.valueOf((byte)4);
- IPv4Net ip1 = new IPv4Net("127.0.0.1/32");
- IPv4Net ip2 = new IPv4Net("127.0.0.2/32");
- Byte ipproto = Byte.valueOf((byte)5);
- Byte ipToS = Byte.valueOf((byte)6);
- Short tport1 = Short.valueOf((short)7);
- Short tport2 = Short.valueOf((short)8);
-
- @Before
- public void setUp() throws Exception{
- match = new FlowEntryMatch();
- match.enableInPort( inport);
- match.enableSrcMac( mac1 );
- match.enableDstMac( mac2 );
- match.enableEthernetFrameType( ether );
- match.enableVlanId( vlanid );
- match.enableVlanPriority( vlanprio );
- match.enableSrcIPv4Net( ip1 );
- match.enableDstIPv4Net( ip2 );
- match.enableIpProto( ipproto );
- match.enableIpToS( ipToS );
- match.enableSrcTcpUdpPort( tport1 );
- match.enableDstTcpUdpPort( tport2 );
- }
+ FlowEntryMatch match;
- @Test
- public void testFlowEntryMatch(){
- FlowEntryMatch def = new FlowEntryMatch();
-
- assertEquals("default null", null, def.inPort() );
- assertEquals("default null", null, def.srcMac() );
- assertEquals("default null", null, def.dstMac() );
- assertEquals("default null", null, def.ethernetFrameType() );
- assertEquals("default null", null, def.vlanId() );
- assertEquals("default null", null, def.vlanPriority() );
- assertEquals("default null", null, def.srcIPv4Net() );
- assertEquals("default null", null, def.dstIPv4Net() );
- assertEquals("default null", null, def.ipProto() );
- assertEquals("default null", null, def.ipToS() );
- assertEquals("default null", null, def.srcTcpUdpPort() );
- assertEquals("default null", null, def.dstTcpUdpPort() );
- }
+ Port inport = new Port((short) 1);
+ byte[] byte1 = {1, 2, 3, 4, 5, 6};
+ byte[] byte2 = {6, 5, 4, 3, 2, 1};
+ MACAddress mac1 = new MACAddress(byte1);
+ MACAddress mac2 = new MACAddress(byte2);
+ Short ether = Short.valueOf((short) 2);
+ Short vlanid = Short.valueOf((short) 3);
+ Byte vlanprio = Byte.valueOf((byte) 4);
+ IPv4Net ip1 = new IPv4Net("127.0.0.1/32");
+ IPv4Net ip2 = new IPv4Net("127.0.0.2/32");
+ Byte ipproto = Byte.valueOf((byte) 5);
+ Byte ipToS = Byte.valueOf((byte) 6);
+ Short tport1 = Short.valueOf((short) 7);
+ Short tport2 = Short.valueOf((short) 8);
- @Test
- public void testFlowEntryMatchFlowEntryMatch(){
- FlowEntryMatch def_base = new FlowEntryMatch();
- FlowEntryMatch def = new FlowEntryMatch(def_base);
+ @Before
+ public void setUp() throws Exception {
+ match = new FlowEntryMatch();
+ match.enableInPort(inport);
+ match.enableSrcMac(mac1);
+ match.enableDstMac(mac2);
+ match.enableEthernetFrameType(ether);
+ match.enableVlanId(vlanid);
+ match.enableVlanPriority(vlanprio);
+ match.enableSrcIPv4Net(ip1);
+ match.enableDstIPv4Net(ip2);
+ match.enableIpProto(ipproto);
+ match.enableIpToS(ipToS);
+ match.enableSrcTcpUdpPort(tport1);
+ match.enableDstTcpUdpPort(tport2);
+ }
- assertEquals("default null", null, def.inPort() );
- assertEquals("default null", null, def.srcMac() );
- assertEquals("default null", null, def.dstMac() );
- assertEquals("default null", null, def.ethernetFrameType() );
- assertEquals("default null", null, def.vlanId() );
- assertEquals("default null", null, def.vlanPriority() );
- assertEquals("default null", null, def.srcIPv4Net() );
- assertEquals("default null", null, def.dstIPv4Net() );
- assertEquals("default null", null, def.ipProto() );
- assertEquals("default null", null, def.ipToS() );
- assertEquals("default null", null, def.srcTcpUdpPort() );
- assertEquals("default null", null, def.dstTcpUdpPort() );
-
- FlowEntryMatch copy = new FlowEntryMatch( match );
-
- assertEquals("inport", inport, copy.inPort() );
- assertEquals("mac1", mac1, copy.srcMac() );
- assertEquals("mac2", mac2, copy.dstMac() );
- assertEquals("ether", ether, copy.ethernetFrameType() );
- assertEquals("vlan id", vlanid, copy.vlanId() );
- assertEquals("vlan prio", vlanprio, copy.vlanPriority() );
- assertEquals("ip1", ip1, copy.srcIPv4Net() );
- assertEquals("ip2", ip2, copy.dstIPv4Net() );
- assertEquals("ip proto", ipproto, copy.ipProto() );
- assertEquals("tos", ipToS, copy.ipToS() );
- assertEquals("src port", tport1, copy.srcTcpUdpPort() );
- assertEquals("dst port", tport2, copy.dstTcpUdpPort() );
+ @Test
+ public void testFlowEntryMatch() {
+ FlowEntryMatch def = new FlowEntryMatch();
- }
+ assertEquals("default null", null, def.inPort());
+ assertEquals("default null", null, def.srcMac());
+ assertEquals("default null", null, def.dstMac());
+ assertEquals("default null", null, def.ethernetFrameType());
+ assertEquals("default null", null, def.vlanId());
+ assertEquals("default null", null, def.vlanPriority());
+ assertEquals("default null", null, def.srcIPv4Net());
+ assertEquals("default null", null, def.dstIPv4Net());
+ assertEquals("default null", null, def.ipProto());
+ assertEquals("default null", null, def.ipToS());
+ assertEquals("default null", null, def.srcTcpUdpPort());
+ assertEquals("default null", null, def.dstTcpUdpPort());
+ }
- @Test
- public void testInPort(){
- assertEquals("inport", inport, match.inPort() );
- }
+ @Test
+ public void testFlowEntryMatchFlowEntryMatch() {
+ FlowEntryMatch def_base = new FlowEntryMatch();
+ FlowEntryMatch def = new FlowEntryMatch(def_base);
- @Test
- public void testDisableInPort(){
- match.disableInPort();
- assertEquals("inport", null, match.inPort() );
- assertFalse( match.matchInPort() );
- }
+ assertEquals("default null", null, def.inPort());
+ assertEquals("default null", null, def.srcMac());
+ assertEquals("default null", null, def.dstMac());
+ assertEquals("default null", null, def.ethernetFrameType());
+ assertEquals("default null", null, def.vlanId());
+ assertEquals("default null", null, def.vlanPriority());
+ assertEquals("default null", null, def.srcIPv4Net());
+ assertEquals("default null", null, def.dstIPv4Net());
+ assertEquals("default null", null, def.ipProto());
+ assertEquals("default null", null, def.ipToS());
+ assertEquals("default null", null, def.srcTcpUdpPort());
+ assertEquals("default null", null, def.dstTcpUdpPort());
- @Test
- public void testMatchInPort(){
- assertTrue( match.matchInPort() );
- }
+ FlowEntryMatch copy = new FlowEntryMatch(match);
- @Test
- public void testSrcMac(){
- assertEquals("mac1", mac1, match.srcMac() );
- }
+ assertEquals("inport", inport, copy.inPort());
+ assertEquals("mac1", mac1, copy.srcMac());
+ assertEquals("mac2", mac2, copy.dstMac());
+ assertEquals("ether", ether, copy.ethernetFrameType());
+ assertEquals("vlan id", vlanid, copy.vlanId());
+ assertEquals("vlan prio", vlanprio, copy.vlanPriority());
+ assertEquals("ip1", ip1, copy.srcIPv4Net());
+ assertEquals("ip2", ip2, copy.dstIPv4Net());
+ assertEquals("ip proto", ipproto, copy.ipProto());
+ assertEquals("tos", ipToS, copy.ipToS());
+ assertEquals("src port", tport1, copy.srcTcpUdpPort());
+ assertEquals("dst port", tport2, copy.dstTcpUdpPort());
- @Test
- public void testDisableSrcMac(){
- match.disableSrcMac();
- assertEquals("srcMac", null, match.srcMac() );
- assertFalse( match.matchSrcMac() );
- }
+ }
- @Test
- public void testMatchSrcMac(){
- assertTrue( match.matchSrcMac() );
- }
+ @Test
+ public void testInPort() {
+ assertEquals("inport", inport, match.inPort());
+ }
- @Test
- public void testDstMac(){
- assertEquals("mac2", mac2, match.dstMac() );
- }
+ @Test
+ public void testDisableInPort() {
+ match.disableInPort();
+ assertEquals("inport", null, match.inPort());
+ assertFalse(match.matchInPort());
+ }
- @Test
- public void testDisableDstMac(){
- match.disableDstMac();
- assertEquals("dstMac", null, match.dstMac() );
- assertFalse( match.matchDstMac() );
- }
+ @Test
+ public void testMatchInPort() {
+ assertTrue(match.matchInPort());
+ }
- @Test
- public void testMatchDstMac(){
- assertTrue( match.matchDstMac() );
- }
+ @Test
+ public void testSrcMac() {
+ assertEquals("mac1", mac1, match.srcMac());
+ }
- @Test
- public void testEthernetFrameType(){
- assertEquals("ether", ether, match.ethernetFrameType() );
- }
+ @Test
+ public void testDisableSrcMac() {
+ match.disableSrcMac();
+ assertEquals("srcMac", null, match.srcMac());
+ assertFalse(match.matchSrcMac());
+ }
- @Test
- public void testDisableEthernetFrameType(){
- match.disableEthernetFrameType();
- assertEquals("ethernetFrameType", null, match.ethernetFrameType() );
- assertFalse( match.matchEthernetFrameType() );
- }
+ @Test
+ public void testMatchSrcMac() {
+ assertTrue(match.matchSrcMac());
+ }
- @Test
- public void testMatchEthernetFrameType(){
- assertTrue( match.matchEthernetFrameType() );
- }
+ @Test
+ public void testDstMac() {
+ assertEquals("mac2", mac2, match.dstMac());
+ }
- @Test
- public void testVlanId(){
- assertEquals("vlan id", vlanid, match.vlanId() );
- }
+ @Test
+ public void testDisableDstMac() {
+ match.disableDstMac();
+ assertEquals("dstMac", null, match.dstMac());
+ assertFalse(match.matchDstMac());
+ }
- @Test
- public void testDisableVlanId(){
- match.disableVlanId();
- assertEquals("vlanId", null, match.vlanId() );
- assertFalse( match.matchVlanId() );
- }
+ @Test
+ public void testMatchDstMac() {
+ assertTrue(match.matchDstMac());
+ }
- @Test
- public void testMatchVlanId(){
- assertTrue( match.matchVlanId() );
- }
+ @Test
+ public void testEthernetFrameType() {
+ assertEquals("ether", ether, match.ethernetFrameType());
+ }
- @Test
- public void testVlanPriority(){
- assertEquals("vlan prio", vlanprio, match.vlanPriority() );
- }
+ @Test
+ public void testDisableEthernetFrameType() {
+ match.disableEthernetFrameType();
+ assertEquals("ethernetFrameType", null, match.ethernetFrameType());
+ assertFalse(match.matchEthernetFrameType());
+ }
- @Test
- public void testDisableVlanPriority(){
- match.disableVlanPriority();
- assertEquals("vlanPriority", null, match.vlanPriority() );
- assertFalse( match.matchVlanPriority() );
- }
+ @Test
+ public void testMatchEthernetFrameType() {
+ assertTrue(match.matchEthernetFrameType());
+ }
- @Test
- public void testMatchVlanPriority(){
- assertTrue( match.matchVlanPriority() );
- }
+ @Test
+ public void testVlanId() {
+ assertEquals("vlan id", vlanid, match.vlanId());
+ }
- @Test
- public void testSrcIPv4Net(){
- assertEquals("ip1", ip1, match.srcIPv4Net() );
- }
+ @Test
+ public void testDisableVlanId() {
+ match.disableVlanId();
+ assertEquals("vlanId", null, match.vlanId());
+ assertFalse(match.matchVlanId());
+ }
- @Test
- public void testDisableSrcIPv4Net(){
- match.disableSrcIPv4Net();
- assertEquals("srcIPv4Net", null, match.srcIPv4Net() );
- assertFalse( match.matchSrcIPv4Net() );
- }
+ @Test
+ public void testMatchVlanId() {
+ assertTrue(match.matchVlanId());
+ }
- @Test
- public void testMatchSrcIPv4Net(){
- assertTrue( match.matchSrcIPv4Net() );
- }
+ @Test
+ public void testVlanPriority() {
+ assertEquals("vlan prio", vlanprio, match.vlanPriority());
+ }
- @Test
- public void testDstIPv4Net(){
- assertEquals("ip2", ip2, match.dstIPv4Net() );
- }
+ @Test
+ public void testDisableVlanPriority() {
+ match.disableVlanPriority();
+ assertEquals("vlanPriority", null, match.vlanPriority());
+ assertFalse(match.matchVlanPriority());
+ }
- @Test
- public void testDisableDstIPv4Net(){
- match.disableDstIPv4Net();
- assertEquals("dstIPv4Net", null, match.dstIPv4Net() );
- assertFalse( match.matchDstIPv4Net() );
- }
+ @Test
+ public void testMatchVlanPriority() {
+ assertTrue(match.matchVlanPriority());
+ }
- @Test
- public void testMatchDstIPv4Net(){
- assertTrue( match.matchDstIPv4Net() );
- }
+ @Test
+ public void testSrcIPv4Net() {
+ assertEquals("ip1", ip1, match.srcIPv4Net());
+ }
- @Test
- public void testIpProto(){
- assertEquals("ip proto", ipproto, match.ipProto() );
- }
+ @Test
+ public void testDisableSrcIPv4Net() {
+ match.disableSrcIPv4Net();
+ assertEquals("srcIPv4Net", null, match.srcIPv4Net());
+ assertFalse(match.matchSrcIPv4Net());
+ }
- @Test
- public void testDisableIpProto(){
- match.disableIpProto();
- assertEquals("ipProto", null, match.ipProto() );
- assertFalse( match.matchIpProto() );
- }
+ @Test
+ public void testMatchSrcIPv4Net() {
+ assertTrue(match.matchSrcIPv4Net());
+ }
- @Test
- public void testMatchIpProto(){
- assertTrue( match.matchIpProto() );
- }
+ @Test
+ public void testDstIPv4Net() {
+ assertEquals("ip2", ip2, match.dstIPv4Net());
+ }
- @Test
- public void testIpToS(){
- assertEquals("tos", ipToS, match.ipToS() );
- }
+ @Test
+ public void testDisableDstIPv4Net() {
+ match.disableDstIPv4Net();
+ assertEquals("dstIPv4Net", null, match.dstIPv4Net());
+ assertFalse(match.matchDstIPv4Net());
+ }
- @Test
- public void testDisableIpToS(){
- match.disableIpToS();
- assertEquals("ipToS", null, match.ipToS() );
- assertFalse( match.matchIpToS() );
- }
+ @Test
+ public void testMatchDstIPv4Net() {
+ assertTrue(match.matchDstIPv4Net());
+ }
- @Test
- public void testMatchIpToS(){
- assertTrue( match.matchIpToS() );
- }
+ @Test
+ public void testIpProto() {
+ assertEquals("ip proto", ipproto, match.ipProto());
+ }
- @Test
- public void testSrcTcpUdpPort(){
- assertEquals("src port", tport1, match.srcTcpUdpPort() );
- }
+ @Test
+ public void testDisableIpProto() {
+ match.disableIpProto();
+ assertEquals("ipProto", null, match.ipProto());
+ assertFalse(match.matchIpProto());
+ }
- @Test
- public void testDisableSrcTcpUdpPort(){
- match.disableSrcTcpUdpPort();
- assertEquals("srcTcpUdpPort", null, match.srcTcpUdpPort() );
- assertFalse( match.matchSrcTcpUdpPort() );
- }
+ @Test
+ public void testMatchIpProto() {
+ assertTrue(match.matchIpProto());
+ }
- @Test
- public void testMatchSrcTcpUdpPort(){
- assertTrue( match.matchSrcTcpUdpPort() );
- }
+ @Test
+ public void testIpToS() {
+ assertEquals("tos", ipToS, match.ipToS());
+ }
- @Test
- public void testDstTcpUdpPort(){
- assertEquals("dst port", tport2, match.dstTcpUdpPort() );
- }
+ @Test
+ public void testDisableIpToS() {
+ match.disableIpToS();
+ assertEquals("ipToS", null, match.ipToS());
+ assertFalse(match.matchIpToS());
+ }
- @Test
- public void testDisableDstTcpUdpPort(){
- match.disableDstTcpUdpPort();
- assertEquals("dstTcpUdpPort", null, match.dstTcpUdpPort() );
- assertFalse( match.matchDstTcpUdpPort() );
- }
+ @Test
+ public void testMatchIpToS() {
+ assertTrue(match.matchIpToS());
+ }
- @Test
- public void testMatchDstTcpUdpPort(){
- assertTrue( match.matchDstTcpUdpPort() );
- }
+ @Test
+ public void testSrcTcpUdpPort() {
+ assertEquals("src port", tport1, match.srcTcpUdpPort());
+ }
- @Test
- public void testToString(){
- FlowEntryMatch def = new FlowEntryMatch();
- assertEquals("match default", def.toString(), "[]");
-
- assertEquals("match set", match.toString(), "[inPort=1 srcMac=01:02:03:04:05:06 dstMac=06:05:04:03:02:01 ethernetFrameType=2 vlanId=3 vlanPriority=4 srcIPv4Net=127.0.0.1/32 dstIPv4Net=127.0.0.2/32 ipProto=5 ipToS=6 srcTcpUdpPort=7 dstTcpUdpPort=8]");
- }
+ @Test
+ public void testDisableSrcTcpUdpPort() {
+ match.disableSrcTcpUdpPort();
+ assertEquals("srcTcpUdpPort", null, match.srcTcpUdpPort());
+ assertFalse(match.matchSrcTcpUdpPort());
+ }
+
+ @Test
+ public void testMatchSrcTcpUdpPort() {
+ assertTrue(match.matchSrcTcpUdpPort());
+ }
+
+ @Test
+ public void testDstTcpUdpPort() {
+ assertEquals("dst port", tport2, match.dstTcpUdpPort());
+ }
+
+ @Test
+ public void testDisableDstTcpUdpPort() {
+ match.disableDstTcpUdpPort();
+ assertEquals("dstTcpUdpPort", null, match.dstTcpUdpPort());
+ assertFalse(match.matchDstTcpUdpPort());
+ }
+
+ @Test
+ public void testMatchDstTcpUdpPort() {
+ assertTrue(match.matchDstTcpUdpPort());
+ }
+
+ @Test
+ public void testToString() {
+ FlowEntryMatch def = new FlowEntryMatch();
+ assertEquals("match default", def.toString(), "[]");
+
+ assertEquals("match set", match.toString(), "[inPort=1 srcMac=01:02:03:04:05:06 dstMac=06:05:04:03:02:01 ethernetFrameType=2 vlanId=3 vlanPriority=4 srcIPv4Net=127.0.0.1/32 dstIPv4Net=127.0.0.2/32 ipProto=5 ipToS=6 srcTcpUdpPort=7 dstTcpUdpPort=8]");
+ }
}
diff --git a/src/test/java/net/onrc/onos/core/util/FlowEntryTest.java b/src/test/java/net/onrc/onos/core/util/FlowEntryTest.java
index d877276..818abd5 100644
--- a/src/test/java/net/onrc/onos/core/util/FlowEntryTest.java
+++ b/src/test/java/net/onrc/onos/core/util/FlowEntryTest.java
@@ -2,6 +2,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+
import net.floodlightcontroller.util.MACAddress;
import org.junit.Before;
@@ -9,258 +10,258 @@
public class FlowEntryTest {
- FlowEntry entry;
-
- FlowId flowId = new FlowId(0x1234);
- FlowEntryId flowEntryId = new FlowEntryId(0x5678);
- int idleTimeout = 5;
- int hardTimeout = 10;
- int priority = 15;
- FlowEntryMatch match;
- FlowEntryActions actions;
-
- Dpid dpid = new Dpid(0xCAFE);
-
- Port inport = new Port((short)1);
- byte[] byte1 = { 1, 2, 3, 4, 5, 6 };
- byte[] byte2 = { 6, 5, 4, 3, 2, 1 };
- MACAddress mac1 = new MACAddress(byte1);
- MACAddress mac2 = new MACAddress(byte2);
- Short ether = Short.valueOf((short)2);
- Short vlanid = Short.valueOf((short)3);
- Byte vlanprio = Byte.valueOf((byte)4);
- IPv4Net ip1 = new IPv4Net("127.0.0.1/32");
- IPv4Net ip2 = new IPv4Net( new IPv4("127.0.0.2"), (short)32);
- IPv4 ipaddr1 = new IPv4("127.0.0.3");
- IPv4 ipaddr2 = new IPv4("127.0.0.4");
- Byte ipproto = Byte.valueOf((byte)5);
- Byte ipToS = Byte.valueOf((byte)6);
- Short tport1 = Short.valueOf((short)7);
- Short tport2 = Short.valueOf((short)8);
- Port outport = new Port((short)9);
- Port queueport = new Port((short)10);
- int queueId = 11;
-
- FlowEntryErrorState errorState = new FlowEntryErrorState( (short)12, (short)13);
+ FlowEntry entry;
-
- @Before
- public void setUp() throws Exception{
- entry = new FlowEntry();
+ FlowId flowId = new FlowId(0x1234);
+ FlowEntryId flowEntryId = new FlowEntryId(0x5678);
+ int idleTimeout = 5;
+ int hardTimeout = 10;
+ int priority = 15;
+ FlowEntryMatch match;
+ FlowEntryActions actions;
- flowId = new FlowId("0x1234");
- entry.setFlowId( flowId );
+ Dpid dpid = new Dpid(0xCAFE);
- flowEntryId = new FlowEntryId("0x5678");
- entry.setFlowEntryId(flowEntryId);
+ Port inport = new Port((short) 1);
+ byte[] byte1 = {1, 2, 3, 4, 5, 6};
+ byte[] byte2 = {6, 5, 4, 3, 2, 1};
+ MACAddress mac1 = new MACAddress(byte1);
+ MACAddress mac2 = new MACAddress(byte2);
+ Short ether = Short.valueOf((short) 2);
+ Short vlanid = Short.valueOf((short) 3);
+ Byte vlanprio = Byte.valueOf((byte) 4);
+ IPv4Net ip1 = new IPv4Net("127.0.0.1/32");
+ IPv4Net ip2 = new IPv4Net(new IPv4("127.0.0.2"), (short) 32);
+ IPv4 ipaddr1 = new IPv4("127.0.0.3");
+ IPv4 ipaddr2 = new IPv4("127.0.0.4");
+ Byte ipproto = Byte.valueOf((byte) 5);
+ Byte ipToS = Byte.valueOf((byte) 6);
+ Short tport1 = Short.valueOf((short) 7);
+ Short tport2 = Short.valueOf((short) 8);
+ Port outport = new Port((short) 9);
+ Port queueport = new Port((short) 10);
+ int queueId = 11;
- entry.setIdleTimeout(5);
- entry.setHardTimeout(10);
- entry.setPriority(15);
-
- dpid = new Dpid("CA:FE");
- entry.setDpid( dpid );
-
- entry.setInPort( inport );
- entry.setOutPort( outport );
+ FlowEntryErrorState errorState = new FlowEntryErrorState((short) 12, (short) 13);
- match = new FlowEntryMatch();
- match.enableInPort( inport);
- match.enableSrcMac( mac1 );
- match.enableDstMac( mac2 );
- match.enableEthernetFrameType( ether );
- match.enableVlanId( vlanid );
- match.enableVlanPriority( vlanprio );
- match.enableSrcIPv4Net( ip1 );
- match.enableDstIPv4Net( ip2 );
- match.enableIpProto( ipproto );
- match.enableIpToS( ipToS );
- match.enableSrcTcpUdpPort( tport1 );
- match.enableDstTcpUdpPort( tport2 );
-
- entry.setFlowEntryMatch( match );
-
- FlowEntryAction action = null;
- actions = entry.flowEntryActions();
-
- action = new FlowEntryAction();
- action.setActionOutput(outport);
- actions.addAction(action);
- action = new FlowEntryAction();
- action.setActionOutputToController((short)0);
- actions.addAction(action);
+ @Before
+ public void setUp() throws Exception {
+ entry = new FlowEntry();
- action = new FlowEntryAction();
- action.setActionSetVlanId(vlanid);
- actions.addAction(action);
+ flowId = new FlowId("0x1234");
+ entry.setFlowId(flowId);
- action = new FlowEntryAction();
- action.setActionSetVlanPriority(vlanprio);
- actions.addAction(action);
+ flowEntryId = new FlowEntryId("0x5678");
+ entry.setFlowEntryId(flowEntryId);
- action = new FlowEntryAction();
- action.setActionStripVlan(true);
- actions.addAction(action);
+ entry.setIdleTimeout(5);
+ entry.setHardTimeout(10);
+ entry.setPriority(15);
- action = new FlowEntryAction();
- action.setActionSetEthernetSrcAddr(mac1);
- actions.addAction(action);
+ dpid = new Dpid("CA:FE");
+ entry.setDpid(dpid);
- action = new FlowEntryAction();
- action.setActionSetEthernetDstAddr(mac2);
- actions.addAction(action);
+ entry.setInPort(inport);
+ entry.setOutPort(outport);
- action = new FlowEntryAction();
- action.setActionSetIPv4SrcAddr(ipaddr1);
- actions.addAction(action);
+ match = new FlowEntryMatch();
+ match.enableInPort(inport);
+ match.enableSrcMac(mac1);
+ match.enableDstMac(mac2);
+ match.enableEthernetFrameType(ether);
+ match.enableVlanId(vlanid);
+ match.enableVlanPriority(vlanprio);
+ match.enableSrcIPv4Net(ip1);
+ match.enableDstIPv4Net(ip2);
+ match.enableIpProto(ipproto);
+ match.enableIpToS(ipToS);
+ match.enableSrcTcpUdpPort(tport1);
+ match.enableDstTcpUdpPort(tport2);
- action = new FlowEntryAction();
- action.setActionSetIPv4DstAddr(ipaddr2);
- actions.addAction(action);
+ entry.setFlowEntryMatch(match);
- action = new FlowEntryAction();
- action.setActionSetIpToS(ipToS);
- actions.addAction(action);
+ FlowEntryAction action = null;
+ actions = entry.flowEntryActions();
- action = new FlowEntryAction();
- action.setActionSetTcpUdpSrcPort(tport1);
- actions.addAction(action);
+ action = new FlowEntryAction();
+ action.setActionOutput(outport);
+ actions.addAction(action);
- action = new FlowEntryAction();
- action.setActionSetTcpUdpDstPort(tport2);
- actions.addAction(action);
+ action = new FlowEntryAction();
+ action.setActionOutputToController((short) 0);
+ actions.addAction(action);
- action = new FlowEntryAction();
- action.setActionEnqueue(queueport, queueId);
- actions.addAction(action);
-
- entry.setFlowEntryUserState( FlowEntryUserState.FE_USER_ADD );
- entry.setFlowEntrySwitchState( FlowEntrySwitchState.FE_SWITCH_UPDATED );
- entry.setFlowEntryErrorState( errorState );
+ action = new FlowEntryAction();
+ action.setActionSetVlanId(vlanid);
+ actions.addAction(action);
- }
+ action = new FlowEntryAction();
+ action.setActionSetVlanPriority(vlanprio);
+ actions.addAction(action);
- @Test
- public void testFlowEntry(){
- FlowEntry e = new FlowEntry();
-
- assertTrue( e.flowEntryActions().isEmpty() );
- assertEquals("flowEntryUserState", FlowEntryUserState.FE_USER_UNKNOWN, e.flowEntryUserState() );
- assertEquals("flowEntrySwitchState", FlowEntrySwitchState.FE_SWITCH_UNKNOWN, e.flowEntrySwitchState() );
- }
+ action = new FlowEntryAction();
+ action.setActionStripVlan(true);
+ actions.addAction(action);
- @Test
- public void testFlowId(){
- assertEquals("flowId", flowId, entry.flowId() );
- }
+ action = new FlowEntryAction();
+ action.setActionSetEthernetSrcAddr(mac1);
+ actions.addAction(action);
- @Test
- public void testIsValidFlowId(){
- FlowEntry e = new FlowEntry();
+ action = new FlowEntryAction();
+ action.setActionSetEthernetDstAddr(mac2);
+ actions.addAction(action);
- // Test a Flow Entry with empty Flow ID
- assertEquals("isValidFlowId", false, e.isValidFlowId() );
+ action = new FlowEntryAction();
+ action.setActionSetIPv4SrcAddr(ipaddr1);
+ actions.addAction(action);
- // Test a Flow Entry with invalid Flow ID
- e.setFlowId(new FlowId());
- assertEquals("isValidFlowId", false, e.isValidFlowId() );
+ action = new FlowEntryAction();
+ action.setActionSetIPv4DstAddr(ipaddr2);
+ actions.addAction(action);
- // Test a Flow Entry with valid Flow ID
- e.setFlowId(new FlowId(0x1));
- assertEquals("isValidFlowId", true, e.isValidFlowId() );
- assertEquals("isValidFlowId", true, entry.isValidFlowId() );
- }
+ action = new FlowEntryAction();
+ action.setActionSetIpToS(ipToS);
+ actions.addAction(action);
- @Test
- public void testFlowEntryId(){
- assertEquals("flowEntryId", flowEntryId, entry.flowEntryId() );
- }
+ action = new FlowEntryAction();
+ action.setActionSetTcpUdpSrcPort(tport1);
+ actions.addAction(action);
- @Test
- public void testIsValidFlowEntryId(){
- FlowEntry e = new FlowEntry();
+ action = new FlowEntryAction();
+ action.setActionSetTcpUdpDstPort(tport2);
+ actions.addAction(action);
- // Test a Flow Entry with empty Flow Entry ID
- assertEquals("isValidFlowEntryId", false, e.isValidFlowEntryId() );
+ action = new FlowEntryAction();
+ action.setActionEnqueue(queueport, queueId);
+ actions.addAction(action);
- // Test a Flow Entry with invalid Flow Entry ID
- e.setFlowEntryId(new FlowEntryId());
- assertEquals("isValidFlowEntryId", false, e.isValidFlowEntryId() );
+ entry.setFlowEntryUserState(FlowEntryUserState.FE_USER_ADD);
+ entry.setFlowEntrySwitchState(FlowEntrySwitchState.FE_SWITCH_UPDATED);
+ entry.setFlowEntryErrorState(errorState);
- // Test a Flow Entry with valid Flow Entry ID
- e.setFlowEntryId(new FlowEntryId(0x1));
- assertEquals("isValidFlowEntryId", true, e.isValidFlowEntryId() );
- assertEquals("isValidFlowEntryId", true, entry.isValidFlowEntryId() );
- }
+ }
- @Test
- public void testIdleTimeout(){
- assertEquals("idleTimeout", idleTimeout, entry.idleTimeout() );
- }
+ @Test
+ public void testFlowEntry() {
+ FlowEntry e = new FlowEntry();
- @Test
- public void testHardTimeout(){
- assertEquals("hardTimeout", hardTimeout, entry.hardTimeout() );
- }
+ assertTrue(e.flowEntryActions().isEmpty());
+ assertEquals("flowEntryUserState", FlowEntryUserState.FE_USER_UNKNOWN, e.flowEntryUserState());
+ assertEquals("flowEntrySwitchState", FlowEntrySwitchState.FE_SWITCH_UNKNOWN, e.flowEntrySwitchState());
+ }
- @Test
- public void testPriority(){
- assertEquals("priority", priority, entry.priority() );
- }
+ @Test
+ public void testFlowId() {
+ assertEquals("flowId", flowId, entry.flowId());
+ }
- @Test
- public void testFlowEntryMatch(){
- assertEquals("flowEntryMatch", match, entry.flowEntryMatch() );
- }
+ @Test
+ public void testIsValidFlowId() {
+ FlowEntry e = new FlowEntry();
- @Test
- public void testFlowEntryActions(){
- assertEquals("flowEntryActions", actions, entry.flowEntryActions() );
- }
+ // Test a Flow Entry with empty Flow ID
+ assertEquals("isValidFlowId", false, e.isValidFlowId());
- @Test
- public void testSetFlowEntryActions(){
- FlowEntryActions actions = new FlowEntryActions();
- entry.setFlowEntryActions( actions );
- assertEquals("flowEntryActions", actions, entry.flowEntryActions() );
- }
+ // Test a Flow Entry with invalid Flow ID
+ e.setFlowId(new FlowId());
+ assertEquals("isValidFlowId", false, e.isValidFlowId());
- @Test
- public void testDpid(){
- assertEquals("dpid", dpid, entry.dpid() );
- }
+ // Test a Flow Entry with valid Flow ID
+ e.setFlowId(new FlowId(0x1));
+ assertEquals("isValidFlowId", true, e.isValidFlowId());
+ assertEquals("isValidFlowId", true, entry.isValidFlowId());
+ }
- @Test
- public void testInPort(){
- assertEquals("inPort", inport, entry.inPort() );
- }
+ @Test
+ public void testFlowEntryId() {
+ assertEquals("flowEntryId", flowEntryId, entry.flowEntryId());
+ }
- @Test
- public void testOutPort(){
- assertEquals("outPort", outport, entry.outPort() );
- }
+ @Test
+ public void testIsValidFlowEntryId() {
+ FlowEntry e = new FlowEntry();
- @Test
- public void testFlowEntryUserState(){
- assertEquals("flowEntryUserState", FlowEntryUserState.FE_USER_ADD, entry.flowEntryUserState() );
- }
+ // Test a Flow Entry with empty Flow Entry ID
+ assertEquals("isValidFlowEntryId", false, e.isValidFlowEntryId());
- @Test
- public void testFlowEntrySwitchState(){
- assertEquals("flowEntrySwitchState", FlowEntrySwitchState.FE_SWITCH_UPDATED, entry.flowEntrySwitchState() );
- }
+ // Test a Flow Entry with invalid Flow Entry ID
+ e.setFlowEntryId(new FlowEntryId());
+ assertEquals("isValidFlowEntryId", false, e.isValidFlowEntryId());
- @Test
- public void testFlowEntryErrorState(){
- assertEquals("flowEntryErrorState", errorState, entry.flowEntryErrorState() );
- }
+ // Test a Flow Entry with valid Flow Entry ID
+ e.setFlowEntryId(new FlowEntryId(0x1));
+ assertEquals("isValidFlowEntryId", true, e.isValidFlowEntryId());
+ assertEquals("isValidFlowEntryId", true, entry.isValidFlowEntryId());
+ }
- @Test
- public void testToString(){
- FlowEntry def = new FlowEntry();
- assertEquals("toString", def.toString(), "[ idleTimeout=0 hardTimeout=0 priority=32768 flowEntryActions=[] flowEntryUserState=FE_USER_UNKNOWN flowEntrySwitchState=FE_SWITCH_UNKNOWN]" );
- assertEquals("toString", entry.toString(), "[flowEntryId=0x5678 flowId=0x1234 idleTimeout=5 hardTimeout=10 priority=15 flowEntryMatch=[inPort=1 srcMac=01:02:03:04:05:06 dstMac=06:05:04:03:02:01 ethernetFrameType=2 vlanId=3 vlanPriority=4 srcIPv4Net=127.0.0.1/32 dstIPv4Net=127.0.0.2/32 ipProto=5 ipToS=6 srcTcpUdpPort=7 dstTcpUdpPort=8] flowEntryActions=[[type=ACTION_OUTPUT action=[port=9 maxLen=0]];[type=ACTION_OUTPUT action=[port=-3 maxLen=0]];[type=ACTION_SET_VLAN_VID action=[vlanId=3]];[type=ACTION_SET_VLAN_PCP action=[vlanPriority=4]];[type=ACTION_STRIP_VLAN action=[stripVlan=true]];[type=ACTION_SET_DL_SRC action=[addr=01:02:03:04:05:06]];[type=ACTION_SET_DL_DST action=[addr=06:05:04:03:02:01]];[type=ACTION_SET_NW_SRC action=[addr=127.0.0.3]];[type=ACTION_SET_NW_DST action=[addr=127.0.0.4]];[type=ACTION_SET_NW_TOS action=[ipToS=6]];[type=ACTION_SET_TP_SRC action=[port=7]];[type=ACTION_SET_TP_DST action=[port=8]];[type=ACTION_ENQUEUE action=[port=10 queueId=11]];] dpid=00:00:00:00:00:00:ca:fe inPort=1 outPort=9 flowEntryUserState=FE_USER_ADD flowEntrySwitchState=FE_SWITCH_UPDATED flowEntryErrorState=[type=12 code=13]]" );
- }
+ @Test
+ public void testIdleTimeout() {
+ assertEquals("idleTimeout", idleTimeout, entry.idleTimeout());
+ }
+
+ @Test
+ public void testHardTimeout() {
+ assertEquals("hardTimeout", hardTimeout, entry.hardTimeout());
+ }
+
+ @Test
+ public void testPriority() {
+ assertEquals("priority", priority, entry.priority());
+ }
+
+ @Test
+ public void testFlowEntryMatch() {
+ assertEquals("flowEntryMatch", match, entry.flowEntryMatch());
+ }
+
+ @Test
+ public void testFlowEntryActions() {
+ assertEquals("flowEntryActions", actions, entry.flowEntryActions());
+ }
+
+ @Test
+ public void testSetFlowEntryActions() {
+ FlowEntryActions actions = new FlowEntryActions();
+ entry.setFlowEntryActions(actions);
+ assertEquals("flowEntryActions", actions, entry.flowEntryActions());
+ }
+
+ @Test
+ public void testDpid() {
+ assertEquals("dpid", dpid, entry.dpid());
+ }
+
+ @Test
+ public void testInPort() {
+ assertEquals("inPort", inport, entry.inPort());
+ }
+
+ @Test
+ public void testOutPort() {
+ assertEquals("outPort", outport, entry.outPort());
+ }
+
+ @Test
+ public void testFlowEntryUserState() {
+ assertEquals("flowEntryUserState", FlowEntryUserState.FE_USER_ADD, entry.flowEntryUserState());
+ }
+
+ @Test
+ public void testFlowEntrySwitchState() {
+ assertEquals("flowEntrySwitchState", FlowEntrySwitchState.FE_SWITCH_UPDATED, entry.flowEntrySwitchState());
+ }
+
+ @Test
+ public void testFlowEntryErrorState() {
+ assertEquals("flowEntryErrorState", errorState, entry.flowEntryErrorState());
+ }
+
+ @Test
+ public void testToString() {
+ FlowEntry def = new FlowEntry();
+ assertEquals("toString", def.toString(), "[ idleTimeout=0 hardTimeout=0 priority=32768 flowEntryActions=[] flowEntryUserState=FE_USER_UNKNOWN flowEntrySwitchState=FE_SWITCH_UNKNOWN]");
+ assertEquals("toString", entry.toString(), "[flowEntryId=0x5678 flowId=0x1234 idleTimeout=5 hardTimeout=10 priority=15 flowEntryMatch=[inPort=1 srcMac=01:02:03:04:05:06 dstMac=06:05:04:03:02:01 ethernetFrameType=2 vlanId=3 vlanPriority=4 srcIPv4Net=127.0.0.1/32 dstIPv4Net=127.0.0.2/32 ipProto=5 ipToS=6 srcTcpUdpPort=7 dstTcpUdpPort=8] flowEntryActions=[[type=ACTION_OUTPUT action=[port=9 maxLen=0]];[type=ACTION_OUTPUT action=[port=-3 maxLen=0]];[type=ACTION_SET_VLAN_VID action=[vlanId=3]];[type=ACTION_SET_VLAN_PCP action=[vlanPriority=4]];[type=ACTION_STRIP_VLAN action=[stripVlan=true]];[type=ACTION_SET_DL_SRC action=[addr=01:02:03:04:05:06]];[type=ACTION_SET_DL_DST action=[addr=06:05:04:03:02:01]];[type=ACTION_SET_NW_SRC action=[addr=127.0.0.3]];[type=ACTION_SET_NW_DST action=[addr=127.0.0.4]];[type=ACTION_SET_NW_TOS action=[ipToS=6]];[type=ACTION_SET_TP_SRC action=[port=7]];[type=ACTION_SET_TP_DST action=[port=8]];[type=ACTION_ENQUEUE action=[port=10 queueId=11]];] dpid=00:00:00:00:00:00:ca:fe inPort=1 outPort=9 flowEntryUserState=FE_USER_ADD flowEntrySwitchState=FE_SWITCH_UPDATED flowEntryErrorState=[type=12 code=13]]");
+ }
}