コード例 #1
0
    @Test
    public void testStart() throws Throwable {
      host.start();

      try {
        ServiceHostUtils.waitForServiceAvailability(
            host, SERVICES_STARTUP_TIMEOUT, serviceSelfLinks.clone());
      } catch (TimeoutException e) {
        // we swallow up this exception so that down below we get a better message of what
        // service failed to start.
      }

      assertThat(host.checkServiceAvailable(ServiceUriPaths.DEFAULT_NODE_GROUP), is(true));
      assertThat(host.checkServiceAvailable(LuceneDocumentIndexService.SELF_LINK), is(true));
      assertThat(host.checkServiceAvailable(ServiceUriPaths.CORE_QUERY_TASKS), is(true));

      for (String selfLink : serviceSelfLinks) {
        assertThat(
            String.format("Failed to start service: %s", selfLink),
            host.checkServiceAvailable(selfLink),
            is(true));
      }

      assertThat(
          host.getClient().getConnectionLimitPerHost(),
          is(PhotonControllerXenonHost.DEFAULT_CONNECTION_LIMIT_PER_HOST));
    }
コード例 #2
0
 @BeforeMethod
 private void setUp() throws Throwable {
   createConfig();
   host =
       new PhotonControllerXenonHost(
           config.getXenonConfig(),
           hostClientFactory,
           agentControlClientFactory,
           null,
           null,
           null);
   cloudStoreServiceGroup = new CloudStoreServiceGroup(false);
   host.registerCloudStore(cloudStoreServiceGroup);
   host.start();
   ServiceHostUtils.waitForServiceAvailability(
       host, SERVICES_STARTUP_TIMEOUT, serviceSelfLinks.clone());
 }