Package com.openshift.client

Examples of com.openshift.client.IApplication


  }

  @Test
  public void shouldEmbedMongo() throws Exception {
    // pre-conditions
    IApplication application = ApplicationTestUtils.ensureHasExactly1Application(domain);
    EmbeddedCartridgeTestUtils.silentlyDestroyAllEmbeddedCartridges(application);
    IEmbeddableCartridge mongo = LatestVersionOf.mongoDB().get(user);
    assertThat(new ApplicationAssert(application))
      .hasNotEmbeddableCartridge(mongo);

    // operation
    application.addEmbeddableCartridge(LatestVersionOf.mongoDB().get(user));

    // verification
    assertThat(new ApplicationAssert(application)
        .hasEmbeddedCartridge(LatestVersionOf.mongoDB()));
    new EmbeddedCartridgeAssert(application.getEmbeddedCartridge(mongo))
        .hasUrlProperty();
  }
View Full Code Here


  @Test
  public void shouldHaveUrlInEmbeddedMongo() throws OpenShiftException, URISyntaxException, FileNotFoundException,
      IOException {
    // pre-conditions
    IApplication jbossAs = ApplicationTestUtils.getOrCreateApplication(domain);
    EmbeddedCartridgeTestUtils.silentlyDestroyAllEmbeddedCartridges(jbossAs);

    // operation
    jbossAs.addEmbeddableCartridge(LatestVersionOf.mongoDB().get(user));

    // verification
    new EmbeddedCartridgeAssert(jbossAs.getEmbeddedCartridge(LatestVersionOf.mongoDB().get(user)))
        .hasUrlProperty();
    // verify using user instance that's not the one used to create
    IUser user2 = new TestConnectionBuilder().defaultCredentials().disableSSLCertificateChecks().create().getUser();
    IApplication user2Application = user2.getDefaultDomain().getApplicationByName(jbossAs.getName());
    IEmbeddableCartridge mongo = LatestVersionOf.mongoDB().get(user2);
    new EmbeddedCartridgeAssert(user2Application.getEmbeddedCartridge(mongo))
        .hasUrlProperty();
  }
