Package com.openshift.client

Examples of com.openshift.client.IApplication


    }
  }

  public static void destroyAllByCartridge(ICartridge cartridge, IDomain domain) {
    for (Iterator<IApplication> it = domain.getApplications().iterator(); it.hasNext();) {
      IApplication application = it.next();
      if (!application.getCartridge().equals(cartridge)) {
        application.destroy();
      }
    }
  }
View Full Code Here


    return domain.getApplications().get(0);
  }

  public static IApplication ensureHasExactly1NonScalableApplication(LatestStandaloneCartridge selector,
      IDomain domain) {
    IApplication application = ensureHasExactly1Application(selector, domain);
    return destroyAndRecreateIfScalable(application);
  }
View Full Code Here

        .mockGetApplications(
            "foobarz", GET_DOMAINS_FOOBARZ_APPLICATIONS_3EMBEDDED)
        .client();
    IUser user = new TestConnectionBuilder().defaultCredentials().create(httpClient).getUser();
    IDomain domain = user.getDomain("foobarz");
    IApplication application = domain.getApplicationByName("springeap6");

    IDeployedStandaloneCartridge cartridge = application.getCartridge();

    cartridge.setAdditionalGearStorage(40);

    verify(httpClient, times(1)).put(
        urlEndsWith("applications/springeap6/cartridges/jbosseap-6"),
View Full Code Here

    IUser newUser = new TestConnectionBuilder()
        .defaultCredentials()
        .disableSSLCertificateChecks()
        .create()
        .getUser();
    IApplication newApplication = newUser.getDefaultDomain().getApplicationByName(application.getName());
    IDeployedStandaloneCartridge newCartridge = newApplication.getCartridge();
    new StandaloneCartridgeAssert(newCartridge).isEqualTo(cartridge);
    assertThat(newCartridge.getAdditionalGearStorage()).isEqualTo(additionalGearStorage);
  }
View Full Code Here

        .mockPostApplicationEvent(
            "foobarz",
            "springeap6",
            new InternalServerErrorException(
                "Failed to add event add-alias to application springeap6 due to: Alias 'jbosstools.org' already exists for 'springeap6'"));
    final IApplication app = domain.getApplicationByName("springeap6");
    assertThat(app.getAliases()).hasSize(1).contains("jbosstools.org");

    // operation
    try {
      app.addAlias("jbosstools.org");
      fail("Expected an exception..");
    } catch (OpenShiftEndpointException e) {

      // verifications
      assertThat(e.getCause()).isInstanceOf(InternalServerErrorException.class);
    }
    assertThat(app.getAliases()).hasSize(1).contains("jbosstools.org");
    mockDirector.verifyPostApplicationEvent("foobarz", "springeap6");
  }
View Full Code Here

  public void shouldRemoveAliasFromApplication() throws Throwable {
    // pre-conditions
    mockDirector
        .mockPostApplicationEvent(
            "foobarz", "springeap6", GET_DOMAINS_FOOBARZ_APPLICATIONS_SPRINGEAP6_0ALIAS);
    final IApplication app = domain.getApplicationByName("springeap6");
    assertThat(app.getAliases()).hasSize(1).contains("jbosstools.org");

    // operation
    app.removeAlias("jbosstools.org");

    // verifications
    mockDirector.verifyPostApplicationEvent("foobarz", "springeap6");
    assertThat(app.getAliases()).hasSize(0);
  }
View Full Code Here

        .mockPostApplicationEvent(
            "foobarz",
            "springeap6",
            new InternalServerErrorException(
                "Failed to add event remove-alias to application springeap6 due to: Alias 'openshift-origin.org' does not exist for 'springeap6'"));
    final IApplication app = domain.getApplicationByName("springeap6");
    assertThat(app).isNotNull();
    assertThat(app.getAliases()).hasSize(1).contains("jbosstools.org");
    // operation
    try {
      app.removeAlias("openshift-origin.org");
      fail("Expected an exception..");
    } catch (OpenShiftEndpointException e) {

      // verifications
      assertThat(e.getCause()).isInstanceOf(InternalServerErrorException.class);
    }
    assertThat(app.getAliases()).hasSize(1).contains("jbosstools.org");
    mockDirector.verifyPostApplicationEvent("foobarz", "springeap6");
  }
View Full Code Here

        .mockGetApplications("foobarz",
            GET_DOMAINS_FOOBARZ_APPLICATIONS_2EMBEDDED)
        .mockGetApplicationCartridges("foobarz", "springeap6",
            GET_DOMAINS_FOOBARZ_APPLICATIONS_SPRINGEAP6_CARTRIDGES_2EMBEDDED);

    final IApplication app = domain.getApplicationByName("springeap6");

    // operation
    final List<IEmbeddedCartridge> embeddedCartridges = app.getEmbeddedCartridges();

    // verifications
    assertThat(embeddedCartridges).hasSize(2);
  }
View Full Code Here

  @Test
  public void shouldGetEmbeddableCartridgeByCartridge() throws Throwable {
    // pre-conditions
    // operation
    final IApplication app = domain.getApplicationByName("springeap6");
    IEmbeddedCartridge mongo = app.getEmbeddedCartridge(CartridgeTestUtils.mongodb22());
    // verifications
    // embedded cartridge should get updated with name, description and
    // display name
    new EmbeddedCartridgeAssert(mongo);
  }
View Full Code Here

    mockDirector
        .mockGetApplications("foobarz",
            Samples.GET_DOMAINS_FOOBARZ_APPLICATIONS_SPRINGEAP_SCALABLE_DOWNLOADABLECART);

    IDomain domain = mockDirector.getDomain("foobarz");
    IApplication application = domain.getApplicationByName("downloadablecart");
    assertThat(application).isNotNull();

    IEmbeddableCartridge foreman = new EmbeddableCartridge(null, new URL(FOREMAN_URL));
    new CartridgeAssert<IEmbeddableCartridge>(foreman)
        .hasUrl(CartridgeTestUtils.FOREMAN_URL)
        .hasName(null)
        .hasDescription(null)
        .hasDisplayName(null);

    // operation
    IEmbeddedCartridge embeddedForeman = application.getEmbeddedCartridge(foreman);
    // verifications
    // embedded cartridge should get updated with name, description and
    // display name
    new EmbeddedCartridgeAssert(embeddedForeman)
        .hasUrl(CartridgeTestUtils.FOREMAN_URL);
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.