Package com.openshift.client.cartridge

Examples of com.openshift.client.cartridge.IStandaloneCartridge


    }

    private void createApp() throws IOException, OpenShiftException {
      IOpenShiftConnection connection = OpenShiftCloud.get().getOpenShiftConnection();
      IUser user = connection.getUser();
      IStandaloneCartridge cartridge = getCartridge(OpenShiftCloud.get().getOpenShiftConnection());

      IDomain domain = user.getDomain(getNamespace());
      List<IGearProfile> gearProfiles = domain.getAvailableGearProfiles();
      IGearProfile gearProfile = gearProfiles.get(0);
      for (IGearProfile profile : gearProfiles) {
        if (profile.getName().equals(builderSize)) {
          gearProfile = profile;
        }
      }

      LOGGER.info("Creating builder application " + cartridge.getName() + " "
              + name + " " + user.getDomain(getNamespace()).getId() + " of size "
              + gearProfile.getName() + " ...");

      ApplicationScale scale = ApplicationScale.NO_SCALE;
      if(builderPlatform.equalsIgnoreCase(Platform.WINDOWS.toString())) {
View Full Code Here


   */
  private List<IApplication> loadApplications() throws OpenShiftException {
    List<IApplication> apps = new ArrayList<IApplication>();
    List<ApplicationResourceDTO> applicationDTOs = new ListApplicationsRequest().execute();
    for (ApplicationResourceDTO applicationDTO : applicationDTOs) {
      final IStandaloneCartridge cartridge = new StandaloneCartridge(applicationDTO.getFramework());
      final IApplication application =
          new ApplicationResource(applicationDTO, cartridge, this);
      apps.add(application);
    }
    return apps;
View Full Code Here

      protected <C extends ICartridge> String getProperty(C cartridge) {
        return cartridge.getDescription();
      }
    };
    // operation
    IStandaloneCartridge nodeJs = query.get(standaloneCartridges);

    // verification
    new CartridgeAssert<IStandaloneCartridge>(nodeJs)
        .hasName("nodejs-0.6");
View Full Code Here

  @Test
  public void shouldCreateApplicationWithStandaloneAndEmbeddableCartridges() {
    // pre-conditions
   
    String name = "redberret";
    IStandaloneCartridge as7 = CartridgeTestUtils.as7();
    IEmbeddableCartridge[] embedded =
        new IEmbeddableCartridge[] { CartridgeTestUtils.mysql51(), CartridgeTestUtils.mongodb22() };
    IGearProfile gear = new GearProfile("screamforicecream");
    ApplicationScale scale = ApplicationScale.NO_SCALE;
    int timeout = 42;
View Full Code Here

  }

  @Test
  public void shouldNotContainTypeInEmbeddedCartridges() throws SocketTimeoutException, OpenShiftException {
    // pre-conditions
    final IStandaloneCartridge php = LatestVersionOf.php().get(user);
    assertThat(php).isNotNull();
    IApplication application = ApplicationTestUtils.ensureHasExactly1Application(php, domain);

    // operation
    List<IEmbeddedCartridge> embeddedCartridges = application.getEmbeddedCartridges();
    // verification
    assertThat(embeddedCartridges).doesNotSatisfy(new Condition<List<?>>() {
     
      @Override
      public boolean matches(List<?> values) {
        for(Object value : values) {
          if (!(value instanceof ICartridge)) {
            continue;
          }
          if (php.getName().equals(((ICartridge)value).getName())) {
            return true;
          };
        }
        return false;
      }
View Full Code Here

  }

  @Test
  public void shouldHaveNameDisplaynameDescription() throws Throwable {
    // pre-condition
    IStandaloneCartridge nodeJs = connection.getStandaloneCartridges().get(0);
    CartridgeAssert<IStandaloneCartridge> cartridgeAssert = new CartridgeAssert<IStandaloneCartridge>(nodeJs);

    // operation
    // verifcation
    cartridgeAssert
View Full Code Here

  public static IApplication ensureHasExactly1Application(IDomain domain) {
    return ensureHasExactly1Application(getDefaultCartridge(domain), domain);
  }
 
  public static IApplication ensureHasExactly1Application(LatestStandaloneCartridge selector, IDomain domain) {
    IStandaloneCartridge cartridge = selector.get(domain.getUser());
    ensureHasExactly(1, cartridge, domain);
    return domain.getApplications().get(0);
  }
View Full Code Here

   * @param application
   * @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);
    }
View Full Code Here

  @Test
  public void shouldReportStandaloneCartridge() throws OpenShiftException, URISyntaxException {
    // precondition

    // operation
    IStandaloneCartridge cartridge = application.getCartridge();

    // verification
    assertThat(cartridge).isNotNull();
    assertThat(cartridge.getName()).isNotEmpty();
    IStandaloneCartridge availableCartridge = new CartridgeNameQuery(cartridge.getName()).get(user.getConnection()
        .getStandaloneCartridges());
    new StandaloneCartridgeAssert(cartridge).equals(availableCartridge);
  }
View Full Code Here

    ApplicationTestUtils.destroyIfMoreThan(2, domain);

    // operation
    String applicationName =
        ApplicationTestUtils.createRandomApplicationName();
    IStandaloneCartridge php = LatestVersionOf.php().get(user);
    IApplication application =
        domain.createApplication(applicationName, php);

    // verification
    assertThat(new ApplicationAssert(application))
View Full Code Here

TOP

Related Classes of com.openshift.client.cartridge.IStandaloneCartridge

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.