@Test
public void testSendRoleRequestSlaveNotSupported() {

    LinkedList<OFSwitchImpl> switches = new LinkedList<OFSwitchImpl>();
    
    // a switch that doesn't support role requests
    OFSwitchImpl sw1 = EasyMock.createMock(OFSwitchImpl.class);
    Channel channel1 = createMock(Channel.class);
    expect(sw1.getChannel()).andReturn(channel1);
    // No support for NX_ROLE
    expect(sw1.getAttribute(IOFSwitch.SWITCH_SUPPORTS_NX_ROLE))
                    .andReturn(false); 
    expect(channel1.close()).andReturn(null);
    switches.add(sw1);
    
    replay(sw1, channel1);
    roleChanger.sendRoleRequest(switches, Role.SLAVE, 123456);
    verify(sw1, channel1);
    
    // sendRoleRequest needs to remove the switch from the list since
    // it closed its connection
    assertTrue(switches.isEmpty());
}