Package org.jclouds.openstack.keystone.v2_0.extensions

Examples of org.jclouds.openstack.keystone.v2_0.extensions.ServiceAdminApiLiveTest


      assertFalse(result.isEmpty());

      for (Tenant tenant : result) {
         assertNotNull(tenant.getId());

         Tenant aTenant = tenantApi.get(tenant.getId());
         assertNotNull(aTenant, "get returned null for tenant: " + tenant);

         assertEquals(aTenant, tenant);
      }
   }
View Full Code Here


   public void testTenantsByName() {

      TenantApi tenantApi = api.getTenantApi().get();

      for (Tenant tenant : tenantApi.list().concat()) {
         Tenant aTenant = tenantApi.getByName(tenant.getName());
         assertNotNull(aTenant, "get returned null for tenant: " + tenant);

         assertEquals(aTenant, tenant);
      }
View Full Code Here

    */
   public static void main(String[] args) throws IOException {
      CreateTenantAndUser createTenantAndUser = new CreateTenantAndUser(args[0], args[1], args[2], args[3]);

      try {
         Tenant tenant = createTenantAndUser.createTenant();
         createTenantAndUser.createUser(tenant);
      } catch (Exception e) {
         e.printStackTrace();
      } finally {
         createTenantAndUser.close();
View Full Code Here

         System.out.format("    TenantAdminApi is present%n");

         TenantAdminApi tenantAdminApi = tenantAdminApiExtension.get();
         CreateTenantOptions tenantOptions = CreateTenantOptions.Builder
               .description("My New Tenant");
         Tenant tenant = tenantAdminApi.create("newTenant", tenantOptions);

         System.out.format("    %s%n", tenant);

         return tenant;
      } else {
View Full Code Here

      TokenApi api = requestsSendResponses(
            keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint + "/v2.0/tokens/sometokenorother").build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/token_details.json", APPLICATION_JSON)).build())
            .getTokenApi().get();
      Token token = api.get("sometokenorother");
      assertNotNull(token);
      assertEquals(token,
            Token.builder().id("167eccdc790946969ced473732e8109b").expires(dateService.iso8601SecondsDateParse("2012-04-28T12:42:50Z"))
                  .tenant(Tenant.builder().id("4cea93f5464b4f1c921fb3e0461d72b5").name("demo").build()).build());
   }
View Full Code Here

      TokenApi api = requestsSendResponses(
            keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint + "/v2.0/tokens/sometokenorother").build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/token_details.json", APPLICATION_JSON)).build())
            .getTokenApi().get();
      Token token = api.get("sometokenorother");
      assertNotNull(token);
      assertEquals(token,
            Token.builder().id("167eccdc790946969ced473732e8109b").expires(dateService.iso8601SecondsDateParse("2012-04-28T12:42:50Z"))
                  .tenant(Tenant.builder().id("4cea93f5464b4f1c921fb3e0461d72b5").name("demo").build()).build());
   }
View Full Code Here

   public void testToken() {

      TokenApi tokenApi = api.getTokenApi().get();
      assertTrue(tokenApi.isValid(token));
      Token result = tokenApi.get(token);
      assertNotNull(result);
      assertEquals(result.getId(), token);
      assertNotNull(result.getTenant());

      User user = tokenApi.getUserOfToken(token);
      assertNotNull(user);
      assertNotNull(user.getId());
      assertNotNull(user.getName());
View Full Code Here

      TokenApi api = requestsSendResponses(
            keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint + "/v2.0/tokens/sometokenorother").build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/token_details.json", APPLICATION_JSON)).build())
            .getTokenApi().get();
      Token token = api.get("sometokenorother");
      assertNotNull(token);
      assertEquals(token,
            Token.builder().id("167eccdc790946969ced473732e8109b").expires(dateService.iso8601SecondsDateParse("2012-04-28T12:42:50Z"))
                  .tenant(Tenant.builder().id("4cea93f5464b4f1c921fb3e0461d72b5").name("demo").build()).build());
   }
View Full Code Here

   public void testToken() {

      TokenApi tokenApi = api.getTokenApi().get();
      assertTrue(tokenApi.isValid(token));
      Token result = tokenApi.get(token);
      assertNotNull(result);
      assertEquals(result.getId(), token);
      assertNotNull(result.getTenant());

      User user = tokenApi.getUserOfToken(token);
      assertNotNull(user);
      assertNotNull(user.getId());
      assertNotNull(user.getName());
View Full Code Here

      TokenApi api = requestsSendResponses(
            keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint + "/v2.0/tokens/sometokenorother").build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/token_details.json", APPLICATION_JSON)).build())
            .getTokenApi().get();
      User user = api.getUserOfToken("sometokenorother");
      assertNotNull(user);
      assertEquals(user, User.builder().id("2b9b606181634ae9ac86fd95a8bc2cde").name("admin")
            .roles(ImmutableSet.of(Role.builder().id("79cada5c02814b57a52e0eed4dd388cb").name("admin").build()))
            .build());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.keystone.v2_0.extensions.ServiceAdminApiLiveTest

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.