Package com.openshift.client

Examples of com.openshift.client.IDomain


  }

  @Test
  public void shouldReturnDomainByName() throws OpenShiftException {
    // pre-condition
    IDomain domain = DomainTestUtils.ensureHasDomain(user);

    // operation
    IDomain domainByNamespace = user.getDomain(domain.getId());

    // verification
    assertThat(domainByNamespace.getId()).isEqualTo(domain.getId());
  }
View Full Code Here


  @Test
  public void shouldGetDefaultDomain() throws OpenShiftException {
    // precondition
    DomainTestUtils.ensureHasDomain(user);
    // operation
    IDomain domain = user.getDefaultDomain();
    // verification
    assertNotNull(domain);
    assertNotNull(domain.getId());
    assertTrue(domain.getId().length() > 0);
    assertNotNull(domain.getSuffix());
    assertTrue(domain.getSuffix().length() > 0);
  }
View Full Code Here

  }

  @Test
  public void shouldReturnThatHasNamedDomain() throws OpenShiftException {
    // precondition
    IDomain domain = DomainTestUtils.ensureHasDomain(user);
    // operation
    Boolean hasDomain = user.hasDomain(domain.getId());
    // verification
    assertTrue(hasDomain);
  }
View Full Code Here

  }

  @Test
  public void shouldNoDefaultDomainAfterRefresh() throws OpenShiftException, FileNotFoundException, IOException {
    // precondition
    IDomain domain = DomainTestUtils.ensureHasDomain(user);
    assertNotNull(domain);

    IUser otherUser = new TestConnectionBuilder().defaultCredentials().disableSSLCertificateChecks().create().getUser();
    DomainTestUtils.destroyAllDomains(otherUser);
    assertNull(otherUser.getDefaultDomain());
View Full Code Here

            .mockGetApplications(
                "foobarz", GET_DOMAINS_FOOBARZ_APPLICATIONS_2EMBEDDED)
            .mockGetApplicationCartridges(
                "foobarz", "springeap6",
                GET_DOMAINS_FOOBARZ_APPLICATIONS_SPRINGEAP6_CARTRIDGES_2EMBEDDED);
    IDomain domain = mockDirector.getDomain("foobarz");
    this.application = domain.getApplicationByName("springeap6");
  }
View Full Code Here

        .mockGetApplications("foobarz",
            Samples.GET_DOMAINS_FOOBARZ_APPLICATIONS_SPRINGEAP_SCALABLE_DOWNLOADABLECART)
        .mockGetApplication("foobarz", "downloadablecart",
            GET_DOMAINS_FOOBARZ_APPLICATIONS_DOWNLOADABLECART);
   
    IDomain domain = mockDirector.getDomain("foobarz");
    IApplication downloadablecartApp = domain.getApplicationByName("downloadablecart");
    assertThat(downloadablecartApp).isNotNull();

    IEmbeddableCartridge foreman = new EmbeddableCartridge(new URL(FOREMAN_URL));
    new CartridgeAssert<IEmbeddableCartridge>(foreman)
        .hasUrl(CartridgeTestUtils.FOREMAN_URL)
View Full Code Here

        .mockGetApplicationCartridges(
            "foobarz", "springeap6",
            GET_DOMAINS_FOOBARZ_APPLICATIONS_SPRINGEAP6_CARTRIDGES_3EMBEDDED)
        .client();
    IUser user = new TestConnectionBuilder().defaultCredentials().create(client).getUser();
    IDomain domain = user.getDomain("foobarz");
    IApplication application = domain.getApplicationByName("springeap6");
    assertThat(application.getEmbeddedCartridges()).onProperty("name").contains("switchyard-0");

    // operation
    IEmbeddedCartridge switchyard = application.getEmbeddedCartridge("switchyard-0");
    // no properties in embedded block (within application)
View Full Code Here

      mockDirector.mockDeleteDomain("foobarz",
              new BadRequestException(
                  DELETE_DOMAINS_FOOBARZ_KO_EXISTINGAPPS.getContentAsString(),
                  new IOException(
                      "IOException message: Server returned HTTP response code: 400 for URL: https://openshift.redhat.com/broker/rest/domains/foobarz")));
      IDomain domain = user.getDefaultDomain();
      // operation
      domain.destroy();
      // verification
      fail("exception expected");
    } catch (OpenShiftEndpointException e) {
      // verification
      assertThat(e.getRestResponse()).isNotNull();
View Full Code Here

    Matcher matcher = APPLICATION_URL_PATTERN.matcher(application.getApplicationUrl());
    assertTrue(matcher.matches());
    assertTrue(matcher.groupCount() >= 3);

    assertEquals(application.getName(), matcher.group(1));
    IDomain domain = application.getDomain();
    assertEquals(domain.getId(), matcher.group(2));
    assertEquals(domain.getSuffix(), matcher.group(3));
  }
View Full Code Here

  public static IDomain ensureHasDomain(IUser user) throws OpenShiftException {
    return getFirstDomainOrCreate(user);
  }

  public static IDomain getFirstDomainOrCreate(IUser user) throws OpenShiftException {
    IDomain domain = null;
    domain = getFirstDomain(user);

    if (domain == null) {
      domain = user.createDomain(createRandomName());
    }
View Full Code Here

TOP

Related Classes of com.openshift.client.IDomain

Copyright © 2018 www.massapicom. 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.