Tabnine Logo
TestContext.getCompletion
Code IndexAdd Tabnine to your IDE (free)

How to use
getCompletion
method
in
com.vmware.xenon.common.test.TestContext

Best Java code snippets using com.vmware.xenon.common.test.TestContext.getCompletion (Showing top 20 results out of 315)

origin: vmware/admiral

protected URI register(VerificationHost host, Class<? extends Service> type)
    throws Exception {
  try {
    TestContext ctx = testCreate(1);
    Field f = type.getField("SELF_LINK");
    String path = (String) f.get(null);
    host.registerForServiceAvailability(ctx.getCompletion(), path);
    ctx.await();
  } catch (Throwable e) {
    throw new Exception(e);
  }
  return UriUtils.buildUri(host, type);
}
origin: vmware/admiral

protected void waitForServiceAvailability(ServiceHost h, String... serviceLinks)
    throws Throwable {
  if (serviceLinks == null || serviceLinks.length == 0) {
    throw new IllegalArgumentException("null or empty serviceLinks");
  }
  TestContext ctx = testCreate(serviceLinks.length);
  h.registerForServiceAvailability(ctx.getCompletion(), serviceLinks);
  ctx.await();
}
origin: vmware/xenon

public void waitForServiceAvailable(String... links) {
  for (String link : links) {
    TestContext ctx = testCreate(1);
    this.registerForServiceAvailability(ctx.getCompletion(), link);
    ctx.await();
  }
}
origin: com.vmware.xenon/xenon-common

public void waitForServiceAvailable(String... links) {
  for (String link : links) {
    TestContext ctx = testCreate(1);
    this.registerForServiceAvailability(ctx.getCompletion(), link);
    ctx.await();
  }
}
origin: vmware/admiral

private static void waitForDefaultRegistryCreated(ManagementHost host) {
  TestContext ctx = new TestContext(1, Duration.ofSeconds(120));
  host.log(Level.INFO, "Waiting for default registry to start.");
  host.registerForServiceAvailability(ctx.getCompletion(),
      RegistryService.DEFAULT_INSTANCE_LINK);
  ctx.await();
  host.log(Level.INFO, "Default registry started.");
}
origin: com.vmware.xenon/xenon-common

private void createUserServices(URI userFactorURI, List<URI> userServices)
    throws Throwable {
  TestContext ctx = this.host.testCreate(this.serviceCount);
  for (int i = 0; i < this.serviceCount; i++) {
    UserService.UserState s = new UserService.UserState();
    s.email = UUID.randomUUID().toString() + "@example.org";
    userServices.add(UriUtils.buildUri(this.host.getUri(),
        ExampleService.FACTORY_LINK, s.documentSelfLink));
    this.host.send(Operation.createPost(userFactorURI)
        .setBody(s)
        .setCompletion(ctx.getCompletion()));
  }
  this.host.testWait(ctx);
}
origin: vmware/xenon

private void createUserServices(URI userFactorURI, List<URI> userServices)
    throws Throwable {
  TestContext ctx = this.host.testCreate(this.serviceCount);
  for (int i = 0; i < this.serviceCount; i++) {
    UserService.UserState s = new UserService.UserState();
    s.email = UUID.randomUUID().toString() + "@example.org";
    userServices.add(UriUtils.buildUri(this.host.getUri(),
        ExampleService.FACTORY_LINK, s.documentSelfLink));
    this.host.send(Operation.createPost(userFactorURI)
        .setBody(s)
        .setCompletion(ctx.getCompletion()));
  }
  this.host.testWait(ctx);
}
origin: com.vmware.xenon/xenon-common

public Operation createServiceStartPost(TestContext ctx) {
  Operation post = Operation.createPost(null);
  post.setUri(UriUtils.buildUri(this, "service/" + post.getId()));
  return post.setCompletion(ctx.getCompletion());
}
origin: vmware/xenon

public Operation createServiceStartPost(TestContext ctx) {
  Operation post = Operation.createPost(null);
  post.setUri(UriUtils.buildUri(this, "service/" + post.getId()));
  return post.setCompletion(ctx.getCompletion());
}
origin: vmware/admiral

@Test
public void testNoHarborProperty() throws Exception {
  TestContext t = new TestContext(1, Duration.ofSeconds(15));
  harborInitRegistryService.handleStart(Operation
      .createGet(null)
      .setCompletion(t.getCompletion()));
  t.await();
  RegistryState harborRegistry = getHarborRegistry(false);
  assertNull(harborRegistry);
}
origin: vmware/xenon

Operation createMinimalTestServicePatch(String servicePath, TestContext ctx) {
  MinimalTestServiceState body = new MinimalTestServiceState();
  body.id = Utils.buildUUID("foo");
  Operation patch = Operation
      .createPatch(UriUtils.buildUri(this.host, servicePath))
      .setBody(body);
  if (ctx != null) {
    patch.setCompletion(ctx.getCompletion());
  }
  return patch;
}
origin: vmware/admiral

@Override
public Operation createServiceStartPost(TestContext ctx) {
  if (!enablePostgres) {
    return super.createServiceStartPost(ctx);
  }
  Operation post = Operation.createPost(null);
  post.setUri(UriUtils.buildUri(this, createServiceFactoryLink + "/" + post.getId()));
  return post.setCompletion(ctx.getCompletion());
}
origin: com.vmware.xenon/xenon-common

