@Test
public void testDoExecute() throws Exception
{

    //check by hostname
    command.identifier = HOSTNAME;
    command.doExecute();
    assertThat( getSysOut(), containsString( resourceHostInfo.toString() ) );
    //check by id
    command.identifier = ID;
    command.doExecute();
    assertThat( getSysOut(), containsString( resourceHostInfo.toString() ) );
    //check exception
    HostDisconnectedException exception = mock( HostDisconnectedException.class );
    doThrow( exception ).when( hostRegistry ).getResourceHostInfoById( ID );
    doThrow( exception ).when( hostRegistry ).getResourceHostInfoByHostname( ID );
    resetSysOut();
    command.doExecute();
    assertEquals( "Host is not connected", getSysOut() );
    verify( exception ).printStackTrace( any( PrintStream.class ) );
}