View Full Code Here

  @Test
  public void shouldEmbedRockMongo() throws Exception {
    // pre-conditions
    // have to make sure have non-scalable app without cartridges
    IApplication jbossAs = ApplicationTestUtils.getOrCreateApplication(domain);
    jbossAs = ApplicationTestUtils.destroyAndRecreateIfScalable(jbossAs);
    EmbeddedCartridgeTestUtils.silentlyDestroyAllEmbeddedCartridges(jbossAs);

    assertThat(new ApplicationAssert(jbossAs)
        .hasNotEmbeddableCartridges(LatestVersionOf.mongoDB())
        .hasNotEmbeddableCartridges(LatestVersionOf.rockMongo()));

    // operation
    jbossAs.addEmbeddableCartridge(LatestVersionOf.mongoDB().get(user));
    jbossAs.addEmbeddableCartridge(LatestVersionOf.rockMongo().get(user));

    // verification
    assertThat(new ApplicationAssert(jbossAs)
        .hasEmbeddedCartridge(LatestVersionOf.mongoDB())
        .hasEmbeddedCartridge(LatestVersionOf.rockMongo()));
View Full Code Here

  @Test
  public void shouldHaveUrlInEmbeddedRockMongo()
      throws OpenShiftException, URISyntaxException, FileNotFoundException, IOException {
    // pre-conditions
    IApplication jbossAs = ApplicationTestUtils.getOrCreateApplication(domain);
    jbossAs = ApplicationTestUtils.destroyAndRecreateIfScalable(jbossAs);
    EmbeddedCartridgeTestUtils.silentlyDestroyAllEmbeddedCartridges(jbossAs);
    assertThat(new ApplicationAssert(jbossAs)
        .hasNotEmbeddableCartridges(LatestVersionOf.mongoDB())
        .hasNotEmbeddableCartridges(LatestVersionOf.rockMongo()));

    // operation
    jbossAs.addEmbeddableCartridge(LatestVersionOf.mongoDB().get(user));
    jbossAs.addEmbeddableCartridge(LatestVersionOf.rockMongo().get(user));

    // verification
    IEmbeddableCartridge rockMongo = LatestVersionOf.rockMongo().get(user);
    new EmbeddedCartridgeAssert(jbossAs.getEmbeddedCartridge(rockMongo))
        .hasUrlProperty();
    // verify using user instance that's not the one used to create
    IUser user2 = new TestConnectionBuilder().defaultCredentials().disableSSLCertificateChecks().create().getUser();
    IApplication user2Application = user2.getDefaultDomain().getApplicationByName(jbossAs.getName());
    assertThat(new ApplicationAssert(user2Application)).hasEmbeddedCartridges(
        LatestVersionOf.mongoDB(), LatestVersionOf.rockMongo());
    new EmbeddedCartridgeAssert(user2Application.getEmbeddedCartridge(rockMongo))
        .hasUrlProperty();
  }
View Full Code Here

  }

  @Test
  public void shouldEmbedPhpMyAdmin() throws Exception {
    // pre-conditions
    IApplication jbossAs = ApplicationTestUtils.getOrCreateApplication(domain);
    jbossAs = ApplicationTestUtils.destroyAndRecreateIfScalable(jbossAs);
    EmbeddedCartridgeTestUtils.silentlyDestroyAllEmbeddedCartridges(jbossAs);
    assertThat(new ApplicationAssert(jbossAs)
        .hasNotEmbeddableCartridges(LatestVersionOf.mySQL())
        .hasNotEmbeddableCartridges(LatestVersionOf.phpMyAdmin()));

    // operation
    jbossAs.addEmbeddableCartridge(LatestVersionOf.mySQL().get(user));
    jbossAs.addEmbeddableCartridge(LatestVersionOf.phpMyAdmin().get(user));

    // verification
    assertThat(new ApplicationAssert(jbossAs)
        .hasEmbeddedCartridge(LatestVersionOf.mySQL()))
        .hasEmbeddedCartridge(LatestVersionOf.phpMyAdmin());
View Full Code Here

  @Test
  public void shouldHaveUrlInEmbeddedPhpMyadmin()
      throws OpenShiftException, URISyntaxException, FileNotFoundException, IOException {
    // pre-conditions
    // pre-conditions
    IApplication jbossAs = ApplicationTestUtils.getOrCreateApplication(domain);
    jbossAs = ApplicationTestUtils.destroyAndRecreateIfScalable(jbossAs);
    EmbeddedCartridgeTestUtils.silentlyDestroyAllEmbeddedCartridges(jbossAs);
    assertThat(new ApplicationAssert(jbossAs)
        .hasNotEmbeddableCartridges(LatestVersionOf.mySQL())
        .hasNotEmbeddableCartridges(LatestVersionOf.phpMyAdmin()));

    // operation
    jbossAs.addEmbeddableCartridge(LatestVersionOf.mySQL().get(user));
    jbossAs.addEmbeddableCartridge(LatestVersionOf.phpMyAdmin().get(user));

    // verification
    IEmbeddableCartridge phpMyadmin = LatestVersionOf.phpMyAdmin().get(user);
    new EmbeddedCartridgeAssert(jbossAs.getEmbeddedCartridge(phpMyadmin))
        .hasUrlProperty();
    // verify using user instance that's not the one used to create
    IUser user2 = new TestConnectionBuilder().defaultCredentials().disableSSLCertificateChecks().create().getUser();
    IApplication user2Application = user2.getDefaultDomain().getApplicationByName(jbossAs.getName());
    IEmbeddableCartridge phpMyAdmin = LatestVersionOf.phpMyAdmin().get(user2);
    new EmbeddedCartridgeAssert(user2Application.getEmbeddedCartridge(phpMyAdmin))
        .hasUrlProperty();
  }
View Full Code Here

  @Test
  public void shouldEmbedJenkinsClient() throws Exception {
    // pre-conditions
    // need 2 free gears; jenkins + builder
    IApplication application = ApplicationTestUtils.ensureHasExactly1Application(domain);
    EmbeddedCartridgeTestUtils.silentlyDestroyAllEmbeddedCartridges(application);
    ApplicationTestUtils.createApplication(
        LatestVersionOf.jenkins().get(user), domain);

    // operation
    application.addEmbeddableCartridge(LatestVersionOf.jenkinsClient().get(user));

    // verification
    assertThat(new ApplicationAssert(application)
        .hasEmbeddedCartridge(LatestVersionOf.jenkinsClient()));
  }
View Full Code Here

   */
  @Test
  public void shouldHaveUrlInEmbeddedJenkinsClient() throws OpenShiftException, URISyntaxException,
      FileNotFoundException, IOException {
    // pre-conditions
    IApplication jbossAs = ApplicationTestUtils.getOrCreateApplication(domain);
    jbossAs = ApplicationTestUtils.destroyAndRecreateIfScalable(jbossAs);
    EmbeddedCartridgeTestUtils.silentlyDestroyAllEmbeddedCartridges(jbossAs);
    ApplicationTestUtils.getOrCreateApplication(domain, LatestVersionOf.jenkins().get(user));

    // operation
    EmbeddedCartridgeTestUtils.ensureHasEmbeddedCartridges(LatestVersionOf.jenkinsClient(), jbossAs);

    // verification
    new EmbeddedCartridgeAssert(jbossAs.getEmbeddedCartridge(LatestVersionOf.jenkinsClient().get(user)))
        .hasUrlProperty();
    // verify using user instance that's not the one used to create
    IUser user2 = new TestConnectionBuilder().defaultCredentials().disableSSLCertificateChecks().create().getUser();
    IApplication user2Application = user2.getDefaultDomain().getApplicationByName(jbossAs.getName());
    IEmbeddableCartridge jenkinsClient =
        LatestVersionOf.jenkinsClient().get(user2);
    new EmbeddedCartridgeAssert(user2Application.getEmbeddedCartridge(jenkinsClient))
        .hasUrlProperty();
  }
View Full Code Here

  }

  @Test
  public void shouldEmbedDownloadableCartridge() throws Exception {
    // pre-conditions
    IApplication application = ApplicationTestUtils.ensureHasExactly1Application(domain);
    EmbeddedCartridgeTestUtils.silentlyDestroyAllEmbeddedCartridges(application);
    assertThat(new ApplicationAssert(application))
      .hasNotEmbeddableCartridge(CartridgeTestUtils.foreman063());

    // operation
    application.addEmbeddableCartridge(CartridgeTestUtils.foreman063());

    // verification
    new ApplicationAssert(application)
        .hasEmbeddedCartridgeNames(CartridgeTestUtils.foreman063().getName());
  }
View Full Code Here

  }
 
  @Test(expected = OpenShiftEndpointException.class)
  public void shouldNotAddEmbeddedCartridgeTwice() throws Exception {
    // pre-conditions
    IApplication application = ApplicationTestUtils.ensureHasExactly1Application(domain);
    EmbeddedCartridgeTestUtils.ensureHasEmbeddedCartridges(LatestVersionOf.mySQL(), application);

    // operation
    application.addEmbeddableCartridge(LatestVersionOf.mySQL().get(user));
  }
View Full Code Here

TOP

Related Classes of com.openshift.client.IApplication

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.