diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntry.java b/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntry.java
index 049e783..762d272 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntry.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntry.java
@@ -1,6 +1,5 @@
 package net.onrc.onos.ofcontroller.util;
 
-import java.util.ArrayList;
 
 import org.codehaus.jackson.annotate.JsonIgnore;
 import org.codehaus.jackson.annotate.JsonProperty;
@@ -326,17 +325,32 @@
      */
     @Override
     public String toString() {
-	String ret = "[flowEntryId=" + this.flowEntryId.toString();
-	ret += " flowEntryMatch=" + this.flowEntryMatch.toString();
-	ret += " flowEntryActions=" + this.flowEntryActions.toString();
-	ret += " dpid=" + this.dpid.toString();
-	ret += " inPort=" + this.inPort.toString();
-	ret += " outPort=" + this.outPort.toString();
-	ret += " flowEntryUserState=" + this.flowEntryUserState;
-	ret += " flowEntrySwitchState=" + this.flowEntrySwitchState;
-	ret += " flowEntryErrorState=" + this.flowEntryErrorState.toString();
-	ret += "]";
+	StringBuilder ret = new StringBuilder();
+	if ( flowEntryId != null ) {
+		ret.append("[flowEntryId=" + this.flowEntryId.toString());
+	} else {
+		ret.append("[");
+	}
+	if ( flowEntryMatch != null ) {
+		ret.append(" flowEntryMatch=" + this.flowEntryMatch.toString());
+	}
+	ret.append( " flowEntryActions=" + this.flowEntryActions.toString() );
+	if ( dpid != null ) {
+		ret.append(" dpid=" + this.dpid.toString());
+	}
+	if ( inPort != null ) {
+		ret.append(" inPort=" + this.inPort.toString());
+	}
+	if ( outPort != null ) {
+		ret.append(" outPort=" + this.outPort.toString());
+	}
+	ret.append(" flowEntryUserState=" + this.flowEntryUserState);
+	ret.append(" flowEntrySwitchState=" + this.flowEntrySwitchState);
+	if ( flowEntryErrorState != null ) {
+		ret.append(" flowEntryErrorState=" + this.flowEntryErrorState.toString());
+	}
+	ret.append("]");
 
-	return ret;
+	return ret.toString();
     }
 }
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
index 153e184..c1b2f9f 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
@@ -168,7 +168,7 @@
 	    {
 		FlowEntryActions actions = new FlowEntryActions();
 
-		String actionsStr = flowObj.getActions();
+		String actionsStr = flowEntryObj.getActions();
 		if (actions != null)
 		    actions = new FlowEntryActions(actionsStr);
 
diff --git a/src/test/java/net/onrc/onos/ofcontroller/util/FlowEntryActionTest.java b/src/test/java/net/onrc/onos/ofcontroller/util/FlowEntryActionTest.java
new file mode 100644
index 0000000..4db734c
--- /dev/null
+++ b/src/test/java/net/onrc/onos/ofcontroller/util/FlowEntryActionTest.java
@@ -0,0 +1,427 @@
+package net.onrc.onos.ofcontroller.util;
+
+import static org.junit.Assert.assertEquals;
+import net.floodlightcontroller.util.MACAddress;
+import net.onrc.onos.ofcontroller.util.FlowEntryAction.ActionEnqueue;
+import net.onrc.onos.ofcontroller.util.FlowEntryAction.ActionOutput;
+import net.onrc.onos.ofcontroller.util.FlowEntryAction.ActionSetEthernetAddr;
+import net.onrc.onos.ofcontroller.util.FlowEntryAction.ActionSetIPv4Addr;
+import net.onrc.onos.ofcontroller.util.FlowEntryAction.ActionSetIpToS;
+import net.onrc.onos.ofcontroller.util.FlowEntryAction.ActionSetTcpUdpPort;
+import net.onrc.onos.ofcontroller.util.FlowEntryAction.ActionSetVlanId;
+import net.onrc.onos.ofcontroller.util.FlowEntryAction.ActionSetVlanPriority;
+import net.onrc.onos.ofcontroller.util.FlowEntryAction.ActionStripVlan;
+
+import org.junit.Test;
+
+public class FlowEntryActionTest {
+
+	@Test
+	public void testSetActionOutputActionOutput(){
+		FlowEntryAction act = new FlowEntryAction();
+		ActionOutput actout = act.new 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());
+
+		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());
+	}
+
+	@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());
+
+		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);
+
+		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());
+	}
+
+	@Test
+	public void testSetActionSetVlanIdActionSetVlanId(){
+		FlowEntryAction act = new FlowEntryAction();
+		ActionSetVlanId actVlan = act.new 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());
+
+		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());
+	}
+
+	@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());
+
+		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 = act.new 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());
+
+		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());
+	}
+
+	@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());
+
+		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 = act.new 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());
+
+		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());
+	}
+
+	@Test
+	public void testSetActionStripVlanBoolean(){
+		FlowEntryAction act = new FlowEntryAction();
+		act.setActionStripVlan(true);
+
+		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());
+	}
+
+	@Test
+	public void testSetActionSetEthernetSrcAddrActionSetEthernetAddr(){
+		FlowEntryAction act = new FlowEntryAction();
+		byte[] mac = { 1, 2, 3, 4, 5, 6 };
+		ActionSetEthernetAddr setEth = act.new 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());
+
+		
+		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());
+	}
+
+	@Test
+	public void testSetActionSetEthernetSrcAddrMACAddress(){
+		FlowEntryAction act = new FlowEntryAction();
+		byte[] mac = { 1, 2, 3, 4, 5, 6 };
+		act.setActionSetEthernetSrcAddr(new MACAddress(mac));
+
+		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());
+	}
+
+	@Test
+	public void testSetActionSetEthernetDstAddrActionSetEthernetAddr(){
+		FlowEntryAction act = new FlowEntryAction();
+		byte[] mac = { 1, 2, 3, 4, 5, 6 };
+		ActionSetEthernetAddr setEth = act.new ActionSetEthernetAddr(new MACAddress(mac));
+		act.setActionSetEthernetDstAddr( setEth );
+
+		assertEquals("action type",FlowEntryAction.ActionValues.ACTION_SET_DL_DST , act.actionType());
+		assertEquals("addr should be the same", setEth.addr(), act.actionSetEthernetDstAddr().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());
+	}
+
+	@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());
+
+		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 = act.new 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());
+
+		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());
+	}
+
+	@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());
+
+		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 = act.new 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());
+
+		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());
+	}
+
+	@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());
+
+		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 = act.new 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());
+
+		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());
+	}
+
+	@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());
+
+		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 = act.new 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());
+
+		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());
+	}
+
+	@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());
+
+		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 = act.new 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());
+
+		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());
+	}
+
+	@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());
+
+		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 = act.new 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());
+
+		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());
+	}
+
+	@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());
+
+		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/ofcontroller/util/FlowEntryMatchTest.java b/src/test/java/net/onrc/onos/ofcontroller/util/FlowEntryMatchTest.java
new file mode 100644
index 0000000..4381208
--- /dev/null
+++ b/src/test/java/net/onrc/onos/ofcontroller/util/FlowEntryMatchTest.java
@@ -0,0 +1,312 @@
+package net.onrc.onos.ofcontroller.util;
+
+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;
+import org.junit.Test;
+
+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 );
+	}
+
+	@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 testFlowEntryMatchFlowEntryMatch(){
+		FlowEntryMatch def_base = new FlowEntryMatch();
+		FlowEntryMatch def = new FlowEntryMatch(def_base);
+
+		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 testInPort(){
+		assertEquals("inport", inport, match.inPort() );
+	}
+
+	@Test
+	public void testDisableInPort(){
+		match.disableInPort();
+		assertEquals("inport", null, match.inPort() );
+		assertFalse( match.matchInPort() );
+	}
+
+	@Test
+	public void testMatchInPort(){
+		assertTrue( match.matchInPort() );
+	}
+
+	@Test
+	public void testSrcMac(){
+		assertEquals("mac1", mac1, match.srcMac() );
+	}
+
+	@Test
+	public void testDisableSrcMac(){
+		match.disableSrcMac();
+		assertEquals("srcMac", null, match.srcMac() );
+		assertFalse( match.matchSrcMac() );
+	}
+
+	@Test
+	public void testMatchSrcMac(){
+		assertTrue( match.matchSrcMac() );
+	}
+
+	@Test
+	public void testDstMac(){
+		assertEquals("mac2", mac2, match.dstMac() );
+	}
+
+	@Test
+	public void testDisableDstMac(){
+		match.disableDstMac();
+		assertEquals("dstMac", null, match.dstMac() );
+		assertFalse( match.matchDstMac() );
+	}
+
+	@Test
+	public void testMatchDstMac(){
+		assertTrue( match.matchDstMac() );
+	}
+
+	@Test
+	public void testEthernetFrameType(){
+		assertEquals("ether", ether, match.ethernetFrameType() );
+	}
+
+	@Test
+	public void testDisableEthernetFrameType(){
+		match.disableEthernetFrameType();
+		assertEquals("ethernetFrameType", null, match.ethernetFrameType() );
+		assertFalse( match.matchEthernetFrameType() );
+	}
+
+	@Test
+	public void testMatchEthernetFrameType(){
+		assertTrue( match.matchEthernetFrameType() );
+	}
+
+	@Test
+	public void testVlanId(){
+		assertEquals("vlan id", vlanid, match.vlanId() );
+	}
+
+	@Test
+	public void testDisableVlanId(){
+		match.disableVlanId();
+		assertEquals("vlanId", null, match.vlanId() );
+		assertFalse( match.matchVlanId() );
+	}
+
+	@Test
+	public void testMatchVlanId(){
+		assertTrue( match.matchVlanId() );
+	}
+
+	@Test
+	public void testVlanPriority(){
+		assertEquals("vlan prio", vlanprio, match.vlanPriority() );
+	}
+
+	@Test
+	public void testDisableVlanPriority(){
+		match.disableVlanPriority();
+		assertEquals("vlanPriority", null, match.vlanPriority() );
+		assertFalse( match.matchVlanPriority() );
+	}
+
+	@Test
+	public void testMatchVlanPriority(){
+		assertTrue( match.matchVlanPriority() );
+	}
+
+	@Test
+	public void testSrcIPv4Net(){
+		assertEquals("ip1", ip1, match.srcIPv4Net() );
+	}
+
+	@Test
+	public void testDisableSrcIPv4Net(){
+		match.disableSrcIPv4Net();
+		assertEquals("srcIPv4Net", null, match.srcIPv4Net() );
+		assertFalse( match.matchSrcIPv4Net() );
+	}
+
+	@Test
+	public void testMatchSrcIPv4Net(){
+		assertTrue( match.matchSrcIPv4Net() );
+	}
+
+	@Test
+	public void testDstIPv4Net(){
+		assertEquals("ip2", ip2, match.dstIPv4Net() );
+	}
+
+	@Test
+	public void testDisableDstIPv4Net(){
+		match.disableDstIPv4Net();
+		assertEquals("dstIPv4Net", null, match.dstIPv4Net() );
+		assertFalse( match.matchDstIPv4Net() );
+	}
+
+	@Test
+	public void testMatchDstIPv4Net(){
+		assertTrue( match.matchDstIPv4Net() );
+	}
+
+	@Test
+	public void testIpProto(){
+		assertEquals("ip proto", ipproto, match.ipProto() );
+	}
+
+	@Test
+	public void testDisableIpProto(){
+		match.disableIpProto();
+		assertEquals("ipProto", null, match.ipProto() );
+		assertFalse( match.matchIpProto() );
+	}
+
+	@Test
+	public void testMatchIpProto(){
+		assertTrue( match.matchIpProto() );
+	}
+
+	@Test
+	public void testIpToS(){
+		assertEquals("tos", ipToS, match.ipToS() );
+	}
+
+	@Test
+	public void testDisableIpToS(){
+		match.disableIpToS();
+		assertEquals("ipToS", null, match.ipToS() );
+		assertFalse( match.matchIpToS() );
+	}
+
+	@Test
+	public void testMatchIpToS(){
+		assertTrue( match.matchIpToS() );
+	}
+
+	@Test
+	public void testSrcTcpUdpPort(){
+		assertEquals("src port", tport1, match.srcTcpUdpPort() );
+	}
+
+	@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/ofcontroller/util/FlowEntryTest.java b/src/test/java/net/onrc/onos/ofcontroller/util/FlowEntryTest.java
new file mode 100644
index 0000000..1d193c4
--- /dev/null
+++ b/src/test/java/net/onrc/onos/ofcontroller/util/FlowEntryTest.java
@@ -0,0 +1,210 @@
+package net.onrc.onos.ofcontroller.util;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import net.floodlightcontroller.util.MACAddress;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class FlowEntryTest {
+
+	FlowEntry entry;
+	
+	FlowId flowId = new FlowId(0x1234);
+	FlowEntryId flowEntryId = new FlowEntryId(0x5678);
+	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);
+
+	
+	@Before
+	public void setUp() throws Exception{
+		entry = new FlowEntry();
+
+		flowId = new FlowId("0x1234");
+		entry.setFlowId( flowId );
+
+		flowEntryId = new FlowEntryId("0x5678");
+		entry.setFlowEntryId(flowEntryId);
+		
+		dpid = new Dpid("CA:FE");
+		entry.setDpid( dpid );
+		
+		entry.setInPort( inport );
+		entry.setOutPort( outport );
+
+		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);
+
+		action = new FlowEntryAction();
+		action.setActionSetVlanId(vlanid);
+		actions.addAction(action);
+
+		action = new FlowEntryAction();
+		action.setActionSetVlanPriority(vlanprio);
+		actions.addAction(action);
+
+		action = new FlowEntryAction();
+		action.setActionStripVlan(true);
+		actions.addAction(action);
+
+		action = new FlowEntryAction();
+		action.setActionSetEthernetSrcAddr(mac1);
+		actions.addAction(action);
+
+		action = new FlowEntryAction();
+		action.setActionSetEthernetDstAddr(mac2);
+		actions.addAction(action);
+
+		action = new FlowEntryAction();
+		action.setActionSetIPv4SrcAddr(ipaddr1);
+		actions.addAction(action);
+
+		action = new FlowEntryAction();
+		action.setActionSetIPv4DstAddr(ipaddr2);
+		actions.addAction(action);
+
+		action = new FlowEntryAction();
+		action.setActionSetIpToS(ipToS);
+		actions.addAction(action);
+
+		action = new FlowEntryAction();
+		action.setActionSetTcpUdpSrcPort(tport1);
+		actions.addAction(action);
+
+		action = new FlowEntryAction();
+		action.setActionSetTcpUdpDstPort(tport2);
+		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 );
+
+	}
+
+	@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() );
+	}
+
+	@Test
+	public void testGetFlowId(){
+		assertEquals("flowId", flowId, entry.getFlowId() );
+	}
+
+	@Test
+	public void testFlowEntryId(){
+		assertEquals("flowEntryId", flowEntryId, entry.flowEntryId() );
+	}
+
+	@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( def.toString(), "[ flowEntryActions=[] flowEntryUserState=FE_USER_UNKNOWN flowEntrySwitchState=FE_SWITCH_UNKNOWN]" );
+		assertEquals( entry.toString(), "[flowEntryId=0x5678 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]]" );
+	}
+
+}
diff --git a/src/test/java/net/onrc/onos/ofcontroller/util/FlowPathTest.java b/src/test/java/net/onrc/onos/ofcontroller/util/FlowPathTest.java
new file mode 100644
index 0000000..89a12e5
--- /dev/null
+++ b/src/test/java/net/onrc/onos/ofcontroller/util/FlowPathTest.java
@@ -0,0 +1,182 @@
+package net.onrc.onos.ofcontroller.util;
+
+import static org.junit.Assert.*;
+import net.onrc.onos.ofcontroller.core.internal.TestableGraphDBOperation.TestFlowEntry;
+import net.onrc.onos.ofcontroller.core.internal.TestableGraphDBOperation.TestFlowPath;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class FlowPathTest {
+
+	FlowPath flowPath;
+	
+	@Before
+	public void setUp() throws Exception{
+		TestFlowPath iFlowPath = new TestFlowPath();
+		iFlowPath.setFlowIdForTest("0x1234");
+		iFlowPath.setInstallerIdForTest("installerId");
+		iFlowPath.setFlowPathFlagsForTest(0L);
+		iFlowPath.setSrcSwForTest("CA:FE");
+		iFlowPath.setSrcPortForTest((short)1);
+		iFlowPath.setDstSwForTest("BA:BE");
+		iFlowPath.setDstPortForTest((short)2);
+		
+		iFlowPath.setActionsForTest("[[type=ACTION_OUTPUT action=[port=10 maxLen=11]];[type=ACTION_OUTPUT action=[port=12 maxLen=13]];]");
+		
+		TestFlowEntry iFlowEntry = new TestFlowEntry();
+		iFlowEntry.setEntryIdForTest("0x14");
+		iFlowEntry.setDpidForTest("BE:EF");
+		iFlowEntry.setActionsForTest("[[type=ACTION_OUTPUT action=[port=23 maxLen=24]];[type=ACTION_OUTPUT action=[port=25 maxLen=26]];]");
+		iFlowEntry.setUserStateForTest("FE_USER_MODIFY");
+		iFlowEntry.setSwitchStateForTest("FE_SWITCH_UPDATE_IN_PROGRESS");
+		iFlowPath.addFlowEntryForTest(iFlowEntry);
+		
+		flowPath = new FlowPath(iFlowPath);
+	}
+
+	@Test
+	public void testFlowPath(){
+		FlowPath flowPath = new FlowPath();
+		assertFalse( flowPath.flowPathFlags().isDiscardFirstHopEntry() );
+		assertFalse( flowPath.flowPathFlags().isKeepOnlyFirstHopEntry() );
+		assertTrue( flowPath.flowEntryActions().isEmpty() );
+	}
+
+	@Test
+	public void testFlowPathIFlowPath(){
+		TestFlowPath iFlowPath = new TestFlowPath();
+		iFlowPath.setFlowIdForTest("0x1234");
+		iFlowPath.setInstallerIdForTest("installerId");
+		iFlowPath.setFlowPathFlagsForTest(0L);
+		iFlowPath.setSrcSwForTest("CA:FE");
+		iFlowPath.setSrcPortForTest((short)1);
+		iFlowPath.setDstSwForTest("BA:BE");
+		iFlowPath.setDstPortForTest((short)2);
+		
+		iFlowPath.setMatchSrcMacForTest("01:02:03:04:05:06");
+		iFlowPath.setMatchDstMacForTest("06:05:04:03:02:01");
+		iFlowPath.setMatchEthernetFrameTypeForTest((short)3);
+		iFlowPath.setMatchVlanIdForTest((short)4);
+		iFlowPath.setMatchVlanPriorityForTest((byte)5);
+		iFlowPath.setMatchSrcIpaddrForTest("127.0.0.1/32");
+		iFlowPath.setMatchDstIpaddrForTest("127.0.0.2/32");
+		iFlowPath.setMatchIpProtoForTest((byte)6);
+		iFlowPath.setMatchIpToSForTest((byte)7);
+		iFlowPath.setMatchSrcTcpUdpPortForTest((short)8);
+		iFlowPath.setMatchDstTcpUdpPortForTest((short)9);
+		
+		iFlowPath.setActionsForTest("[[type=ACTION_OUTPUT action=[port=10 maxLen=11]];[type=ACTION_OUTPUT action=[port=12 maxLen=13]];]");
+		
+		TestFlowEntry iFlowEntry = new TestFlowEntry();
+		iFlowEntry.setEntryIdForTest("0x14");
+		iFlowEntry.setDpidForTest("BE:EF");
+		iFlowEntry.setMatchInPortForTest((short)15);
+		iFlowEntry.setMatchSrcMacForTest("11:22:33:44:55:66");
+		iFlowEntry.setMatchDstMacForTest("66:55:44:33:22:11");
+		iFlowEntry.setMatchEtherFrameTypeForTest((short)16);
+		iFlowEntry.setMatchVlanIdForTest((short)17);
+		iFlowEntry.setMatchVlanPriorityForTest((byte)18);
+		iFlowEntry.setMatchSrcIpaddrForTest("127.0.0.3/32");
+		iFlowEntry.setMatchDstIpaddrForTest("127.0.0.4/32");
+		iFlowEntry.setMatchIpProtoForTest((byte)19);
+		iFlowEntry.setMatchIpToSForTest((byte)20);
+		iFlowEntry.setMatchSrcTcpUdpPortForTest((short)21);
+		iFlowEntry.setMatchDstTcpUdpPortForTest((short)22);
+		iFlowEntry.setActionsForTest("[[type=ACTION_OUTPUT action=[port=23 maxLen=24]];[type=ACTION_OUTPUT action=[port=25 maxLen=26]];]");
+		iFlowEntry.setUserStateForTest("FE_USER_MODIFY");
+		iFlowEntry.setSwitchStateForTest("FE_SWITCH_UPDATE_IN_PROGRESS");
+		iFlowPath.addFlowEntryForTest(iFlowEntry);
+		
+		FlowPath flowPath = new FlowPath(iFlowPath);
+		assertEquals(flowPath.flowId().value(), 0x1234);
+		assertEquals(flowPath.installerId().value(), "installerId");
+		assertEquals(flowPath.flowPathFlags().flags(), 0);
+		assertEquals(flowPath.dataPath().srcPort().dpid().value(), 0xCAFE);
+		assertEquals(flowPath.dataPath().srcPort().port().value(), 1);
+		assertEquals(flowPath.dataPath().dstPort().dpid().value(), 0xBABE);
+		assertEquals(flowPath.dataPath().dstPort().port().value(), 2);
+		
+		assertEquals(flowPath.flowEntryMatch().srcMac().toString(), "01:02:03:04:05:06");
+		assertEquals(flowPath.flowEntryMatch().dstMac().toString(), "06:05:04:03:02:01");
+		assertEquals(flowPath.flowEntryMatch().ethernetFrameType().shortValue(), 3);
+		assertEquals(flowPath.flowEntryMatch().vlanId().shortValue(), 4);
+		assertEquals(flowPath.flowEntryMatch().vlanPriority().shortValue(), 5);
+		assertEquals(flowPath.flowEntryMatch().srcIPv4Net().address().toString(), "127.0.0.1");
+		assertEquals(flowPath.flowEntryMatch().srcIPv4Net().prefixLen() , 32);
+		assertEquals(flowPath.flowEntryMatch().dstIPv4Net().address().toString(), "127.0.0.2");
+		assertEquals(flowPath.flowEntryMatch().dstIPv4Net().prefixLen() , 32);
+		assertEquals(flowPath.flowEntryMatch().ipProto().byteValue(), 6);
+		assertEquals(flowPath.flowEntryMatch().ipToS().byteValue(), 7);
+		assertEquals(flowPath.flowEntryMatch().srcTcpUdpPort().shortValue(), 8);
+		assertEquals(flowPath.flowEntryMatch().dstTcpUdpPort().shortValue(), 9);
+		
+		assertEquals(flowPath.flowEntryActions().toString(),"[[type=ACTION_OUTPUT action=[port=10 maxLen=11]];[type=ACTION_OUTPUT action=[port=12 maxLen=13]];]");
+		
+		assertEquals(0x14, flowPath.dataPath().flowEntries().get(0).flowEntryId().value() );
+		assertEquals(0xBEEF, flowPath.dataPath().flowEntries().get(0).dpid().value() );
+		assertEquals(15, flowPath.dataPath().flowEntries().get(0).flowEntryMatch().inPort().value() );
+		assertEquals("11:22:33:44:55:66", flowPath.dataPath().flowEntries().get(0).flowEntryMatch().srcMac().toString());
+		assertEquals("66:55:44:33:22:11", flowPath.dataPath().flowEntries().get(0).flowEntryMatch().dstMac().toString());
+		assertEquals(16, flowPath.dataPath().flowEntries().get(0).flowEntryMatch().ethernetFrameType().shortValue());
+		assertEquals(17, flowPath.dataPath().flowEntries().get(0).flowEntryMatch().vlanId().shortValue());
+		assertEquals(18, flowPath.dataPath().flowEntries().get(0).flowEntryMatch().vlanPriority().byteValue());
+		assertEquals("127.0.0.3", flowPath.dataPath().flowEntries().get(0).flowEntryMatch().srcIPv4Net().address().toString());
+		assertEquals(32, flowPath.dataPath().flowEntries().get(0).flowEntryMatch().srcIPv4Net().prefixLen());
+		assertEquals("127.0.0.4", flowPath.dataPath().flowEntries().get(0).flowEntryMatch().dstIPv4Net().address().toString());
+		assertEquals(32, flowPath.dataPath().flowEntries().get(0).flowEntryMatch().dstIPv4Net().prefixLen());
+		assertEquals(19, flowPath.dataPath().flowEntries().get(0).flowEntryMatch().ipProto().byteValue());
+		assertEquals(20, flowPath.dataPath().flowEntries().get(0).flowEntryMatch().ipToS().byteValue());
+		assertEquals(21, flowPath.dataPath().flowEntries().get(0).flowEntryMatch().srcTcpUdpPort().shortValue());
+		assertEquals(22, flowPath.dataPath().flowEntries().get(0).flowEntryMatch().dstTcpUdpPort().shortValue());
+		assertEquals("[[type=ACTION_OUTPUT action=[port=23 maxLen=24]];[type=ACTION_OUTPUT action=[port=25 maxLen=26]];]", flowPath.dataPath().flowEntries().get(0).flowEntryActions().toString());
+		assertEquals("FE_USER_MODIFY", flowPath.dataPath().flowEntries().get(0).flowEntryUserState().toString());
+		assertEquals("FE_SWITCH_UPDATE_IN_PROGRESS", flowPath.dataPath().flowEntries().get(0).flowEntrySwitchState().toString());
+	}
+
+
+	@Test
+	public void testFlowPathFlags(){
+		FlowPath flowPath = new FlowPath();
+		FlowPathFlags flags = new FlowPathFlags();
+		flags.setFlags(0);
+		flowPath.setFlowPathFlags( flags );
+		assertFalse( flowPath.flowPathFlags().isDiscardFirstHopEntry() );
+		assertFalse( flowPath.flowPathFlags().isKeepOnlyFirstHopEntry() );
+	}
+
+	@Test
+	public void testSetFlowPathFlags(){
+		FlowPath flowPath = new FlowPath();
+		FlowPathFlags flags = new FlowPathFlags("DISCARD_FIRST_HOP_ENTRY");
+		flags.setFlagsStr("KEEP_ONLY_FIRST_HOP_ENTRY");
+		flowPath.setFlowPathFlags( flags );
+		assertFalse( flowPath.flowPathFlags().isDiscardFirstHopEntry() );
+		assertTrue( flowPath.flowPathFlags().isKeepOnlyFirstHopEntry() );
+	}
+
+	@Test
+	public void testSetDataPath(){
+		FlowPath flowPath = new FlowPath();
+		DataPath dataPath = new DataPath();
+		flowPath.setDataPath( dataPath );
+		assertEquals(flowPath.dataPath(), dataPath );
+	}
+
+	@Test
+	public void testToString(){
+
+		assertEquals("[flowId=0x1234 installerId=installerId flowPathFlags=[flags=] dataPath=[src=00:00:00:00:00:00:ca:fe/1 flowEntry=[flowEntryId=0x14 flowEntryMatch=[] flowEntryActions=[[type=ACTION_OUTPUT action=[port=23 maxLen=24]];[type=ACTION_OUTPUT action=[port=25 maxLen=26]];] dpid=00:00:00:00:00:00:be:ef flowEntryUserState=FE_USER_MODIFY flowEntrySwitchState=FE_SWITCH_UPDATE_IN_PROGRESS] dst=00:00:00:00:00:00:ba:be/2] flowEntryMatch=[] flowEntryActions=[[type=ACTION_OUTPUT action=[port=10 maxLen=11]];[type=ACTION_OUTPUT action=[port=12 maxLen=13]];]]", flowPath.toString());
+	}
+
+	@Test
+	public void testCompareTo(){
+		FlowPath flowPath1 = new FlowPath();
+		flowPath1.setFlowId( new FlowId(1));
+		FlowPath flowPath2 = new FlowPath();
+		flowPath2.setFlowId( new FlowId(2));
+		
+		assertTrue( flowPath1.compareTo(flowPath2) < 0);
+	}
+
+}
