Package org.jclouds.chef.domain

Examples of org.jclouds.chef.domain.Resource


   }

   @Test
   public void testWithValidResource() {
      Function<Object, URI> function = new UriForResource();
      Resource res = Resource.builder().name("test").url(URI.create("http://foo/bar")).build();
      URI result = function.apply(res);
      assertEquals(res.getUrl().toString(), result.toString());
   }
View Full Code Here


   }

   public void testGetResourceContents() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(ChefApi.class, "getResourceContents", Resource.class);
      GeneratedHttpRequest httpRequest = processor.apply(Invocation.create(method,
            ImmutableList.<Object> of(new Resource("test", URI.create("http://foo/bar"), new byte[] {}, null, null))));

      assertRequestLineEquals(httpRequest, "GET http://foo/bar HTTP/1.1");
      assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\nX-Chef-Version: " + ChefApi.VERSION
            + "-test\n");
      assertPayloadEquals(httpRequest, null, null, false);
View Full Code Here

         api.commitSandbox(site.getSandboxId(), false);
      }

      // create a new cookbook
      CookbookVersion cookbook = new CookbookVersion(PREFIX, "0.0.0");
      cookbook.getRootFiles().add(new Resource(content));

      // upload the cookbook to the remote server
      api.updateCookbook(PREFIX, "0.0.0", cookbook);
   }
View Full Code Here

                  ImmutableSet.<Resource> of(),
                  ImmutableSet.<Resource> of(),
                  "0.0.0",
                  ImmutableSet.<Resource> of(),
                  ImmutableSet.<Resource> of(
                        new Resource(
                              "README",
                              URI.create("https://s3.amazonaws.com/opscode-platform-production-data/organization-486ca3ac66264fea926aa0b4ff74341c/checksum-11637f98942eafbf49c71b7f2f048b78?AWSAccessKeyId=AKIAJOZTD2N26S7W6APA&Expires=1277766181&Signature=zgpNl6wSxjTNovqZu2nJq0JztU8%3D"),
                              base16().lowerCase().decode("11637f98942eafbf49c71b7f2f048b78"), "README", "default"),
                        new Resource(
                              "Rakefile",
                              URI.create("https://s3.amazonaws.com/opscode-platform-production-data/organization-486ca3ac66264fea926aa0b4ff74341c/checksum-ebcf925a1651b4e04b9cd8aac2bc54eb?AWSAccessKeyId=AKIAJOZTD2N26S7W6APA&Expires=1277766181&Signature=EFzzDSKKytTl7b%2FxrCeNLh05zj4%3D"),
                              base16().lowerCase().decode("ebcf925a1651b4e04b9cd8aac2bc54eb"), "Rakefile", "default"))));

   }
View Full Code Here

   }

   @Test
   public void testWithValidResource() {
      Function<Object, URI> function = new UriForResource();
      Resource res = new Resource("test", URI.create("http://foo/bar"), null, null, null);
      URI result = function.apply(res);
      assertEquals(res.getUrl().toString(), result.toString());
   }
View Full Code Here

   }

   @Test
   public void testWithValidResource() {
      Function<Object, URI> function = new UriForResource();
      Resource res = Resource.builder().name("test").url(URI.create("http://foo/bar")).build();
      URI result = function.apply(res);
      assertEquals(res.getUrl().toString(), result.toString());
   }
View Full Code Here

TOP

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

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.