@Test
public void testSendRoleRequestSupported() throws Exception {

    LinkedList<OFSwitchImpl> switches = new LinkedList<OFSwitchImpl>();
    
    // a switch that supports role requests
    OFSwitchImpl sw1 = EasyMock.createMock(OFSwitchImpl.class);
    // No support for NX_ROLE
    expect(sw1.getAttribute(IOFSwitch.SWITCH_SUPPORTS_NX_ROLE))
                    .andReturn(true); 
    expect(sw1.sendNxRoleRequest(Role.MASTER, 123456)).andReturn(1).once();
    switches.add(sw1);
    
    // a switch for which we don't have SUPPORTS_NX_ROLE yet
    OFSwitchImpl sw2 = EasyMock.createMock(OFSwitchImpl.class);
    // No support for NX_ROLE
    expect(sw2.getAttribute(IOFSwitch.SWITCH_SUPPORTS_NX_ROLE))
                    .andReturn(null); 
    expect(sw2.sendNxRoleRequest(Role.MASTER, 123456)).andReturn(1).once();
    switches.add(sw2);
    
    
    replay(sw1, sw2);
    roleChanger.sendRoleRequest(switches, Role.MASTER, 123456);
    verify(sw1, sw2);
    
    assertEquals(2, switches.size());
}