Package org.jclouds.chef.domain

Examples of org.jclouds.chef.domain.Node


      handler = injector.getInstance(Key.get(new TypeLiteral<ParseJson<Node>>() {
      }));
   }

   public void test() {
      Node node = Node.builder() //
            .name("adrian-jcloudstest") //
            .normalAttribute("tomcat6", new JsonBall("{\"ssl_port\":8433}")) //
            .runListElement("recipe[java]") //
            .environment("prod") //
            .build();
View Full Code Here


      ChefApi chef = createMock(ChefApi.class);

      Map<String, JsonBall> automatic = ImmutableMap.<String, JsonBall> of();
      Supplier<Map<String, JsonBall>> automaticSupplier = Suppliers.<Map<String, JsonBall>> ofInstance(automatic);

      Node node = Node.builder().name("name").environment("_default").build();
      Node nodeWithAutomatic = Node.builder().name("name").environment("_default").automaticAttributes(automatic)
            .build();

      expect(chef.getNode("name")).andReturn(node);
      expect(chef.updateNode(nodeWithAutomatic)).andReturn(null);
View Full Code Here

   public void testExecute() {
      Set<String> runList = ImmutableSet.of("role[" + prefix + "]");
      try {
         api.createNode(Node.builder().name(prefix).runList(runList).environment("_default").build());
         strategy.execute(prefix);
         Node node = api.getNode(prefix);
         assertEquals(node.getName(), prefix);
         assertEquals(node.getRunList(), runList);
         assertEquals(node.getAutomaticAttributes().get("current_user").toString(), currentUserProvider.get().toString());
      } finally {
         api.deleteNode(prefix);
      }
   }
View Full Code Here

   public void testWithNoRunlist() {
      ChefApi chef = createMock(ChefApi.class);

      Supplier<Map<String, JsonBall>> automaticSupplier = Suppliers.<Map<String, JsonBall>> ofInstance(ImmutableMap.<String, JsonBall> of());

      Node nodeWithAutomatic = Node.builder().name("name").environment("_default")
            .automaticAttributes(automaticSupplier.get()).build();

      chef.createNode(nodeWithAutomatic);

      replay(chef);
View Full Code Here

   @Test
   public void testExecute() {
      Set<String> runList = ImmutableSet.of("role[" + prefix + "]");
      try {
         strategy.execute(prefix, runList);
         Node node = api.getNode(prefix);
         assertEquals(node.getName(), prefix);
         assertEquals(node.getRunList(), runList);
         assertEquals(node.getAutomaticAttributes().get("current_user").toString(), currentUserProvider.get().toString());
      } finally {
         api.deleteNode(prefix);
      }
   }
View Full Code Here

TOP

Related Classes of org.jclouds.chef.domain.Node

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.