Examples of IDomain


Examples of com.openshift.client.IDomain

    return domain;
  }

  public static IDomain getFirstDomain(IUser user) throws OpenShiftException {
    IDomain domain = null;
    Iterator<IDomain> domainIterator = user.getDomains().iterator();
    if (domainIterator.hasNext()) {
      domain = domainIterator.next();
    }
    return domain;
View Full Code Here

Examples of com.openshift.client.IDomain

  public void shouldCreateNewDomain() throws Throwable {
    // pre-conditions
    mockDirector.mockCreateDomain(GET_DOMAINS_FOOBARS);
    int numOfDomains = user.getDomains().size();
    // operation
    final IDomain domain = user.createDomain("foobars");
    // verifications
    assertThat(user.getDomains().size()).isSameAs(numOfDomains + 1);
    assertThat(domain.getId()).isEqualTo("foobars");
    assertThat(domain.getSuffix()).isEqualTo("rhcloud.com");
  }
View Full Code Here

Examples of com.openshift.client.IDomain

  @Test
  public void shouldDestroyDomain() throws Throwable {
    // pre-conditions
    mockDirector.mockDeleteDomain("foobarz", DELETE_DOMAINS_FOOBARZ);
    // operation
    final IDomain domain = user.getDomain("foobarz");
    domain.destroy();
    // verifications
    assertThat(user.getDomain("foobarz")).isNull();
    // 2 domains, 1 destroyed
    assertThat(user.getDomains()).hasSize(1);
  }
View Full Code Here

Examples of com.openshift.client.IDomain

  public void shouldNotDestroyDomainWithApp() throws Throwable {
    // pre-conditions
    mockDirector.mockDeleteDomain("foobarz",
        new BadRequestException("Domain contains applications. Delete applications first or set force to true.", null));
    // operation
    final IDomain domain = user.getDomain("foobarz");
    try {
      domain.destroy();
      fail("Expected an exception here..");
    } catch (OpenShiftEndpointException e) {
      assertThat(e.getCause()).isInstanceOf(BadRequestException.class);
    }
    // verifications
View Full Code Here

Examples of com.openshift.client.IDomain

  @Test
  public void shouldUpdateDomainId() throws Throwable {
    // pre-conditions
    mockDirector.mockRenameDomain("foobarz", GET_DOMAINS_FOOBARS);
    final IDomain domain = user.getDomain("foobarz");
    // operation
    domain.rename("foobars");
    // verifications
    assertThat(domain.getId()).isEqualTo("foobars");
    final IDomain updatedDomain = user.getDomain("foobars");
    assertThat(updatedDomain).isNotNull();
    assertThat(updatedDomain.getId()).isEqualTo("foobars");
    mockDirector.verifyRenameDomain("foobarz");
  }
View Full Code Here

Examples of com.openshift.client.IDomain

  }

  @Test
  public void shouldListAvailableGearSizes() throws Throwable {
    // pre-conditions
    final IDomain domain = user.getDomain("foobarz");
    // operation
    List<IGearProfile> availableGearSizes = domain.getAvailableGearProfiles();
    // verifications
    assertThat(availableGearSizes.size() > 0);
  }
View Full Code Here

Examples of com.openshift.client.IDomain

    // pre-conditions
    mockDirector
      .mockGetDomain("foobarz", GET_DOMAINS_FOOBARZ)
      .mockGetApplications("foobarz", GET_DOMAINS_FOOBARZ_APPLICATIONS_1EMBEDDED);
   
    final IDomain domain = user.getDomain("foobarz");
    assertThat(domain).isNotNull();

    // operation
    domain.refresh();

    // verifications
    mockDirector
      .verifyGetDomain("foobarz") // explicit refresh
      .verifyGetApplications("foobarz", 1); // two calls, before and while refresh
View Full Code Here

Examples of com.openshift.client.IDomain

    // pre-conditions
    mockDirector
      .mockGetDomain("foobarz", GET_DOMAINS_FOOBARZ)
      .mockGetApplications("foobarz", GET_DOMAINS_FOOBARZ_APPLICATIONS_1EMBEDDED);
   
    final IDomain domain = user.getDomain("foobarz");
    assertThat(domain).isNotNull();
   
    // operation
    domain.getApplications();
    domain.refresh();

    // verifications
    mockDirector
      .verifyGetDomain("foobarz") // explicit refresh
      .verifyGetApplications("foobarz", 2); // two calls, before and while refresh
View Full Code Here

Examples of com.openshift.client.IDomain

   * @return
   */
  public static IApplication destroyAndRecreateIfScalable(IApplication application) {
    if (!ApplicationScale.NO_SCALE.equals(application.getGearProfile())) {
      IStandaloneCartridge cartridge = application.getCartridge();
      IDomain domain = application.getDomain();
      application.destroy();
      application = domain.createApplication(
          createRandomApplicationName(), cartridge, ApplicationScale.NO_SCALE);
    }
    return application;
  }
View Full Code Here

Examples of com.openshift.client.IDomain

  }
 
  @Test
  public void shouldReportCannotCreateAppWithEnvVars() throws Throwable {
    // pre-conditions
    IDomain domain = user.getDomain("foobarz");
    assertThat(domain).isNotNull();
   
    // operation
    boolean canCreateWithEnvVars = domain.canCreateApplicationWithEnvironmentVariables();

    // verifications
    assertThat(canCreateWithEnvVars).isFalse();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.