Skip to content
Snippets Groups Projects
Commit e6275863 authored by Shudong Zhou's avatar Shudong Zhou
Browse files

Add unit test for null sw to RoleChanger

parent 3206efd6
No related branches found
No related tags found
No related merge requests found
......@@ -390,6 +390,19 @@ public class RoleChangerTest {
roleChanger.checkFirstPendingRoleRequestXid(sw, xid));
}
@Test
public void testCheckFirstPendingRoleRequestNullSw() {
int xid = 54321;
long cookie = 232323;
Role role = Role.MASTER;
OFSwitchImpl sw = new OFSwitchImpl();
setupPendingRoleRequest(sw, xid, role, cookie);
// pass null as sw object, which is true during handshake
assertEquals(false,
roleChanger.checkFirstPendingRoleRequestXid(null, xid));
roleChanger.pendingRequestMap.get(sw).clear();
}
@Test
public void testCheckFirstPendingRoleRequestCookie() {
int xid = 54321;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment