public void testHostingDotCom() {
InputStream is = getClass().getResourceAsStream("/vdc-hosting.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(), "vDC Name");
assertEquals(result.getHref(), URI.create("https://vcloud.safesecureweb.com/api/v0.8/vdc/188849"));
assertEquals(result.getDescription(), "vDC Name");
assertEquals(result.getStorageCapacity(), new Capacity("bytes * 10^9", 0, 0, 40960, 0));
assertEquals(result.getCpuCapacity(), new Capacity("hz * 10^6", 0, 0, 2400, 0));
assertEquals(result.getMemoryCapacity(), new Capacity("bytes * 10^9", 0, 0, 2, 0));
assertEquals(result.getVmQuota(), 0);
assertEquals(result.getResourceEntities(), new ImmutableMap.Builder<String, ReferenceType>().put(
"Plesk (Linux) 64-bit Template",
new ReferenceTypeImpl("Plesk (Linux) 64-bit Template", "application/vnd.vmware.vcloud.vAppTemplate+xml",
URI.create("https://vcloud.safesecureweb.com/api/v0.8/vAppTemplate/1"))).put(
"Windows 2008 Datacenter 64 Bit Template",
new ReferenceTypeImpl("Windows 2008 Datacenter 64 Bit Template",
"application/vnd.vmware.vcloud.vAppTemplate+xml", URI
.create("https://vcloud.safesecureweb.com/api/v0.8/vAppTemplate/2"))).put(
"Cent OS 64 Bit Template",
new ReferenceTypeImpl("Cent OS 64 Bit Template", "application/vnd.vmware.vcloud.vAppTemplate+xml", URI
.create("https://vcloud.safesecureweb.com/api/v0.8/vAppTemplate/3"))).put(
"cPanel (Linux) 64 Bit Template",
new ReferenceTypeImpl("cPanel (Linux) 64 Bit Template",
"application/vnd.vmware.vcloud.vAppTemplate+xml", URI
.create("https://vcloud.safesecureweb.com/api/v0.8/vAppTemplate/4"))).put(
"188849-1",
new ReferenceTypeImpl("188849-1", "application/vnd.vmware.vcloud.vApp+xml", URI
.create("https://vcloud.safesecureweb.com/api/v0.8/vApp/188849-1"))).put(
"188849-2",
new ReferenceTypeImpl("188849-2", "application/vnd.vmware.vcloud.vApp+xml", URI
.create("https://vcloud.safesecureweb.com/api/v0.8/vApp/188849-2"))).build());
assertEquals(result.getAvailableNetworks(), ImmutableMap.<String, ReferenceType> of());
}