Operation createMinimalTestServicePatch(String servicePath, TestContext ctx) {
  MinimalTestServiceState body = new MinimalTestServiceState();
  body.id = Utils.buildUUID("foo");
  Operation patch = Operation
      .createPatch(UriUtils.buildUri(this.host, servicePath))
      .setBody(body);
  if (ctx != null) {
    patch.setCompletion(ctx.getCompletion());
  }
  return patch;
}
origin: vmware/xenon

public static void stopContinuousQuerySubscription(TestRequestSender s, ServiceHost host,
    URI notificationTarget, QueryTask qt) {
  TestContext ctx = new TestContext(1, s.getTimeout());
  Operation delete = Operation
      .createDelete(UriUtils.buildUri(notificationTarget, qt.documentSelfLink))
      .setReferer(host.getUri())
      .setCompletion(ctx.getCompletion());
  host.stopSubscriptionService(delete, notificationTarget);
  ctx.await();
}
origin: com.vmware.xenon/xenon-common

public static void stopContinuousQuerySubscription(TestRequestSender s, ServiceHost host,
    URI notificationTarget, QueryTask qt) {
  TestContext ctx = new TestContext(1, s.getTimeout());
  Operation delete = Operation
      .createDelete(UriUtils.buildUri(notificationTarget, qt.documentSelfLink))
      .setReferer(host.getUri())
      .setCompletion(ctx.getCompletion());
  host.stopSubscriptionService(delete, notificationTarget);
  ctx.await();
}
origin: vmware/admiral

private void doOperation(Action action, Object state) throws Throwable {
  TestContext ctx = testCreate(2);
  this.activeContext = ctx;
  // wait also for the update notification to get called in the handler.
  Operation op = new Operation();
  op.setUri(UriUtils.buildUri(host, this.state.documentSelfLink))
      .setAction(action)
      .setBody(state)
      .setCompletion(ctx.getCompletion());
  host.send(op);
  testWait(ctx);
}
origin: vmware/admiral

protected void stopService(Service s) throws Throwable {
  if (s == null || s.getSelfLink() == null || s.getSelfLink().isEmpty()) {
    return;
  }
  TestContext ctx = testCreate(1);
  Operation deleteOp = Operation.createDelete(UriUtils.buildUri(host, s.getSelfLink()))
      .addPragmaDirective(Operation.PRAGMA_DIRECTIVE_NO_INDEX_UPDATE)
      .setReplicationDisabled(true)
      .setCompletion(ctx.getCompletion())
      .setReferer(host.getUri());
  host.send(deleteOp);
  ctx.await();
}
origin: vmware/admiral

  protected void startInitialBootService(
      Class<? extends AbstractInitialBootService> serviceClass,
      String bootServiceSelfLink) throws Throwable {
    // simulate a restart of the service host
    host.startServiceAndWait(serviceClass, bootServiceSelfLink);

    TestContext ctx = testCreate(1);
    // start initialization of system documents
    host.sendRequest(Operation.createPost(
        UriUtils.buildUri(host, serviceClass))
        .setReferer(host.getUri())
        .setBody(new ServiceDocument())
        .setCompletion(ctx.getCompletion()));
    ctx.await();
  }
}
origin: vmware/xenon

protected void setUpAuthUsers()throws Throwable  {
  TestContext testContext = this.host.testCreate(1);
  // create admin user. if it already exists, skip creation.
  this.host.setSystemAuthorizationContext();
  AuthorizationSetupHelper.create()
      .setHost(this.host)
      .setUserEmail(this.adminEmail)
      .setUserPassword(this.adminPassword)
      .setUserSelfLink(this.adminEmail)
      .setIsAdmin(true)
      .setCompletion(testContext.getCompletion())
      .start();
  testContext.await();
  this.host.resetAuthorizationContext();
}
origin: com.vmware.xenon/xenon-common

protected void setUpAuthUsers()throws Throwable  {
  TestContext testContext = this.host.testCreate(1);
  // create admin user. if it already exists, skip creation.
  this.host.setSystemAuthorizationContext();
  AuthorizationSetupHelper.create()
      .setHost(this.host)
      .setUserEmail(this.adminEmail)
      .setUserPassword(this.adminPassword)
      .setUserSelfLink(this.adminEmail)
      .setIsAdmin(true)
      .setCompletion(testContext.getCompletion())
      .start();
  testContext.await();
  this.host.resetAuthorizationContext();
}
com.vmware.xenon.common.testTestContextgetCompletion

Popular methods of TestContext

  • await
  • fail
  • completeIteration
    Consider using #complete(). This method exists for backward compatibility, and may be deprecated/del
  • failIteration
    Consider using #fail(Throwable). This method exists for backward compatibility, and may be deprecate
  • <init>
  • complete
  • create
    Consider using #TestContext(int,Duration)This method exists for backward compatibility, and may be d
  • getExpectedFailureCompletion
  • getCompletionDeferred
  • logAfter
  • logBefore
  • setCheckInterval
  • logBefore,
  • setCheckInterval,
  • setTestName,
  • waitFor

Popular in Java

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • getExternalFilesDir (Context)
  • runOnUiThread (Activity)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Permission (java.security)
    Legacy security code; do not use.
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • JTable (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now