Package org.jclouds.http.functions.config

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


@Test(groups = "unit")
public class VAppHandlerTest {

   public void testRhelOffStatic() {
      InputStream is = getClass().getResourceAsStream("/vapp-rhel-off-static.xml");
      Injector injector = Guice.createInjector(new SaxParserModule() {

         @Override
         protected void configure() {
            super.configure();
            bind(ResourceAllocationSettingDataHandler.class).to(VCloudResourceAllocationSettingDataHandler.class);
View Full Code Here


public class SupportedVersionsHandlerTest {

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

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

      SortedMap<String, URI> result = factory.create(
               injector.getInstance(SupportedVersionsHandler.class)).parse(is);
      assertEquals(result, ImmutableSortedMap.of("0.8", URI
View Full Code Here

   private Factory factory;

   public void testVCloud1_0() {
      InputStream is = getClass().getResourceAsStream("/catalog-blank.xml");
      injector = Guice.createInjector(new SaxParserModule());
      factory = injector.getInstance(ParseSax.Factory.class);
      Catalog result = factory.create(injector.getInstance(CatalogHandler.class)).parse(is);
      assertEquals(result, new CatalogImpl("Jclouds-private", "application/vnd.vmware.vcloud.catalog+xml", URI
               .create("https://vcenterprise.bluelock.com/api/v1.0/catalog/921222081"), new ReferenceTypeImpl(null,
               "application/vnd.vmware.vcloud.org+xml", URI
View Full Code Here

               .<String, ReferenceType> of(), ImmutableList.<Task> of(), false, false));
   }

   public void testTerremark() {
      InputStream is = getClass().getResourceAsStream("/catalog.xml");
      injector = Guice.createInjector(new SaxParserModule());
      factory = injector.getInstance(ParseSax.Factory.class);
      Catalog result = factory.create(injector.getInstance(CatalogHandler.class)).parse(is);
      assertEquals(result.getName(), "Miami Environment 1");
      assert result.getDescription() == null;
View Full Code Here

*/
@Test(groups = "unit")
public class VAppToNodeMetadataTest {

   public Injector createInjectorWithLocation(final Location location) {
      return Guice.createInjector(new SaxParserModule(), new AbstractModule() {

         @Override
         protected void configure() {
            Names.bindProperties(binder(), new VCloudApiMetadata().getDefaultProperties());
            bind(new TypeLiteral<Function<ReferenceType, Location>>() {
View Full Code Here

   }

   public static VAppTemplate parseTemplate() {
      InputStream is = VAppTemplateHandlerTest.class.getResourceAsStream("/vAppTemplate.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      VAppTemplate result = factory.create(injector.getInstance(VAppTemplateHandler.class)).parse(is);
      return result;
   }
View Full Code Here

      return result;
   }

   public void testCopyingTemplate() {
      InputStream is = getClass().getResourceAsStream("/vAppTemplate-copying.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      DateService dateService = injector.getInstance(DateService.class);

      VAppTemplate result = factory.create(injector.getInstance(VAppTemplateHandler.class)).parse(is);
      assertEquals(result.getName(), "Ubuntu10.04_v2");
View Full Code Here

   }
  
   public void testVAppTemplateWithNewlinesAndNamespacedElements() {
      InputStream is = getClass().getResourceAsStream("/vAppTemplate1.0-vcd15_withNewlines.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);

      factory.create(injector.getInstance(VAppTemplateHandler.class)).parse(is);
   }
View Full Code Here

*/
@Test(groups = "unit")
public class NetworkConnectionSectionHandlerTest {
   public void testVCloud1_0() {
      InputStream is = getClass().getResourceAsStream("/networkconnectionsection.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      NetworkConnectionSection result = factory.create(injector.getInstance(NetworkConnectionSectionHandler.class))
               .parse(is);
      checkNetworkConnectionSection(result);
   }
View Full Code Here

*/
@Test(groups = "unit")
public class VDCHandlerTest {
   public void testVCloud1_0() {
      InputStream is = getClass().getResourceAsStream("/vdc-1.0.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      VDC result = factory.create(injector.getInstance(VDCHandler.class)).parse(is);
      assertEquals(result.getName(), "Jclouds-Commit-compG1xstorA01");
      assertEquals(result.getHref(), URI.create("https://vcenterprise.bluelock.com/api/v1.0/vdc/1014839439"));
      assertEquals(result.getType(), "application/vnd.vmware.vcloud.vdc+xml");
View Full Code Here

TOP

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

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.