Package org.jclouds.http.functions.config

Examples of org.jclouds.http.functions.config.SaxParserModule


   }

   private void assertCodeMakes(String method, URI uri, int statusCode, String message, String contentType,
         String content, Class<? extends Exception> expected) {

      ParseAzureStorageErrorFromXmlContent function = Guice.createInjector(new SaxParserModule(), new AbstractModule() {

         @Override
         protected void configure() {
            bind(SharedKeyLiteAuthentication.class).toInstance(createMock(SharedKeyLiteAuthentication.class));
         }
View Full Code Here


   @SuppressWarnings("unchecked")
   protected Function<HttpResponse, T> parser(Injector i) {
      try {
         return (Function<HttpResponse, T>) i
               .createChildInjector(new SaxParserModule())
               .getInstance(TransformerForRequest.class)
               .getTransformerForMethod(Invocation.create(method(getClass(), "expected"), ImmutableList.of()), i);
      } catch (Exception e) {
         throw Throwables.propagate(e);
      }
View Full Code Here

   }

   protected void assertCodeMakes(String method, URI uri, int statusCode, String message, String contentType,
            String content, Class<? extends Exception> expected) {

      HttpErrorHandler function = Guice.createInjector(new SaxParserModule()).getInstance(getHandlerClass());

      HttpCommand command = createMock(HttpCommand.class);
      HttpRequest request = HttpRequest.builder().method(method).endpoint(uri).build();
      HttpResponse response = HttpResponse.builder().statusCode(statusCode).message(message).payload(content).build();
      if (contentType != null)
View Full Code Here

   protected GeneratedHttpRequest request;
   private Invocation toString;

   @BeforeTest
   protected void setUpInjector() {
      injector = Guice.createInjector(new SaxParserModule());
      factory = injector.getInstance(ParseSax.Factory.class);
      assert factory != null;
   }
View Full Code Here

   }

   private void assertCodeMakes(String method, URI uri, int statusCode, String message, final boolean virtualHost,
            String content, Class<? extends Exception> expected) {

      ParseS3ErrorFromXmlContent function = Guice.createInjector(new SaxParserModule(), new AbstractModule() {

         @Override
         protected void configure() {
            bind(RequestSigner.class).toInstance(createMock(RequestSigner.class));
            bindConstant().annotatedWith(Names.named(PROPERTY_HEADER_TAG)).to(S3Headers.DEFAULT_AMAZON_HEADERTAG);
View Full Code Here

public class OrgHandlerTest {

   public void testApplyInputStream() {
      InputStream is = getClass().getResourceAsStream("/org-1.0.xml");

      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);

      Org result = factory.create(injector.getInstance(OrgHandler.class)).parse(is);
      assertEquals(result.getName(), "ExampleOrg");
      assertEquals(result.getFullName(), "ExampleOrg");
View Full Code Here

   }

   public void testTerremark() {
      InputStream is = getClass().getResourceAsStream("/org.xml");

      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);

      Org result = factory.create(injector.getInstance(OrgHandler.class)).parse(is);
      assertEquals(result.getName(), "adrian@jclouds.org");
      assertEquals(result.getFullName(), "adrian@jclouds.org");
View Full Code Here

               .create("https://services.vcloudexpress.terremark.com/api/v0.8/tasksList/32")));
   }

   public void testHosting() {
      InputStream is = getClass().getResourceAsStream("/org-hosting.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      Org result = factory.create(injector.getInstance(OrgHandler.class)).parse(is);
      assertEquals(result.getName(), "Customer 188849");
      assertEquals(result.getFullName(), "Customer 188849");
      assertEquals(result.getHref(), URI.create("https://vcloud.safesecureweb.com/api/v0.8/org/188849"));
View Full Code Here

               .create("https://vcloud.safesecureweb.com/api/v0.8/tasksList/188849")));
   }

   public void testSavvis() {
      InputStream is = getClass().getResourceAsStream("/org-savvis.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      Org result = factory.create(injector.getInstance(OrgHandler.class)).parse(is);
      assertEquals(result, new OrgImpl("607968.0", null, null, "607968.0", "Gravitant Inc", ImmutableMap
               .<String, ReferenceType> of(), ImmutableMap.<String, ReferenceType> of("GravDataCenter1(Saved)",
               new ReferenceTypeImpl("GravDataCenter1(Saved)", "application/vnd.vmware.vcloud.vdc+xml", URI
View Full Code Here

@Test(groups = "unit", testName = "VCloudVirtualHardwareSectionHandlerTest")
public class VCloudVirtualHardwareSectionHandlerTest extends BaseHandlerTest {
   @BeforeTest
   @Override
   protected void setUpInjector() {
      injector = Guice.createInjector(new SaxParserModule() {
         public void configure() {
            super.configure();
            bind(ResourceAllocationSettingDataHandler.class).to(VCloudResourceAllocationSettingDataHandler.class);
         }
      });
View Full Code Here

TOP

Related Classes of org.jclouds.http.functions.config.SaxParserModule

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.