Package org.jclouds.http.functions.config

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


   private DateService dateService;

   @BeforeTest
   @Override
   protected void setUpInjector() {
      injector = Guice.createInjector(new SaxParserModule(), new AbstractModule() {

         @Override
         protected void configure() {
            bind(new TypeLiteral<Supplier<String>>(){}).annotatedWith(Region.class).toInstance(Suppliers.ofInstance("us-east-1"));
         }
View Full Code Here


   private DateService dateService;

   @BeforeTest
   @Override
   protected void setUpInjector() {
      injector = Guice.createInjector(new SaxParserModule(), new AbstractModule() {

         @Override
         protected void configure() {
            bind(new TypeLiteral<Supplier<String>>(){}).annotatedWith(Region.class).toInstance(Suppliers.ofInstance("us-east-1"));
            bind(RunningInstance.Builder.class).to(AWSRunningInstance.Builder.class);
View Full Code Here

      parseAWSRunningInstances("/describe_instances_2.xml");
      parseAWSRunningInstances("/describe_instances_3.xml");
   }

   static ParseSax<Set<Reservation<? extends RunningInstance>>> createParser() {
      Injector injector = Guice.createInjector(new SaxParserModule(), new AbstractModule() {

         @Override
         protected void configure() {
            bind(new TypeLiteral<Supplier<String>>(){}).annotatedWith(Region.class).toInstance(Suppliers.ofInstance("us-east-1"));
            bind(RunningInstance.Builder.class).to(AWSRunningInstance.Builder.class);
View Full Code Here

   //TODO: create a parser that can!
   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testThrowIllegalArgumentAsWeDontYetSupportVirtualSystemCollections() {
      InputStream is = getClass().getResourceAsStream("/ovf-vcd1.5.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      factory.create(injector.getInstance(EnvelopeHandler.class)).parse(is).getVirtualSystem();
   }
View Full Code Here

*/
@Test(groups = "unit")
public class OperatingSystemSectionHandlerTest {
   public void test() {
      InputStream is = getClass().getResourceAsStream("/operatingsystemsection.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      OperatingSystemSection result = factory.create(injector.getInstance(OperatingSystemSectionHandler.class)).parse(
               is);
      assertEquals(result.toString(), OperatingSystemSection.builder().info("Specifies the operating system installed")
               .description("Microsoft Windows Server 2008").id(76).build().toString()
View Full Code Here

   }

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

      ParseAWSErrorFromXmlContent 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("amz");
View Full Code Here

*/
@Test(groups = "unit")
public class DiskSectionHandlerTest {
   public void test() {
      InputStream is = getClass().getResourceAsStream("/disksection.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      DiskSection result = factory.create(injector.getInstance(DiskSectionHandler.class)).parse(is);
      assertEquals(result.toString(), DiskSection.builder().info("Describes the set of virtual disks").disk(
               Disk.builder().id("vmdisk1")

View Full Code Here

   }

   public void testVCloud1_0() {
      InputStream is = getClass().getResourceAsStream("/virtualsystem.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      VirtualSystem result = factory.create(injector.getInstance(VirtualSystemHandler.class)).parse(is);
      checkVirtualSystem(result);
   }
View Full Code Here

*/
@Test(groups = "unit")
public class NetworkSectionHandlerTest {
   public void test() {
      InputStream is = getClass().getResourceAsStream("/networksection.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      NetworkSection result = factory.create(injector.getInstance(NetworkSectionHandler.class)).parse(is);
      assertEquals(result.toString(), NetworkSection.builder().info("List of logical networks used in the package")
               .network(
                        Network.builder().name("red").description("The network the Red service is available on")
View Full Code Here

*/
@Test(groups = "unit")
public class ProductSectionHandlerTest {
   public void test() {
      InputStream is = getClass().getResourceAsStream("/productsection.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      ProductSection result = factory.create(injector.getInstance(ProductSectionHandler.class)).parse(is);
      assertEquals(result.toString(), ProductSection.builder().info("vCenter Information").property(
               Property.builder().value("false").key("vmwareToolsEnabled").label("VMWare Tools Enabled status")
                        .description("VMWare Tools Enabled status").build()).property(
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.