source: class ResourceHostEntityTest {
  
      private static final String PEER_ID;
      private static final String HOST_ID;
      private static final String CONTAINER_HOST_ID;
      private static final String CONTAINER_HOST_NAME;
      private static final String HOSTNAME;
      private static final HostArchitecture ARCH;
      private static final String INTERFACE_NAME;
      private static final String IP;
      private static final String CONTAINER_STATUS_STARTED;
      private static final String CONTAINER_STATUS_STOPPED;
      @Mock ContainerHostEntity containerHost;
      @Mock Monitor monitor;
      @Mock CommandUtil commandUtil;
      @Mock TemplateManager registry;
      @Mock HostRegistry hostRegistry;
      @Mock Peer peer;
      @Mock ResourceHostInfo hostInfo;
      @Mock HostInterfaceModel anHostInterface;
      @Mock Callable callable;
      @Mock CommandResult commandResult;
      @Mock Future future;
       ResourceHostEntity resourceHostEntity;
      @Mock
      private HostInterfaces hostInterfaces;
      @Mock
      private ContainerQuota quota;
  
      @Test
      public void testGetContainerHostState() throws Exception
      {
  
target:         try
          {
              resourceHostEntity.getContainerHostState( containerHost );
              fail( "Expected ResourceHostException" );
          }
          catch ( ResourceHostException e )
          {
          }
  
  
          when( commandResult.getStdOut() ).thenReturn( CONTAINER_STATUS_STARTED );
          resourceHostEntity.addContainerHost( containerHost );
  
          ContainerHostState state = resourceHostEntity.getContainerHostState( containerHost );
  
          assertEquals( ContainerHostState.RUNNING, state );
  
  
          when( commandResult.getStdOut() ).thenReturn( "" );
  
          state = resourceHostEntity.getContainerHostState( containerHost );
  
          assertEquals( ContainerHostState.UNKNOWN, state );
  
          doThrow( new CommandException( "" ) ).when( commandUtil )
                                               .execute( any( RequestBuilder.class ), eq( resourceHostEntity ) );
  
          try
          {
              resourceHostEntity.getContainerHostState( containerHost );
              fail( "Expected ResourceHostException" );
          }
          catch ( ResourceHostException e )
          {
          }
      }
  
  }