Examples of SaxParserModule


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

                  .netmask("255.255.255.240").build().toString());
   }

   public void testNat() {
      InputStream is = getClass().getResourceAsStream("/network-nat.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      Network result = factory.create(injector.getInstance(NetworkHandler.class)).parse(is);
      assertEquals(result.toString(),
            Network.builder().type(VCloudMediaType.NETWORK_XML).name("VM Tier01").gateway("1.1.1.1").netmask("2.2.2.2")
                  .internalToExternalNATRule("3.3.3.3", "4.4.4.4").internalToExternalNATRule("3.3.3.4", "4.4.4.5")
View Full Code Here

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

                  .build().toString());
   }

   public void tesWhenNoVAppsInNetworkSetsAllZerosToGatewayAndNetmask() {
      InputStream is = getClass().getResourceAsStream("/network-unused.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      Network result = factory.create(injector.getInstance(NetworkHandler.class)).parse(is);
      assertEquals(result.toString(),
            Network.builder().type(VCloudMediaType.NETWORK_XML).name("VM Tier01").gateway("0.0.0.0").netmask("0.0.0.0")
                  .build().toString());
View Full Code Here

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

         new FirewallRule(null, null, null, null, "SERVER_TIER_FIREWALL", true, "VM Tier03" , "VM Tier03" ,
                 null, "allow", "Server Tier Firewall Rule", false, "Icmp-ping")));*/
 
   public void test() {
      InputStream is = getClass().getResourceAsStream("/firewallService.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      FirewallService result = factory.create(injector.getInstance(FirewallServiceHandler.class)).parse(is);
      assertEquals(result.isEnabled(), false);
      assertEquals(
            result.getFirewallRules(),
View Full Code Here

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

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

   public void test() {
      InputStream is = getClass().getResourceAsStream("/networkconfigsection.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      NetworkConfigSection result = factory.create(injector.getInstance(NetworkConfigSectionHandler.class)).parse(is);
      assertEquals(result.toString(), NetworkConfigSection.builder().network("VM Tier01").gateway("0.0.0.0").netmask(
               "0.0.0.0").info("MAC=00:00:00:00:00:00").fenceMode("allowInOut").dhcp(true).internalToExternalNATRule(
               "10.76.2.4", "206.24.124.1").build().toString());
View Full Code Here

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

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

   public void test() {
      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);
      assertEquals(result.toString(), NetworkConnectionSection.builder().network("VM Tier01").info(
               "Read only description of a network connection to a deployed vApp").ipAddress("10.76.0.5").build()
View Full Code Here

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

*/
@Test(groups = "unit")
public class VMHandlerTest {
   public void testVCloud1_0() {
      InputStream is = getClass().getResourceAsStream("/vm.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      VM result = factory.create(injector.getInstance(VMHandler.class)).parse(is);

      VM expected = VM
               .builder()
View Full Code Here

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

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

   public void test() {
      InputStream is = getClass().getResourceAsStream("/network.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      Network result = factory.create(injector.getInstance(NetworkHandler.class)).parse(is);
      assertEquals(
            result.toString(),
            Network.builder().type(VCloudMediaType.NETWORK_XML).name("VM-Tier01").gateway("1.1.1.1")
View Full Code Here

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

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

   public void test() {
      InputStream is = getClass().getResourceAsStream("/vdc.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(), "demo_vpdcname");
      assertEquals(result.getDescription(),
               "ServiceProfileName = Balanced; ServiceLocation = North America; Email = jim@company.com;");
View Full Code Here

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

      assertEquals(result.getAvailableNetworks(), ImmutableSet.of());
   }

   public void test1net() {
      InputStream is = getClass().getResourceAsStream("/vdc-1net.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(), "demo6");
      assertEquals(result.getDescription(),
               "ServiceProfileName = Essential; ServiceLocation = US_WEST; Email = red@chair.com;");
View Full Code Here

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

   }

   public void testFailed() {
      InputStream is = getClass().getResourceAsStream("/vdc-failed.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(), "Demo7");
      assertEquals(result.getDescription(),
               "ServiceProfileName = Essential; ServiceLocation = US_WEST; Email = red@chair.com;");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.