diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java b/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java
index d08da7c..3a5c9e2 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java
@@ -14,6 +14,12 @@
 import com.tinkerpop.frames.annotations.gremlin.GremlinParam;
 import com.tinkerpop.frames.VertexFrame;
 
+/*
+ * This is the interfaces to make the objects for Cassandra DB.
+ * They are interfaces, but it is also implementation,
+ * so this handles various control to the objects.  
+ * Please take a look at tinkerpop/frames annotation doc to understand more.
+ */
 public interface INetMapTopologyObjects {
 	
 public interface IBaseObject extends VertexFrame {
@@ -62,7 +68,7 @@
 		public Iterable<IDeviceObject> getDevices();
 		
 		@JsonIgnore
-		@Incidence(label="switch",direction = Direction.IN)
+		@Adjacency(label="switch",direction = Direction.IN)
 		public Iterable<IFlowEntry> getFlowEntries();
 
 	}
@@ -114,11 +120,11 @@
 		public void removeDevice(final IDeviceObject device);
 		
 		@JsonIgnore
-		@Incidence(label="inport",direction = Direction.IN)
+		@Adjacency(label="inport",direction = Direction.IN)
 		public Iterable<IFlowEntry> getInFlowEntries();
 		
 		@JsonIgnore
-		@Incidence(label="outport",direction = Direction.IN)
+		@Adjacency(label="outport",direction = Direction.IN)
 		public Iterable<IFlowEntry> getOutFlowEntries();
 		
 		@JsonIgnore
@@ -155,11 +161,11 @@
 		public Iterable<IPortObject> getAttachedPorts();
 			
 		@JsonIgnore
-		@Incidence(label="host",direction=Direction.IN)
+		@Adjacency(label="host",direction=Direction.IN)
 		public void setHostPort(final IPortObject port);
 		
 		@JsonIgnore
-		@Incidence(label="host",direction=Direction.IN)
+		@Adjacency(label="host",direction=Direction.IN)
 		public void removeHostPort(final IPortObject port);
 		
 		@JsonIgnore
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImpl.java b/src/main/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImpl.java
index 03a5e8e..126efb3 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImpl.java
@@ -72,7 +72,8 @@
 		
 		log.info("SwitchStorage:addSwitch(): dpid {} ", dpid);
 		try {
-			newSwitch(dpid);
+			ISwitchObject sw = newSwitch(dpid);
+			if ( sw == null ) throw new RuntimeException();
             op.commit();
 		} catch (Exception e) {
 			e.printStackTrace();
diff --git a/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIDeviceObjectTest.java b/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIDeviceObjectTest.java
new file mode 100644
index 0000000..3ea90ba
--- /dev/null
+++ b/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIDeviceObjectTest.java
@@ -0,0 +1,206 @@
+package net.onrc.onos.ofcontroller.core;
+
+import static org.junit.Assert.*;
+
+import java.util.HashMap;
+
+import net.onrc.onos.graph.GraphDBConnection;
+import net.onrc.onos.graph.GraphDBOperation;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IDeviceObject;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
+import net.onrc.onos.ofcontroller.core.internal.SwitchStorageImpl;
+import net.onrc.onos.ofcontroller.core.internal.TestDatabaseManager;
+import org.easymock.EasyMock;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.powermock.api.easymock.PowerMock;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.slf4j.LoggerFactory;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+import com.thinkaurelius.titan.core.TitanFactory;
+import com.thinkaurelius.titan.core.TitanGraph;
+
+//Add Powermock preparation
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({TitanFactory.class, GraphDBConnection.class, GraphDBOperation.class, SwitchStorageImpl.class})
+public class INetMapTopologyObjectsIDeviceObjectTest {
+	
+	//The test network is ./titan/schema/test-network.xml
+
+	protected static org.slf4j.Logger log = LoggerFactory.getLogger(SwitchStorageImpl.class);
+
+	String conf;
+    private GraphDBConnection conn = null;
+    private GraphDBOperation ope = null;
+    private TitanGraph titanGraph = null;
+	
+	@Before
+	public void setUp() throws Exception {
+		conf = "/dummy/path/to/db";
+		
+		// Make mock cassandra DB
+		// Replace TitanFactory.open() to return mock DB
+		TestDatabaseManager.deleteTestDatabase();
+		titanGraph = TestDatabaseManager.getTestDatabase();
+		//TestDatabaseManager.populateTestData(titanGraph);
+		PowerMock.mockStatic(TitanFactory.class);
+		EasyMock.expect(TitanFactory.open((String)EasyMock.anyObject())).andReturn(titanGraph);
+		PowerMock.replay(TitanFactory.class);
+		
+		conn = GraphDBConnection.getInstance(conf);
+		ope = new GraphDBOperation(conn);
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		titanGraph.shutdown();
+		TestDatabaseManager.deleteTestDatabase();
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for get and set MacAddress method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the mac address.
+	 * 2. Should get the mac address.
+	 */
+	@Test
+	public void testSetGetMacAddress() {
+		String macaddr = "00:00:00:00:00:00:0a:07";
+		IDeviceObject devObj = ope.newDevice();
+		devObj.setMACAddress(macaddr);
+		assertEquals(devObj.getMACAddress(), macaddr);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for get and set IPAddress method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the ip address.
+	 * 2. Should get the ip address.
+	 */
+	@Test
+	public void testSetGetIPAddress() {
+		String ipaddr = "192.168.0.1";
+		IDeviceObject devObj = ope.newDevice();
+		devObj.setIPAddress(ipaddr);
+		assertEquals(devObj.getIPAddress(), ipaddr);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for get attached port.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should get the attached ports.
+	 */
+	@Test
+	public void testGetAttachedPort() {
+		String dpid = "00:00:00:00:00:00:0a:07";
+		Short number = 1;	
+		Short number2 = 2;
+		IPortObject portObj = ope.newPort(dpid, number);
+		IPortObject portObj2 = ope.newPort(dpid, number2);
+		
+		String ipaddr = "192.168.0.1";
+		IDeviceObject devObj = ope.newDevice();
+		
+		portObj.setDevice(devObj);
+		portObj2.setDevice(devObj);
+		
+		HashMap<Short, IPortObject> portObjectList = new HashMap<Short, IPortObject>();
+		for(IPortObject port : devObj.getAttachedPorts())
+		{
+			portObjectList.put(port.getNumber(), port);
+		}
+		
+		assertTrue(portObjectList.containsValue(portObj));
+		assertTrue(portObjectList.containsValue(portObj2));
+		
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and remove host port method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set host port from the device.
+	 * 2. Should remove host port from the device.
+	 */
+	@Test
+	public void testSetRemoveHostPort() {
+		String dpid = "00:00:00:00:00:00:0a:07";
+		Short number = 1;	
+		Short number2 = 2;
+		IPortObject portObj = ope.newPort(dpid, number);
+		IPortObject portObj2 = ope.newPort(dpid, number2);
+		
+		String ipaddr = "192.168.0.1";
+		IDeviceObject devObj = ope.newDevice();
+		
+		devObj.setHostPort(portObj);
+		
+		HashMap<String, IDeviceObject> portObjectList = new HashMap<String, IDeviceObject>();
+		for(IDeviceObject dev : portObj.getDevices())
+		{
+			portObjectList.put(dev.getMACAddress(), dev);
+		}
+		assertTrue(portObjectList.containsValue(devObj));
+		
+		devObj.removeHostPort(portObj);
+		
+		HashMap<String, IDeviceObject> portObjectList2 = new HashMap<String, IDeviceObject>();
+		for(IDeviceObject dev : portObj.getDevices())
+		{
+			portObjectList2.put(dev.getMACAddress(), dev);
+		}
+		assertTrue(!portObjectList2.containsValue(devObj));
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for getSwitch method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should get the switch connected to the device.
+	 */
+	@Test
+	public void testGetSwitches() {
+		String dpid = "00:00:00:00:00:00:0a:07";
+		String dpid2 = "00:00:00:00:00:00:0a:08";
+		Short number = 1;	
+		Short number2 = 2;	
+		ISwitchObject swObj = ope.newSwitch(dpid);
+		ISwitchObject swObj2 = ope.newSwitch(dpid2);
+		IPortObject portObj = ope.newPort(dpid, number);
+		IPortObject portObj2 = ope.newPort(dpid2, number2);
+		swObj.addPort(portObj);
+		swObj2.addPort(portObj2);
+		IDeviceObject devObj = ope.newDevice();
+		portObj.setDevice(devObj);
+		portObj2.setDevice(devObj);
+		
+		HashMap<String, ISwitchObject> switchObjectList = new HashMap<String, ISwitchObject>();
+		for(ISwitchObject sw : devObj.getSwitch())
+		{
+			switchObjectList.put(sw.getDPID(), sw);
+		}
+		assertTrue(switchObjectList.containsValue(swObj));
+		assertTrue(switchObjectList.containsValue(swObj2));
+	}
+	
+	
+}
\ No newline at end of file
diff --git a/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIFlowEntryTest.java b/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIFlowEntryTest.java
new file mode 100644
index 0000000..eba7447
--- /dev/null
+++ b/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIFlowEntryTest.java
@@ -0,0 +1,348 @@
+package net.onrc.onos.ofcontroller.core;
+
+import static org.junit.Assert.*;
+
+import net.onrc.onos.graph.GraphDBConnection;
+import net.onrc.onos.graph.GraphDBOperation;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
+import net.onrc.onos.ofcontroller.core.internal.SwitchStorageImpl;
+import net.onrc.onos.ofcontroller.core.internal.TestDatabaseManager;
+import org.easymock.EasyMock;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.powermock.api.easymock.PowerMock;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.slf4j.LoggerFactory;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+import com.thinkaurelius.titan.core.TitanFactory;
+import com.thinkaurelius.titan.core.TitanGraph;
+
+//Add Powermock preparation
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({TitanFactory.class, GraphDBConnection.class, GraphDBOperation.class, SwitchStorageImpl.class})
+public class INetMapTopologyObjectsIFlowEntryTest {
+	
+	//The test network is ./titan/schema/test-network.xml
+
+	protected static org.slf4j.Logger log = LoggerFactory.getLogger(SwitchStorageImpl.class);
+
+	String conf;
+    private GraphDBConnection conn = null;
+    private GraphDBOperation ope = null;
+    private TitanGraph titanGraph = null;
+	private IFlowEntry flowEntry = null;
+	
+	@Before
+	public void setUp() throws Exception {
+		conf = "/dummy/path/to/db";
+		
+		// Make mock cassandra DB
+		// Replace TitanFactory.open() to return mock DB
+		TestDatabaseManager.deleteTestDatabase();
+		titanGraph = TestDatabaseManager.getTestDatabase();
+		//TestDatabaseManager.populateTestData(titanGraph);
+		PowerMock.mockStatic(TitanFactory.class);
+		EasyMock.expect(TitanFactory.open((String)EasyMock.anyObject())).andReturn(titanGraph);
+		PowerMock.replay(TitanFactory.class);
+		
+		conn = GraphDBConnection.getInstance(conf);
+		ope = new GraphDBOperation(conn);
+		
+		flowEntry = ope.newFlowEntry();
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		titanGraph.shutdown();
+		TestDatabaseManager.deleteTestDatabase();
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get FlowEntryId.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set FlowEntryId.
+	 * 2. Should get FlowEntryId.
+	 */
+	@Test
+	public void testSetGetFlowEntryId() {
+		String flowEntryId = "xx";
+		flowEntry.setFlowEntryId(flowEntryId);
+		assertEquals(flowEntry.getFlowEntryId(), flowEntryId);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get SwitchDpid.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set SwitchDpid.
+	 * 2. Should get SwitchDpid.
+	 */
+	@Test
+	public void testSetGetSwitchDpid() {
+		String switchDpid = "00:00:00:00:00:11";
+		flowEntry.setSwitchDpid(switchDpid);
+		assertEquals(flowEntry.getSwitchDpid(), switchDpid);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get UserState.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set UserState.
+	 * 2. Should get UserState.
+	 */
+	@Test
+	public void testSetGetUserState() {
+		String userStete = "good";
+		flowEntry.setUserState(userStete);
+		assertEquals(flowEntry.getUserState(), userStete);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get SwitchState.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set SwitchState.
+	 * 2. Should get SwitchState.
+	 */
+	@Test
+	public void testSetGetSwitchState() {
+		String switchStete = "ACTIVE";
+		flowEntry.setSwitchState(switchStete);
+		assertEquals(flowEntry.getSwitchState(), switchStete);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get ErrorStateType.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set ErrorStateType.
+	 * 2. Should get ErrorStateType.
+	 */
+	@Test
+	public void testSetGetErrorStateType() {
+		String errorSteteType = "error";
+		flowEntry.setErrorStateType(errorSteteType);
+		assertEquals(flowEntry.getErrorStateType(), errorSteteType);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get ErrorStateCode.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set ErrorStateCode.
+	 * 2. Should get ErrorStateCode.
+	 */
+	@Test
+	public void testSetGetErrorStateCode() {
+		String errorSteteCode = "error";
+		flowEntry.setErrorStateCode(errorSteteCode);
+		assertEquals(flowEntry.getErrorStateCode(), errorSteteCode);
+	}	
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get MatchInPort.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set MatchInPort.
+	 * 2. Should get MatchInPort.
+	 */
+	@Test
+	public void testSetGetMatchInPort() {
+		Short inPort = 1;
+		flowEntry.setMatchInPort(inPort);
+		assertEquals(flowEntry.getMatchInPort(), inPort);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get MatchEthernetFrameType.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set MatchEthernetFrameType.
+	 * 2. Should get MatchEthernetFrameType.
+	 */
+	@Test
+	public void testSetGetMatchEthernetFrameType() {
+		Short matchEthernetFrameType = 1;
+		flowEntry.setMatchEthernetFrameType(matchEthernetFrameType);
+		assertEquals(flowEntry.getMatchEthernetFrameType(), matchEthernetFrameType);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get MatchSrcMac.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set MatchSrcMac.
+	 * 2. Should get MatchSrcMac.
+	 */
+	@Test
+	public void testSetGetMatchSrcMac() {
+		String matchSrcMac = "00:00:00:00:00:11";
+		flowEntry.setMatchSrcMac(matchSrcMac);
+		assertEquals(flowEntry.getMatchSrcMac(), matchSrcMac);
+	}	
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get MatchDstMac.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set MatchDstMac.
+	 * 2. Should get MatchDstMac.
+	 */
+	@Test
+	public void testSetGetMatchDstMac() {
+		String matchDstMac = "00:00:00:00:00:11";
+		flowEntry.setMatchDstMac(matchDstMac);
+		assertEquals(flowEntry.getMatchDstMac(), matchDstMac);
+	}	
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get SrcIPv4Net.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set SrcIPv4Net.
+	 * 2. Should get SrcIPv4Net.
+	 */
+	@Test
+	public void testSetGetMatchSrcIPv4Net() {
+		String srcIPv4Net = "192.168.0.1";
+		flowEntry.setMatchSrcIPv4Net(srcIPv4Net);
+		assertEquals(flowEntry.getMatchSrcIPv4Net(), srcIPv4Net);
+	}	
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get MatchDstIPv4Net.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set MatchDstIPv4Net.
+	 * 2. Should get MatchDstIPv4Net.
+	 */
+	@Test
+	public void testSetGetMatchDstIPv4Net() {
+		String dstIPv4Net = "192.168.0.1";
+		flowEntry.setMatchDstIPv4Net(dstIPv4Net);
+		assertEquals(flowEntry.getMatchDstIPv4Net(), dstIPv4Net);
+	}	
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get ActionOutput.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set ActionOutput.
+	 * 2. Should get ActionOutput.
+	 */
+	@Test
+	public void testSetGetActionOutput() {
+		Short actionOutput = 1;
+		flowEntry.setActionOutput(actionOutput);
+		assertEquals(flowEntry.getActionOutput(), actionOutput);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get FlowPath.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set FlowPath.
+	 * 2. Should get FlowPath.
+	 */
+	@Test
+	public void testSetGetFlowPath() {
+		IFlowPath fp = ope.newFlowPath();
+		String flowId = "xx";
+		fp.setFlowId(flowId);
+		flowEntry.setFlow(fp);
+		IFlowPath fp2 = flowEntry.getFlow();
+		assertEquals(fp2.getFlowId(), flowId);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get Switch.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set Switch.
+	 * 2. Should get Switch.
+	 */
+	@Test
+	public void testSetGetSwitch() {
+		String dpid = "00:00:00:00:00:22";
+		ISwitchObject sw1 = ope.newSwitch(dpid);
+		flowEntry.setSwitch(sw1);
+		ISwitchObject sw2 = flowEntry.getSwitch();
+		assertEquals(sw2, sw1);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get InPort.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set InPort.
+	 * 2. Should get InPort.
+	 */
+	@Test
+	public void testSetGetInPort() {
+		String dpid = "00:00:00:00:00:22";
+		Short portNum = 4;
+		IPortObject port1 = ope.newPort(dpid, portNum);
+		flowEntry.setInPort(port1);
+		IPortObject port2 = flowEntry.getInPort();
+		assertEquals(port2, port1);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get OutPort.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set OutPort.
+	 * 2. Should get OutPort.
+	 */
+	@Test
+	public void testSetGetOutPort() {
+		String dpid = "00:00:00:00:00:22";
+		Short portNum = 4;
+		IPortObject port1 = ope.newPort(dpid, portNum);
+		flowEntry.setOutPort(port1);
+		IPortObject port2 = flowEntry.getOutPort();
+		assertEquals(port2, port1);
+	}
+}
diff --git a/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIFlowPathTest.java b/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIFlowPathTest.java
new file mode 100644
index 0000000..9765af8
--- /dev/null
+++ b/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIFlowPathTest.java
@@ -0,0 +1,383 @@
+package net.onrc.onos.ofcontroller.core;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import net.onrc.onos.graph.GraphDBConnection;
+import net.onrc.onos.graph.GraphDBOperation;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
+import net.onrc.onos.ofcontroller.core.internal.SwitchStorageImpl;
+import net.onrc.onos.ofcontroller.core.internal.TestDatabaseManager;
+import org.easymock.EasyMock;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.powermock.api.easymock.PowerMock;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.slf4j.LoggerFactory;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+import com.thinkaurelius.titan.core.TitanFactory;
+import com.thinkaurelius.titan.core.TitanGraph;
+
+//Add Powermock preparation
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({TitanFactory.class, GraphDBConnection.class, GraphDBOperation.class, SwitchStorageImpl.class})
+public class INetMapTopologyObjectsIFlowPathTest {
+	
+	//The test network is ./titan/schema/test-network.xml
+
+	protected static org.slf4j.Logger log = LoggerFactory.getLogger(SwitchStorageImpl.class);
+
+	String conf;
+    private GraphDBConnection conn = null;
+    private GraphDBOperation ope = null;
+    private TitanGraph titanGraph = null;
+	private IFlowPath flowPath = null;
+	private IFlowEntry flowEntry = null;
+	
+	@Before
+	public void setUp() throws Exception {
+		conf = "/dummy/path/to/db";
+		
+		// Make mock cassandra DB
+		// Replace TitanFactory.open() to return mock DB
+		TestDatabaseManager.deleteTestDatabase();
+		titanGraph = TestDatabaseManager.getTestDatabase();
+		//TestDatabaseManager.populateTestData(titanGraph);
+		PowerMock.mockStatic(TitanFactory.class);
+		EasyMock.expect(TitanFactory.open((String)EasyMock.anyObject())).andReturn(titanGraph);
+		PowerMock.replay(TitanFactory.class);
+		
+		conn = GraphDBConnection.getInstance(conf);
+		ope = new GraphDBOperation(conn);
+		
+		flowPath = ope.newFlowPath();
+		flowEntry = ope.newFlowEntry();
+		flowEntry.setState("zz");
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		titanGraph.shutdown();
+		TestDatabaseManager.deleteTestDatabase();
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for get and set FlowId method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the flow id.
+	 * 2. Should get the flow id.
+	 */
+	@Test
+	public void testSetGetFlowId() {
+		String flowId = "xx";
+		flowPath.setFlowId(flowId);
+		assertEquals(flowPath.getFlowId(), flowId);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for get and set InstallerId method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the installer id.
+	 * 2. Should get the installer id.
+	 */
+	@Test
+	public void testSetGetInstallerId() {
+		String flowId = "xx";
+		String installerId = "yy";
+		flowPath.setFlowId(flowId);
+		flowPath.setInstallerId(installerId);
+		assertEquals(flowPath.getInstallerId(), installerId);
+	}
+
+	/**
+	 * Desc:
+	 *  Test method for get and set SourceSwitch method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the source switch.
+	 * 2. Should get the source switch.
+	 */
+	@Test
+	public void testSetGetSourceSwitch() {
+		String flowId = "xx";
+		String sourceSwitch = "aa";
+		flowPath.setFlowId(flowId);
+		flowPath.setSrcSwitch(sourceSwitch);
+		assertEquals(flowPath.getSrcSwitch(), sourceSwitch);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for get and set SourcePort method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the source port.
+	 * 2. Should get the source port.
+	 */
+	@Test
+	public void testSetGetSourcePort() {
+		String flowId = "xx";
+		Short sourcePort = 1;
+		flowPath.setFlowId(flowId);
+		flowPath.setSrcPort(sourcePort);
+		assertEquals(flowPath.getSrcPort(), sourcePort);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for get and set DestSwitch method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the dest switch.
+	 * 2. Should get the dest switch.
+	 */
+	@Test
+	public void testSetGetDestSwitch() {
+		String flowId = "xx";
+		String destSwitch = "bb";
+		flowPath.setFlowId(flowId);
+		flowPath.setDstSwitch(destSwitch);
+		assertEquals(flowPath.getDstSwitch(), destSwitch);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for get and set DestPort method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the source dest port.
+	 * 2. Should get the source dest port.
+	 */
+	@Test
+	public void testSetGetDstPort() {
+		String flowId = "xx";
+		Short dstPort = 2;
+		flowPath.setFlowId(flowId);
+		flowPath.setDstPort(dstPort);
+		assertEquals(flowPath.getDstPort(), dstPort);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for get and set DataPathSummary method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the data path summary.
+	 * 2. Should get the data path summary.
+	 */
+	@Test
+	public void testSetGetDataPathSummary() {
+		String flowId = "xx";
+		String dataPathSummary = "yy";
+		flowPath.setFlowId(flowId);
+		flowPath.setInstallerId(dataPathSummary);
+		assertEquals(flowPath.getInstallerId(), dataPathSummary);
+	}
+	
+	public boolean testIFlowEntry(IFlowPath fp, IFlowEntry fe)
+	{
+		ArrayList<IFlowEntry> flowEntryList = new ArrayList<IFlowEntry>();
+		for(IFlowEntry inFlowEntry : fp.getFlowEntries())
+		{
+			flowEntryList.add(inFlowEntry);
+		}
+		return flowEntryList.contains(fe);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for addFlowEntry and getFlorEntries method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should add the FlowEntry.
+	 * 2. Should get the FlowEntries. It is tested in the testIFlowEntry method.
+	 */
+	@Test
+	public void testAddFlowEntryAndGetFlowEntries() {
+		String flowId = "xx";
+		flowPath.setFlowId(flowId);
+		flowPath.addFlowEntry(flowEntry);
+		IFlowEntry flowEntry2 = ope.newFlowEntry();
+		flowPath.addFlowEntry(flowEntry2);
+		assertTrue(testIFlowEntry(flowPath, flowEntry));
+		assertTrue(testIFlowEntry(flowPath, flowEntry2));
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for remove FlowEntry.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should remove FlowEntry.
+	 */
+	@Test
+	public void testRemoveFlowEntry() {
+		String flowId = "xx";
+		flowPath.setFlowId(flowId);
+		flowPath.addFlowEntry(flowEntry);
+		flowPath.removeFlowEntry(flowEntry);
+		assertTrue(!testIFlowEntry(flowPath, flowEntry));
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get MatchEthernetFrameType
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set MatchEthernetFrameType.
+	 * 2. Should get MatchEthernetFrameType.
+	 */
+	@Test
+	public void testSetGetMatchEthernetFrameType() {
+		String flowId = "xx";
+		Short matchEthernetFrameTypeShort = 1;
+		flowPath.setFlowId(flowId);
+		flowPath.setMatchEthernetFrameType(matchEthernetFrameTypeShort);
+		assertEquals(flowPath.getMatchEthernetFrameType(), matchEthernetFrameTypeShort);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get MatchSrcMac
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set MatchSrcMac.
+	 * 2. Should get MatchSrcMac.
+	 */
+	@Test
+	public void testSetGetMatchSrcMac() {
+		String flowId = "xx";
+		String matchSrcMac = "00:00:00:00:00:11";
+		flowPath.setFlowId(flowId);
+		flowPath.setMatchSrcMac(matchSrcMac);
+		assertEquals(flowPath.getMatchSrcMac(), matchSrcMac);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get MatchDstMac.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set MatchDstMac.
+	 * 2. Should get MatchDstMac.
+	 */
+	@Test
+	public void testSetGetMatchDstMac() {
+		String flowId = "xx";
+		String matchDstMac = "00:00:00:00:00:11";
+		flowPath.setFlowId(flowId);
+		flowPath.setMatchDstMac(matchDstMac);
+		assertEquals(flowPath.getMatchDstMac(), matchDstMac);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get SrcIPv4Net.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set SrcIPv4Net.
+	 * 2. Should get SrcIPv4Net.
+	 */
+	@Test
+	public void testSetGetMatchSrcIPv4Net() {
+		String flowId = "xx";
+		String ip = "192.168.0.1";
+		flowPath.setFlowId(flowId);
+		flowPath.setMatchSrcIPv4Net(ip);
+		assertEquals(flowPath.getMatchSrcIPv4Net(), ip);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get DstIPv4Net.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set DstIPv4Net.
+	 * 2. Should get DstIPv4Net.
+	 */
+	@Test
+	public void testSetGetMatchDstIPv4Net() {
+		String flowId = "xx";
+		String ip = "192.168.0.1";
+		flowPath.setFlowId(flowId);
+		flowPath.setMatchDstIPv4Net(ip);
+		assertEquals(flowPath.getMatchDstIPv4Net(), ip);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get UserState.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set UserState.
+	 * 2. Should get UserState.
+	 */
+	@Test
+	public void testSetGetUserState() {
+		String flowId = "xx";
+		String userStatus = "Good";
+		flowPath.setFlowId(flowId);
+		flowPath.setUserState(userStatus);
+		assertEquals(flowPath.getUserState(), userStatus);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for get Switches.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should get switches.
+	 */
+	@Test
+	public void testGetSwitches() {
+		String flowId = "xx";
+		String dpid = "1";
+		flowPath.setFlowId(flowId);
+		ISwitchObject sw = ope.newSwitch(dpid);
+		flowEntry.setSwitch(sw);
+		flowPath.addFlowEntry(flowEntry);
+		
+		HashMap<String, ISwitchObject> swList = new HashMap<String, ISwitchObject>();
+		for(ISwitchObject insw : flowPath.getSwitches()){
+			swList.put(sw.getDPID(), insw);
+		}
+		
+		assertTrue(swList.containsKey(dpid));
+	}
+	
+	//TODO Dont know how to set the state property.
+	@Test
+	public void testGetState() {
+		String status = null;
+		assertEquals(flowPath.getState(), status);
+	}
+	
+	
+}
diff --git a/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIPortObjectTest.java b/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIPortObjectTest.java
new file mode 100644
index 0000000..2ddab3d
--- /dev/null
+++ b/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsIPortObjectTest.java
@@ -0,0 +1,359 @@
+package net.onrc.onos.ofcontroller.core;
+
+import static org.junit.Assert.*;
+
+import net.onrc.onos.graph.GraphDBConnection;
+import net.onrc.onos.graph.GraphDBOperation;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IDeviceObject;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
+import net.onrc.onos.ofcontroller.core.internal.SwitchStorageImpl;
+import net.onrc.onos.ofcontroller.core.internal.TestDatabaseManager;
+import net.onrc.onos.ofcontroller.flowmanager.FlowManager;
+import net.onrc.onos.ofcontroller.util.FlowId;
+import net.onrc.onos.ofcontroller.util.FlowPath;
+
+import org.easymock.EasyMock;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openflow.protocol.OFPhysicalPort.OFPortState;
+import org.powermock.api.easymock.PowerMock;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.slf4j.LoggerFactory;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+import com.thinkaurelius.titan.core.TitanFactory;
+import com.thinkaurelius.titan.core.TitanGraph;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+//Add Powermock preparation
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({TitanFactory.class, GraphDBConnection.class, GraphDBOperation.class, SwitchStorageImpl.class})
+public class INetMapTopologyObjectsIPortObjectTest {
+	
+	//The test network is ./titan/schema/test-network.xml
+
+	protected static org.slf4j.Logger log = LoggerFactory.getLogger(SwitchStorageImpl.class);
+
+	String conf;
+    private GraphDBConnection conn = null;
+    private GraphDBOperation ope = null;
+    private TitanGraph titanGraph = null;
+    
+    private ISwitchObject swObj;
+    private IPortObject portObj;
+    private IPortObject portObj2;
+    String dpid;
+    Short number;
+    Short number2;
+    
+    private ISwitchObject swObjParty;
+    private IPortObject portObjParty1;
+    private IPortObject portObjParty2;  
+    String dpidParty;
+    Short numberParty1;
+    Short numberParty2;
+    
+    
+	@Before
+	public void setUp() throws Exception {
+		conf = "/dummy/path/to/db";
+		
+		// Make mock cassandra DB
+		// Replace TitanFactory.open() to return mock DB
+		TestDatabaseManager.deleteTestDatabase();
+		titanGraph = TestDatabaseManager.getTestDatabase();
+		//TestDatabaseManager.populateTestData(titanGraph);
+		PowerMock.mockStatic(TitanFactory.class);
+		EasyMock.expect(TitanFactory.open((String)EasyMock.anyObject())).andReturn(titanGraph);
+		PowerMock.replay(TitanFactory.class);
+		
+		conn = GraphDBConnection.getInstance(conf);
+		ope = new GraphDBOperation(conn);
+		
+		dpid = "00:00:00:00:00:00:0a:07";
+		number = 1;	
+		number2 = 2;
+		swObj = ope.newSwitch(dpid);
+		portObj = ope.newPort(dpid, number);
+		portObj2 = ope.newPort(dpid, number2);
+
+		swObj.addPort(portObj);	
+		swObj.addPort(portObj2);
+		
+		dpidParty = "00:00:00:00:00:00:0a:08";
+		numberParty1 = 1;
+		numberParty2 = 2;
+		swObjParty = ope.newSwitch(dpidParty);
+		portObjParty1 = ope.newPort(dpidParty, numberParty1);
+		portObjParty2 = ope.newPort(dpidParty, numberParty2);
+		swObjParty.addPort(portObjParty1);	
+		swObjParty.addPort(portObjParty2);
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		titanGraph.shutdown();
+		TestDatabaseManager.deleteTestDatabase();
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get port number property.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the port number.
+	 * 2. Should get the port number.
+	 */
+	@Test
+	public void testSetGetNumber() {
+		assertEquals(portObj.getNumber(), number);
+		Short testedNumber = 4;
+		portObj.setNumber(testedNumber);
+		assertEquals(portObj.getNumber(), testedNumber);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get port id property.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the port id.
+	 * 2. Should get the port id.
+	 */
+	@Test
+	public void testSetGetPortId() {
+		String portId = "test1";
+		portObj.setPortId(portId);
+		assertEquals(portObj.getPortId(), portId);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get port desc property.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the port desc.
+	 * 2. Should get the port desc.
+	 */
+	@Test
+	public void testSetGetDesc() {
+		String testedDesc = "port 4 at ATL Switch";
+		portObj.setDesc(testedDesc);
+		assertEquals(portObj.getDesc(), testedDesc);
+	}
+	
+	
+	/**
+	 * Desc:
+	 *  Test method for set and get port status property.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the port status.
+	 * 2. Should get the port status.
+	 */
+	@Test
+	public void testSetGetPortState() {
+		Integer portState = OFPortState.OFPPS_STP_FORWARD.getValue();
+		portObj.setPortState(portState);
+		assertEquals(portObj.getPortState(), portState);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for get switch object.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should get the switch status.
+	 */
+	@Test
+	public void testGetSwitch() {
+		ISwitchObject sw = portObj.getSwitch();
+		assertEquals(sw.getDPID(), dpid);
+	}
+	
+	private boolean checkIDeviceObject(IPortObject IportObj, String mac)
+	{
+		HashMap<String, IDeviceObject> devList = new HashMap<String, IDeviceObject>();
+		for(IDeviceObject IdevObj : IportObj.getDevices())
+		{
+			devList.put(IdevObj.getMACAddress(), IdevObj);
+		}
+		return devList.containsKey(mac);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set and remove device object.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the device object.
+	 * 2. SHould remove the device object.
+	 */
+	@Test
+	public void testSetAndRemoveDevice() {
+		IDeviceObject devObj = ope.newDevice();
+		String devMac = "00:00:00:00:00:11";
+		devObj.setMACAddress(devMac);
+		
+		boolean b = checkIDeviceObject(portObj, devMac);
+		assertTrue(!b);
+		portObj.setDevice(devObj);
+		boolean b2 = checkIDeviceObject(portObj, devMac);
+		assertTrue(b2);
+		
+		portObj.removeDevice(devObj);
+		boolean b3 = checkIDeviceObject(portObj, devMac);
+		assertTrue(!b3);
+		
+	}	
+	
+	/**
+	 * Desc:
+	 *  Test method for get devices object.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should get the device objects.
+	 */
+	@Test
+	public void testGetDevices() {
+		IDeviceObject devObj = ope.newDevice();
+		String devMac = "58:55:ca:c4:1b:a0";
+		devObj.setMACAddress(devMac);
+		
+		portObj.setDevice(devObj);
+		boolean b = checkIDeviceObject(portObj, devMac);
+		assertTrue(b);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for set, get and remove linked port.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the linked objects.
+	 * 2. Should get the linked objects.
+	 * 3. SHould remove the liked objects.
+	 */
+	@Test
+	public void testSetGetRemoveLinkedPorts() {
+		String dpidParty = "00:00:00:00:00:00:00:08";
+		ISwitchObject swParty = ope.newSwitch(dpidParty);
+		Short poShort = 1;
+		IPortObject poParty = ope.newPort(dpidParty, poShort);
+		swParty.addPort(poParty);
+		
+		portObj.setLinkPort(poParty);
+		
+		ArrayList<IPortObject> iPortList = new ArrayList<IPortObject>();
+		for(IPortObject port : portObj.getLinkedPorts()) {
+			iPortList.add(port);
+		}	
+		assertTrue(iPortList.contains(poParty));	
+		
+		portObj.removeLink(poParty);
+		
+		ArrayList<IPortObject> iPortList2 = new ArrayList<IPortObject>();
+		for(IPortObject port : portObj.getLinkedPorts()) {
+			iPortList2.add(port);
+		}	
+		
+		assertTrue(!iPortList2.contains(poParty));
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for get inbound flowEntry
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should get the inbound flowEntry.
+	 */
+	@Test
+	public void testGetInFlowEntries() {
+
+		portObj.setLinkPort(portObj2);
+		
+		IFlowPath flowPathObj = ope.newFlowPath();
+		
+		String flowEId = "1";
+		IFlowEntry flowEntryObj = ope.newFlowEntry();		
+		flowEntryObj.setFlowEntryId(flowEId);
+		flowEntryObj.setInPort(portObj);
+		flowEntryObj.setOutPort(portObj2);
+		flowEntryObj.setSwitch(swObj);
+		flowEntryObj.setFlow(flowPathObj);
+		
+		String flowEId2 = "2";
+		IFlowEntry flowEntryObj2 = ope.newFlowEntry();		
+		flowEntryObj2.setFlowEntryId(flowEId2);
+		flowEntryObj2.setInPort(portObjParty1);
+		flowEntryObj2.setOutPort(portObjParty2);
+		flowEntryObj.setSwitch(swObjParty);
+		flowEntryObj2.setFlow(flowPathObj);
+		
+		HashMap<String, IFlowEntry> flowEntryList = new HashMap<String, IFlowEntry>();
+		for(IFlowEntry flowEnt : portObj.getInFlowEntries())
+		{				
+			flowEntryList.put(flowEnt.getFlowEntryId(), flowEnt);
+		}
+		
+		assertTrue(flowEntryList.containsValue(flowEntryObj));
+		
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for get outbound flowEntry
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should get the outbound flowEntry.
+	 */
+	@Test
+	public void testGetOutFlowEntries() {
+		
+		portObj.setLinkPort(portObj2);
+		
+		IFlowPath flowPathObj = ope.newFlowPath();
+		
+		String flowEId = "1";
+		IFlowEntry flowEntryObj = ope.newFlowEntry();		
+		flowEntryObj.setFlowEntryId(flowEId);
+		flowEntryObj.setInPort(portObj);
+		flowEntryObj.setOutPort(portObj2);
+		flowEntryObj.setSwitch(swObj);
+		flowEntryObj.setFlow(flowPathObj);
+		
+		String flowEId2 = "2";
+		IFlowEntry flowEntryObj2 = ope.newFlowEntry();		
+		flowEntryObj2.setFlowEntryId(flowEId2);
+		flowEntryObj2.setInPort(portObjParty1);
+		flowEntryObj2.setOutPort(portObjParty2);
+		flowEntryObj.setSwitch(swObjParty);
+		flowEntryObj2.setFlow(flowPathObj);
+		
+		HashMap<String, IFlowEntry> flowEntryList = new HashMap<String, IFlowEntry>();
+		for(IFlowEntry flowEnt : portObj2.getOutFlowEntries())
+		{				
+			flowEntryList.put(flowEnt.getFlowEntryId(), flowEnt);
+		}
+		
+		assertTrue(flowEntryList.containsValue(flowEntryObj));
+		
+	}
+
+}
diff --git a/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsISwitchObjectTest.java b/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsISwitchObjectTest.java
new file mode 100644
index 0000000..c4dca4b
--- /dev/null
+++ b/src/test/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjectsISwitchObjectTest.java
@@ -0,0 +1,285 @@
+package net.onrc.onos.ofcontroller.core;
+
+import static org.junit.Assert.*;
+
+import java.util.HashMap;
+
+import net.onrc.onos.graph.GraphDBConnection;
+import net.onrc.onos.graph.GraphDBOperation;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IDeviceObject;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject;
+import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
+import net.onrc.onos.ofcontroller.core.internal.SwitchStorageImpl;
+import net.onrc.onos.ofcontroller.core.internal.TestDatabaseManager;
+import org.easymock.EasyMock;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.powermock.api.easymock.PowerMock;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.slf4j.LoggerFactory;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+import com.thinkaurelius.titan.core.TitanFactory;
+import com.thinkaurelius.titan.core.TitanGraph;
+
+//Add Powermock preparation
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({TitanFactory.class, GraphDBConnection.class, GraphDBOperation.class, SwitchStorageImpl.class})
+public class INetMapTopologyObjectsISwitchObjectTest {
+	
+	//The test network is ./titan/schema/test-network.xml
+
+	protected static org.slf4j.Logger log = LoggerFactory.getLogger(SwitchStorageImpl.class);
+
+	String conf;
+    private GraphDBConnection conn = null;
+    private GraphDBOperation ope = null;
+    private TitanGraph titanGraph = null;
+	
+	@Before
+	public void setUp() throws Exception {
+		conf = "/dummy/path/to/db";
+		
+		// Make mock cassandra DB
+		// Replace TitanFactory.open() to return mock DB
+		TestDatabaseManager.deleteTestDatabase();
+		titanGraph = TestDatabaseManager.getTestDatabase();
+		//TestDatabaseManager.populateTestData(titanGraph);
+		PowerMock.mockStatic(TitanFactory.class);
+		EasyMock.expect(TitanFactory.open((String)EasyMock.anyObject())).andReturn(titanGraph);
+		PowerMock.replay(TitanFactory.class);
+		
+		conn = GraphDBConnection.getInstance(conf);
+		ope = new GraphDBOperation(conn);
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		titanGraph.shutdown();
+		TestDatabaseManager.deleteTestDatabase();
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for get and set state method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the status of the switch.
+	 * 2. Should get the status of the switch.
+	 */
+	@Test
+	public void testSetGetState() {
+		String dpid = "00:00:00:00:00:00:0a:07";
+		String state = "ACTIVE";
+		ISwitchObject swObj = ope.newSwitch(dpid);
+		swObj.setState(state);
+		assertEquals(swObj.getState(), state);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for get and set Type method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the Type of the switch.
+	 * 2. Should get the Type of the switch.
+	 */
+	@Test
+	public void testSetGetType() {
+		String dpid = "00:00:00:00:00:00:0a:07";
+		String type = "Switch";
+		ISwitchObject swObj = ope.newSwitch(dpid);
+		swObj.setType("Switch");
+		assertEquals(swObj.getType(), type);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for getDPID method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should get the dpid of the switch.
+	 */
+	@Test
+	public void testGetDPID() {
+		String dpid = "00:00:00:00:00:00:0a:07";
+		ISwitchObject swObj = ope.newSwitch(dpid);
+		
+		assertEquals(swObj.getDPID(), dpid);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for setDPID method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should set the dpid of the switch.
+	 */
+	@Test
+	public void testSetDPID() {
+		String dpid = "00:00:00:00:00:00:0a:07";
+		String dpid2 = "00:00:00:00:00:00:0a:08";
+		ISwitchObject obj = ope.newSwitch(dpid);
+		assertEquals(obj.getDPID(), dpid);
+		
+		obj.setDPID(dpid2);
+		assertEquals(obj.getDPID(), dpid2);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for getPorts method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should get all of ports taken by the switch.
+	 */
+	@Test
+	public void testGetPorts() {
+		String dpid = "00:00:00:00:00:00:0a:07";
+		Short portNumber = 1;
+		int testSwitchPortNumber = 1;
+		ISwitchObject swObj = ope.newSwitch(dpid);
+		IPortObject portObj = ope.newPort(dpid, portNumber);
+
+		swObj.addPort(portObj);
+		int i = 0;
+		for(IPortObject port : swObj.getPorts()){
+			i++;
+		}
+		assertEquals(testSwitchPortNumber, 1);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for add and getPort method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should add the port.
+	 * 1. Should get the port.
+	 */
+	@Test
+	public void testGetPort() {
+		String dpid = "00:00:00:00:00:00:0a:07";
+		Short portNumber = 1;
+		ISwitchObject swObj = ope.newSwitch(dpid);
+		IPortObject portObj = ope.newPort(dpid, portNumber);
+		
+		swObj.addPort(portObj);
+		IPortObject portObj2 = swObj.getPort(portNumber);
+		assertEquals(portObj, portObj2);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for add and removePort method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should add a port to the switch.
+	 * 1. Should remove a port from the switch.
+	 */
+	@Test
+	public void testAddRemovePorts() {
+		String dpid = "00:00:00:00:00:00:0a:07";
+		Short portNum = 1;
+		ISwitchObject swObj = ope.newSwitch(dpid);
+		IPortObject portObj = ope.newPort(dpid, portNum);
+		swObj.addPort(portObj);
+		
+		IPortObject portObj2 = swObj.getPort(portNum);
+		assertEquals(portObj2, portObj);
+		swObj.removePort(portObj);
+		assertNull(swObj.getPort(portNum));
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for getDevices method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should get all devices attached to the switch.
+	 */
+	@Test
+	public void testGetDevices() {
+		String dpid = "00:00:00:00:00:00:0a:07";
+		Short portNum = 1;
+		String devMac = "00:00:00:00:00:11";
+		int numOfDev = 1;
+		
+		ISwitchObject swObj = ope.newSwitch(dpid);
+		IPortObject portObj = ope.newPort(dpid, portNum);
+		IDeviceObject devObj = ope.newDevice();
+		devObj.setMACAddress(devMac);
+		swObj.addPort(portObj);
+		portObj.setDevice(devObj);
+		
+		int i = 0;
+		for(IDeviceObject dev : swObj.getDevices()){
+			i++;
+		}
+		assertEquals(i, numOfDev);
+	}
+	
+	/**
+	 * Desc:
+	 *  Test method for getFlowEntries method.
+	 * Condition:
+	 *  N/A
+	 * Expect:
+	 * 1. Should get all flowEntries attached to the switch.
+	 */
+	@Test
+	public void testGetFlowEntries() {
+		String dpid = "00:00:00:00:00:00:0a:07";
+		Short number = 1;	
+		Short number2 = 2;
+		Short number3 = 3;
+		ISwitchObject swObj = ope.newSwitch(dpid);
+		IPortObject portObj = ope.newPort(dpid, number);
+		IPortObject portObj2 = ope.newPort(dpid, number2);
+		IPortObject portObj3 = ope.newPort(dpid, number3);
+
+		swObj.addPort(portObj);	
+		swObj.addPort(portObj2);
+		swObj.addPort(portObj3);
+		
+		IFlowPath flowPathObj = ope.newFlowPath();
+		
+		String flowEId = "1";
+		IFlowEntry flowEntryObj = ope.newFlowEntry();		
+		flowEntryObj.setFlowEntryId(flowEId);
+		flowEntryObj.setInPort(portObj);
+		flowEntryObj.setOutPort(portObj2);
+		flowEntryObj.setSwitch(swObj);
+		flowEntryObj.setFlow(flowPathObj);
+		
+		String flowEId2 = "2";
+		IFlowEntry flowEntryObj2 = ope.newFlowEntry();		
+		flowEntryObj2.setFlowEntryId(flowEId2);
+		flowEntryObj2.setInPort(portObj);
+		flowEntryObj2.setOutPort(portObj3);
+		flowEntryObj2.setSwitch(swObj);
+		flowEntryObj2.setFlow(flowPathObj);
+		
+		HashMap<String, IFlowEntry> flowEntryList = new HashMap<String, IFlowEntry>();
+		for(IFlowEntry flowEnt : swObj.getFlowEntries())
+		{				
+			flowEntryList.put(flowEnt.getFlowEntryId(), flowEnt);
+		}
+		
+		assertTrue(flowEntryList.containsValue(flowEntryObj));
+		assertTrue(flowEntryList.containsValue(flowEntryObj2));
+	}
+
+}
diff --git a/src/test/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImplTest.java b/src/test/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImplTest.java
index d2a6712..4956136 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImplTest.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/core/internal/SwitchStorageImplTest.java
@@ -80,7 +80,6 @@
 	 * Expect:
 	 * 	Call SwitchStorageImpl.addSwitch func with proper properties.
 	 */
-	@Ignore 
 	@Test
 	public void testAddSwitch() {
 		String dpid = "00:00:00:00:00:00:0a:07";
@@ -144,7 +143,6 @@
 	 * Expect:
 	 * 	Write the status as info log.
 	 */
-	//@Ignore 
 	@Test
 	public void testAddSwitchAbnormal() {
 		String dpid = "00:00:00:00:00:00:0a:07";
@@ -152,6 +150,7 @@
 		//Expectation of mock operation.
 		expect(mockOpe.searchSwitch(dpid)).andReturn(null);
 		expect(mockOpe.newSwitch(dpid)).andReturn(null);
+		mockOpe.rollback();
 		mockOpe.close();
 		replay(mockOpe);
 		
@@ -163,7 +162,7 @@
 	 * Desc:
 	 *  Test method for addSwitch method.
 	 * Condition:
-	 *  Tthrow runtimeException. 
+	 *  Throw runtimeException. 
 	 * Expect:
 	 * 	The rollback method is called.
 	 */
diff --git a/src/test/java/net/onrc/onos/ofcontroller/core/internal/TestDatabaseManager.java b/src/test/java/net/onrc/onos/ofcontroller/core/internal/TestDatabaseManager.java
index b8091fc..5b0a5b1 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/core/internal/TestDatabaseManager.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/core/internal/TestDatabaseManager.java
@@ -56,20 +56,22 @@
         
         //Change the type of all port numbers to short in the database
         Iterator<Vertex> it = titanGraph.getVertices("type", "port").iterator();
-	while (it.hasNext()){
-		Vertex port = it.next();
 
-		if(port.getProperty("number") instanceof Short)
-		{
-			Short portNum = (Short) port.getProperty("number");
-			port.setProperty("number", portNum.shortValue());
-		}
-		else{
-			Integer portNum = (Integer) port.getProperty("number");	
-			port.setProperty("number", portNum.shortValue());
-		}
+        while (it.hasNext()){
+        	Vertex port = it.next();
+
+        	if(port.getProperty("number") instanceof Short)
+        	{
+        		Short portNum = (Short) port.getProperty("number");
+        		port.setProperty("number", portNum.shortValue());
+        	}
+        	else{
+        		Integer portNum = (Integer) port.getProperty("number");	
+        		port.setProperty("number", portNum.shortValue());
+        	}
 
         }
+        
         titanGraph.stopTransaction(Conclusion.SUCCESS);
 	}
 	
