Package org.jclouds.domain

Examples of org.jclouds.domain.JsonBall


   @Test
   public void testOne() {
      assertEquals(
            json.toJson(converter.apply(ImmutableMultimap.<String, Supplier<JsonBall>> of("java",
                  Suppliers.ofInstance(new JsonBall("{\"time\":\"time\"}")), "java/system",
                  Suppliers.ofInstance(new JsonBall("system"))))),
            "{\"java\":{\"system\":\"system\",\"time\":\"time\"}}");
   }
View Full Code Here


   @Test
   public void testOneDuplicate() {
      assertEquals(
            json.toJson(converter.apply(ImmutableMultimap.<String, Supplier<JsonBall>> of("java",
                  Suppliers.ofInstance(new JsonBall("{\"time\":\"time\"}")), "java",
                  Suppliers.ofInstance(new JsonBall("{\"system\":\"system\"}"))))),
            "{\"java\":{\"system\":\"system\",\"time\":\"time\"}}");
   }
View Full Code Here

   @Test
   public void testMerge() {
      assertEquals(
            json.toJson(converter.apply(ImmutableMultimap.<String, Supplier<JsonBall>> of("java",
                  Suppliers.ofInstance(new JsonBall("{\"time\":{\"1\":\"hello\"}}")), "java/time",
                  Suppliers.ofInstance(new JsonBall("{\"2\":\"goodbye\"}"))))),
            "{\"java\":{\"time\":{\"2\":\"goodbye\",\"1\":\"hello\"}}}");
   }
View Full Code Here

   @Test
   public void testMergeNestedTwice() {
      assertEquals(
            json.toJson(converter.apply(ImmutableMultimap.<String, Supplier<JsonBall>> of("java",
                  Suppliers.ofInstance(new JsonBall("{\"time\":{\"1\":\"hello\"}}")), "java",
                  Suppliers.ofInstance(new JsonBall("{\"time\":{\"2\":\"goodbye\"}}"))))),
            "{\"java\":{\"time\":{\"2\":\"goodbye\",\"1\":\"hello\"}}}");
   }
View Full Code Here

   @Test
   public void testReplaceList() {
      assertEquals(
            json.toJson(converter.apply(ImmutableMultimap.<String, Supplier<JsonBall>> of("java",
                  Suppliers.ofInstance(new JsonBall("{\"time\":{\"1\":[\"hello\"]}}")), "java/time",
                  Suppliers.ofInstance(new JsonBall("{\"1\":[\"goodbye\"]}"))))),
            "{\"java\":{\"time\":{\"1\":[\"goodbye\"]}}}");
   }
View Full Code Here

         this.systemProperties = systemProperties;
      }

      @Override
      public JsonBall get() {
         return new JsonBall(json.toJson(systemProperties));
      }
View Full Code Here

         }

      }), and(notNull(), new Predicate<Node>() {
         @Override
         public boolean apply(Node input) {
            JsonBall dateLong = input.getAutomatic().get("ohai_time");
            if (dateLong == null)
               return true;
            Calendar nodeUpdate = Calendar.getInstance();
            nodeUpdate.setTime(fromOhaiTime(dateLong));
            return expired.after(nodeUpdate);
View Full Code Here

      }));
   }

   public void test() {

      Node node = new Node("adrian-jcloudstest", ImmutableMap.<String, JsonBall> of("tomcat6", new JsonBall(
            "{\"ssl_port\":8433}")), ImmutableMap.<String, JsonBall> of(), ImmutableMap.<String, JsonBall> of(),
            ImmutableMap.<String, JsonBall> of(), Collections.singleton("recipe[java]"), "prod");

      assertEquals(
            handler.apply(HttpResponse.builder().statusCode(200).message("ok")
View Full Code Here

         @Override
         protected void configure() {
            MapBinder<String, Supplier<JsonBall>> mapbinder = ohaiAutomaticAttributeBinder(binder());
            mapbinder.addBinding("test").toProvider(
                  Providers.of(Suppliers.ofInstance(new JsonBall("{\"prop1\":\"test1\"}"))));
         }

      }, new AbstractModule() {

         @Override
         protected void configure() {
            MapBinder<String, Supplier<JsonBall>> mapbinder = ohaiAutomaticAttributeBinder(binder());
            mapbinder.addBinding("test").toProvider(
                  Providers.of(Suppliers.ofInstance(new JsonBall("{\"prop2\":\"test2\"}"))));
         }

      });
      Ohai ohai = injector.getInstance(Ohai.class);
      Json json = injector.getInstance(Json.class);
View Full Code Here

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

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

TOP

Related Classes of org.jclouds.domain.JsonBall

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.