// activate switch
IOFSwitch sw = doActivateNewSwitch(dpid, desc, fr1);
// check the store
SwitchSyncRepresentation ssr = storeClient.getValue(dpid);
assertNotNull(ssr);
assertEquals(dpid, ssr.getDpid());
assertEquals(1, ssr.getPorts().size());
assertEquals(p1, ssr.getPorts().get(0).toOFPhysicalPort());
IOFSwitchListener listener = createMock(IOFSwitchListener.class);
controller.addOFSwitchListener(listener);
// setup switch with the new, second features reply (and thus ports)
setupSwitchForAddSwitch(sw, dpid, desc, fr2);
listener.switchPortChanged(dpid, ImmutablePort.fromOFPhysicalPort(p2),
PortChangeType.OTHER_UPDATE);
expectLastCall().once();
replay(listener);
replay(sw);
controller.notifyPortChanged(sw, ImmutablePort.fromOFPhysicalPort(p2),
PortChangeType.OTHER_UPDATE);
controller.processUpdateQueueForTesting();
verify(listener);
verify(sw);
// check the store
ssr = storeClient.getValue(dpid);
assertNotNull(ssr);
assertEquals(dpid, ssr.getDpid());
assertEquals(1, ssr.getPorts().size());
assertEquals(p2, ssr.getPorts().get(0).toOFPhysicalPort());
}