Package com.openshift.client

Examples of com.openshift.client.IUser


    // 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


    // 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

    // 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

    assertThat(new ApplicationAssert(application)
        .hasEmbeddedCartridge(LatestVersionOf.mySQL()));

    // operation
    // use user instance that's not the one used to create
    IUser user2 = new TestConnectionBuilder().defaultCredentials().disableSSLCertificateChecks().create().getUser();
    IApplication user2Application = user2.getDefaultDomain().getApplicationByName(application.getName());
    user2Application.removeEmbeddedCartridge(LatestVersionOf.mySQL().get(user2));
    assertThat(new ApplicationAssert(user2Application)
        .hasNotEmbeddableCartridges(LatestVersionOf.mySQL()));

    // verification
View Full Code Here

    IOpenShiftSSHKey key = null;
    int originalNumOfKeys = user.getSSHKeys().size();
    try {
      // pre-conditions
      String publicKeyPath = SSHKeyTestUtils.createDsaKeyPair();
      IUser user = new TestConnectionBuilder().defaultCredentials().disableSSLCertificateChecks().create().getUser();
     
      // operation
      int newNumOfKeys = user.getSSHKeys().size();
      assertThat(user.getSSHKeys().size()).isEqualTo(originalNumOfKeys);
      String newKeyName = SSHKeyTestUtils.createRandomKeyName();
      user.addSSHKey(newKeyName, new SSHPublicKey(publicKeyPath));     
      newNumOfKeys = user.getSSHKeys().size();
     
      // verification
      assertThat(newNumOfKeys).isEqualTo(originalNumOfKeys + 1);
    } finally {
      SSHKeyTestUtils.silentlyDestroyKey(key);
View Full Code Here

  @Test
  public void shouldLoadEmptyListOfDomains() throws Throwable {
    // pre-conditions
    HttpClientMockDirector mockBuilder = new HttpClientMockDirector();
    IHttpClient clientMock =  mockBuilder.mockGetDomains(GET_DOMAINS_EMPTY).client();
    IUser user = new TestConnectionBuilder().defaultCredentials().create(clientMock).getUser();
    // operation
    final List<IDomain> domains = user.getDomains();
    // verifications
    assertThat(domains).hasSize(0);
    // 3 calls: /API + /API/user + /API/domains
    mockBuilder
      .verifyGetAny(3)
View Full Code Here

  }

  @Test
  public void shouldEqualDomainFromOtherUser() throws Throwable {
    // pre-conditions
    IUser user = new TestConnectionBuilder().defaultCredentials().create(clientMock).getUser();

    // operation
    final IDomain domain = user.getDomain("foobarz");

    // verifications
    assertThat(domain).isEqualTo(this.domain);
    assertTrue(domain != this.domain); // not same objects
  }
View Full Code Here

    IHttpClient httpClient = builder
        .mockGetDomains(GET_DOMAINS)
        .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);
View Full Code Here

    // operation
    cartridge.setAdditionalGearStorage(additionalGearStorage);

    // verification
    // reload user info to ensure the storage info isnt cached
    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

  public void shouldSeeNewApplicationAfterRefresh() throws OpenShiftException, FileNotFoundException, IOException {
    // pre-condition
    IDomain domain = DomainTestUtils.ensureHasDomain(user);
    int numOfApplications = domain.getApplications().size();

    IUser otherUser = new TestConnectionBuilder().defaultCredentials().disableSSLCertificateChecks().create().getUser();
    IDomain otherDomain = otherUser.getDomain(domain.getId());
    assertNotNull(otherDomain);

    // operation
    String applicationName = "app" + StringUtils.createRandomString();
    otherDomain.createApplication(applicationName, LatestVersionOf.php().get(otherUser));
View Full Code Here

TOP

Related Classes of com.openshift.client.IUser

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.