rename topology related objects: Device -> Host
- KVDevice to be renamed later.
- Use fully qualified name for topology's Host. (HostManager.java)
Change-Id: I1538f96d7ca93ca2197d23e5a69b85d284611412
diff --git a/src/test/java/net/onrc/onos/core/topology/MockTopology.java b/src/test/java/net/onrc/onos/core/topology/MockTopology.java
index d285504..9ceaa2a 100644
--- a/src/test/java/net/onrc/onos/core/topology/MockTopology.java
+++ b/src/test/java/net/onrc/onos/core/topology/MockTopology.java
@@ -128,16 +128,16 @@
Port port43 = addPort(sw4, 43L); // sw4 -> sw3
MACAddress mac1 = MACAddress.valueOf("00:44:33:22:11:00");
- DeviceImpl dev1 = new DeviceImpl(this, mac1);
+ HostImpl dev1 = new HostImpl(this, mac1);
dev1.addAttachmentPoint(port15);
dev1.setLastSeenTime(1L);
- this.putDevice(dev1);
+ this.putHost(dev1);
MACAddress mac3 = MACAddress.valueOf("00:11:22:33:44:55");
- DeviceImpl dev3 = new DeviceImpl(this, mac3);
+ HostImpl dev3 = new HostImpl(this, mac3);
dev3.addAttachmentPoint(port35);
dev3.setLastSeenTime(1L);
- this.putDevice(dev3);
+ this.putHost(dev3);
addBidirectionalLinks(1L, 12L, 2L, 21L);
addBidirectionalLinks(2L, 23L, 3L, 32L);
diff --git a/src/test/java/net/onrc/onos/core/topology/TopologyImplTest.java b/src/test/java/net/onrc/onos/core/topology/TopologyImplTest.java
index bffca36..cb21b8d 100644
--- a/src/test/java/net/onrc/onos/core/topology/TopologyImplTest.java
+++ b/src/test/java/net/onrc/onos/core/topology/TopologyImplTest.java
@@ -51,9 +51,9 @@
// Create a host for each switch
MACAddress devMac = MACAddress.valueOf(switchID);
- DeviceImpl testHost = new DeviceImpl(testTopology, devMac);
+ HostImpl testHost = new HostImpl(testTopology, devMac);
testHost.addAttachmentPoint(hostPort);
- testTopology.putDevice(testHost);
+ testTopology.putHost(testHost);
}
// Create one bidirectional link b/w two switches to construct a ring topology
@@ -188,7 +188,7 @@
MACAddress devMac = MACAddress.valueOf(switchID);
// Verify the device is in the graphDB
- assertNotNull(testTopology.getDeviceByMac(devMac));
+ assertNotNull(testTopology.getHostByMac(devMac));
}
}
@@ -198,11 +198,11 @@
@Test
public void testRemoveDevice() {
int devCount = 0;
- Iterator<Device> itr = testTopology.getDevices().iterator();
+ Iterator<Host> itr = testTopology.getHosts().iterator();
while (itr.hasNext()) {
- Device currDev = itr.next();
- testTopology.removeDevice(currDev);
- testTopology.getDeviceByMac(currDev.getMacAddress());
+ Host currDev = itr.next();
+ testTopology.removeHost(currDev);
+ testTopology.getHostByMac(currDev.getMacAddress());
devCount++;
}
@@ -242,9 +242,9 @@
@Test
public void testRemoveSwitch() {
for (long switchID = 1; switchID <= TEST_SWITCH_NUM; switchID++) {
- Iterator<Device> itr = testTopology.getSwitch(new Dpid(switchID)).getDevices().iterator();
+ Iterator<Host> itr = testTopology.getSwitch(new Dpid(switchID)).getHosts().iterator();
while (itr.hasNext()) {
- testTopology.removeDevice(itr.next());
+ testTopology.removeHost(itr.next());
}
testTopology.removeSwitch(switchID);
diff --git a/src/test/java/net/onrc/onos/core/topology/TopologyManagerTest.java b/src/test/java/net/onrc/onos/core/topology/TopologyManagerTest.java
index 597f534..e4f6c8c 100644
--- a/src/test/java/net/onrc/onos/core/topology/TopologyManagerTest.java
+++ b/src/test/java/net/onrc/onos/core/topology/TopologyManagerTest.java
@@ -82,12 +82,12 @@
anyObject(PortEvent.class)))
.andReturn(true).anyTimes();
- expect(dataStoreService.addDevice(
- anyObject(DeviceEvent.class)))
+ expect(dataStoreService.addHost(
+ anyObject(HostEvent.class)))
.andReturn(true).anyTimes();
- expect(dataStoreService.removeDevice(
- anyObject(DeviceEvent.class)))
+ expect(dataStoreService.removeHost(
+ anyObject(HostEvent.class)))
.andReturn(true).anyTimes();
expect(dataStoreService.addLink(
@@ -210,11 +210,11 @@
SwitchPort sp = new SwitchPort(swDPId, portId);
List<SwitchPort> spLists = new ArrayList<SwitchPort>();
spLists.add(sp);
- DeviceEvent deviceEvent = new DeviceEvent(devMac);
- deviceEvent.setAttachmentPoints(spLists);
+ HostEvent hostEvent = new HostEvent(devMac);
+ hostEvent.setAttachmentPoints(spLists);
// Call the topologyManager function for adding a device
- theTopologyManager.putDeviceDiscoveryEvent(deviceEvent);
+ theTopologyManager.putHostDiscoveryEvent(hostEvent);
// Verify the function calls
verify(eventChannel);
@@ -240,11 +240,11 @@
SwitchPort sp = new SwitchPort(swDPId, portId);
List<SwitchPort> spLists = new ArrayList<SwitchPort>();
spLists.add(sp);
- DeviceEvent deviceEvent = new DeviceEvent(devMac);
- deviceEvent.setAttachmentPoints(spLists);
+ HostEvent hostEvent = new HostEvent(devMac);
+ hostEvent.setAttachmentPoints(spLists);
// Call the topologyManager function for removing a device
- theTopologyManager.removeDeviceDiscoveryEvent(deviceEvent);
+ theTopologyManager.removeHostDiscoveryEvent(hostEvent);
// Verify the function calls
verify(eventChannel);