use of org.onosproject.mastership.MastershipTermService in project onos by opennetworkinglab.
the class VirtualNetworkMastershipManagerTest method termService.
@Test
public void termService() {
MastershipTermService ts = mastershipMgr1;
// term = 1 for both
mastershipMgr1.setRole(NID_LOCAL, VDID1, MASTER);
assertEquals("inconsistent term: ", 1, ts.getMastershipTerm(VDID1).termNumber());
// hand devices to NID_LOCAL and back: term = 1 + 2
mastershipMgr1.setRole(NID_OTHER, VDID1, MASTER);
mastershipMgr1.setRole(NID_LOCAL, VDID1, MASTER);
assertEquals("inconsistent terms: ", 3, ts.getMastershipTerm(VDID1).termNumber());
}
use of org.onosproject.mastership.MastershipTermService in project onos by opennetworkinglab.
the class MastershipManagerTest method termService.
@Test
public void termService() {
MastershipTermService ts = mgr;
// term = 1 for both
mgr.setRole(NID_LOCAL, DEV_MASTER, MASTER);
assertEquals("inconsistent term: ", 1, ts.getMastershipTerm(DEV_MASTER).termNumber());
// hand devices to NID_LOCAL and back: term = 1 + 2
mgr.setRole(NID_OTHER, DEV_MASTER, MASTER);
mgr.setRole(NID_LOCAL, DEV_MASTER, MASTER);
assertEquals("inconsistent terms: ", 3, ts.getMastershipTerm(DEV_MASTER).termNumber());
}
Aggregations