Examples of JsonBall


Examples of org.jclouds.domain.JsonBall

            mergeAsPeer(key, toInsert, insertionContext);
         }
      } else {
         putUnderContext(keyParts, toInsert, insertionContext);
      }
      destination.put(rootKey, new JsonBall(json.toJson(insertionContext, mapLiteral)));
   }
View Full Code Here

Examples of org.jclouds.domain.JsonBall

      assertEquals(config, "{\"run_list\":[\"recipe[apache2]\",\"role[webserver]\"]}");
   }

   public void testBuildBootstrapConfigurationWithRunlistAndEmptyAttributes() {
      List<String> runlist = new RunListBuilder().addRecipe("apache2").addRole("webserver").build();
      BootstrapConfig bootstrapConfig = BootstrapConfig.builder().runList(runlist).attributes(new JsonBall("{}"))
            .build();
      String config = chefService.buildBootstrapConfiguration(bootstrapConfig);
      assertEquals(config, "{\"run_list\":[\"recipe[apache2]\",\"role[webserver]\"]}");
   }
View Full Code Here

Examples of org.jclouds.domain.JsonBall

   }

   public void testBuildBootstrapConfigurationWithRunlistAndAttributes() {
      List<String> runlist = new RunListBuilder().addRecipe("apache2").addRole("webserver").build();
      BootstrapConfig bootstrapConfig = BootstrapConfig.builder().runList(runlist)
            .attributes(new JsonBall("{\"tomcat6\":{\"ssl_port\":8433}}")).build();
      String config = chefService.buildBootstrapConfiguration(bootstrapConfig);
      assertEquals(config, "{\"tomcat6\":{\"ssl_port\":8433},\"run_list\":[\"recipe[apache2]\",\"role[webserver]\"]}");
   }
View Full Code Here

Examples of org.jclouds.domain.JsonBall

   }

   public void testBuildBootstrapConfigurationWithRunlistAndAttributesAndEnvironment() {
      List<String> runlist = new RunListBuilder().addRecipe("apache2").addRole("webserver").build();
      BootstrapConfig bootstrapConfig = BootstrapConfig.builder().runList(runlist)
            .attributes(new JsonBall("{\"tomcat6\":{\"ssl_port\":8433}}")).environment("env").build();
      String config = chefService.buildBootstrapConfiguration(bootstrapConfig);
      assertEquals(config,
            "{\"tomcat6\":{\"ssl_port\":8433},\"environment\":\"env\",\"run_list\":[\"recipe[apache2]\",\"role[webserver]\"]}");
   }
View Full Code Here

Examples of org.jclouds.domain.JsonBall

   @Override
   public List<String> apply(String from) {
      DatabagItem bootstrapConfig = bootstrapConfigForGroup.apply(from);
      Map<String, JsonBall> config = json.fromJson(bootstrapConfig.toString(),
            BootstrapConfigForGroup.BOOTSTRAP_CONFIG_TYPE);
      JsonBall runlist = config.get("run_list");
      return json.fromJson(runlist.toString(), RUN_LIST_TYPE);
   }
View Full Code Here

Examples of org.jclouds.domain.JsonBall

   @ConfiguresOhai
   static class TestOhaiModule extends OhaiModule {

      @Override
      protected Supplier<Map<String, JsonBall>> provideAutomatic(AutomaticSupplier in) {
         return Suppliers.<Map<String, JsonBall>> ofInstance(ImmutableMap.of("foo", new JsonBall("bar")));
      }
View Full Code Here

Examples of org.jclouds.domain.JsonBall

   public Statement apply(String group) {
      checkNotNull(group, "group");
      String validatorClientName = validatorName.get();
      PrivateKey validatorKey = validatorCredential.get();

      JsonBall bootstrapConfig = null;
      try {
         bootstrapConfig = bootstrapConfigForGroup.load(group);
      } catch (Exception e) {
         throw propagate(e);
      }

      Map<String, JsonBall> config = json.fromJson(bootstrapConfig.toString(),
            BootstrapConfigForGroup.BOOTSTRAP_CONFIG_TYPE);
      Optional<JsonBall> environment = Optional.fromNullable(config.get("environment"));

      String chefConfigDir = "{root}etc{fs}chef";
      Statement createChefConfigDir = exec("{md} " + chefConfigDir);
View Full Code Here

Examples of org.jclouds.domain.JsonBall

   public void testToOhaiTime() {
      assertEquals(ChefUtils.toOhaiTime(millis).toString(), millisString);
   }

   public void testFromOhaiTime() {
      assertEquals(ChefUtils.fromOhaiTime(new JsonBall(millisString)), now);

   }
View Full Code Here

Examples of org.jclouds.domain.JsonBall

   }

   public void testOneRecipe() throws IOException {
      Optional<PrivateKey> validatorCredential = Optional.of(createMock(PrivateKey.class));
      GroupToBootScript fn = new GroupToBootScript(Suppliers.ofInstance(URI.create("http://localhost:4000")), json,
            CacheLoader.from(Functions.forMap(ImmutableMap.<String, JsonBall> of("foo", new JsonBall(
                  "{\"tomcat6\":{\"ssl_port\":8433},\"run_list\":[\"recipe[apache2]\",\"role[webserver]\"]}")))),
            installChefGems, validatorName, validatorCredential);

      PrivateKey validatorKey = validatorCredential.get();
      expect(validatorKey.getEncoded()).andReturn(PemsTest.PRIVATE_KEY.getBytes());
View Full Code Here

Examples of org.jclouds.domain.JsonBall

   }

   public void testOneRecipeAndEnvironment() throws IOException {
      Optional<PrivateKey> validatorCredential = Optional.of(createMock(PrivateKey.class));
      GroupToBootScript fn = new GroupToBootScript(Suppliers.ofInstance(URI.create("http://localhost:4000")), json,
            CacheLoader.from(Functions.forMap(ImmutableMap.<String, JsonBall> of("foo", new JsonBall(
                  "{\"tomcat6\":{\"ssl_port\":8433},\"environment\":\"env\","
                        + "\"run_list\":[\"recipe[apache2]\",\"role[webserver]\"]}")))), installChefGems,
            validatorName, validatorCredential);

      PrivateKey validatorKey = validatorCredential.get();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.