2727import org .xml .sax .SAXException ;
2828import org .xml .sax .SAXParseException ;
2929
30- import javax .xml .parsers .ParserConfigurationException ;
3130import java .io .IOException ;
3231import java .util .List ;
3332
3433public class OVFHelperTest {
3534
3635 private String ovfFileProductSection =
37- "<ProductSection>" +
36+ "<ProductSection xmlns= \" http://schemas.dmtf.org/ovf/envelope/1 \" xmlns:cim= \" http://schemas.dmtf.org/wbem/wscim/1/common \" xmlns:ovf= \" http://schemas.dmtf.org/ovf/envelope/1 \" xmlns:rasd= \" http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData \" xmlns:vmw= \" http://www.vmware.com/schema/ovf \" xmlns:vssd= \" http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData \" xmlns:xsi= \" http://www.w3.org/2001/XMLSchema-instance \" >" +
3837 "<Info>VM Arguments</Info>" +
3938 "<Property ovf:key=\" va-ssh-public-key\" ovf:type=\" string\" ovf:userConfigurable=\" true\" ovf:value=\" \" >" +
4039 "<Label>Set the SSH public key allowed to access the appliance</Label>" +
@@ -47,7 +46,7 @@ public class OVFHelperTest {
4746 "</ProductSection>" ;
4847
4948 private String ovfFileDeploymentOptionsSection =
50- "<DeploymentOptionSection>\n " +
49+ "<DeploymentOptionSection xmlns= \" http://schemas.dmtf.org/ovf/envelope/1 \" xmlns:cim= \" http://schemas.dmtf.org/wbem/wscim/1/common \" xmlns:ovf= \" http://schemas.dmtf.org/ovf/envelope/1 \" xmlns:rasd= \" http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData \" xmlns:vmw= \" http://www.vmware.com/schema/ovf \" xmlns:vssd= \" http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData \" xmlns:xsi= \" http://www.w3.org/2001/XMLSchema-instance \" >\n " +
5150 " <Info>Deployment Configuration information</Info>\n " +
5251 " <Configuration ovf:id=\" ASAv5\" >\n " +
5352 " <Label>100 Mbps (ASAv5)</Label>\n " +
@@ -61,10 +60,10 @@ public class OVFHelperTest {
6160 " <Label>2 Gbps (ASAv30)</Label>\n " +
6261 " <Description>Use this option to deploy an ASAv with a maximum throughput of 2 Gbps (uses 4 vCPUs and 8 GB of memory).</Description>\n " +
6362 " </Configuration>\n " +
64- " </DeploymentOptionSection>" ;
63+ " </DeploymentOptionSection>" ;
6564
6665 private String ovfFileVirtualHardwareSection =
67- "<VirtualSystem>\n " +
66+ "<VirtualSystem xmlns= \" http://schemas.dmtf.org/ovf/envelope/1 \" xmlns:cim= \" http://schemas.dmtf.org/wbem/wscim/1/common \" xmlns:ovf= \" http://schemas.dmtf.org/ovf/envelope/1 \" xmlns:rasd= \" http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData \" xmlns:vmw= \" http://www.vmware.com/schema/ovf \" xmlns:vssd= \" http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData \" xmlns:xsi= \" http://www.w3.org/2001/XMLSchema-instance \" >\n " +
6867 "<OperatingSystemSection ovf:id=\" 100\" vmw:osType=\" other26xLinux64Guest\" >\n " +
6968 " <Info>The kind of installed guest operating system</Info>\n " +
7069 " <Description>Other 2.6x Linux (64-bit)</Description>\n " +
@@ -270,7 +269,7 @@ public class OVFHelperTest {
270269 "</VirtualSystem>" ;
271270
272271 private String eulaSections =
273- "<VirtualSystem>\n " +
272+ "<VirtualSystem xmlns= \" http://schemas.dmtf.org/ovf/envelope/1 \" xmlns:cim= \" http://schemas.dmtf.org/wbem/wscim/1/common \" xmlns:ovf= \" http://schemas.dmtf.org/ovf/envelope/1 \" xmlns:rasd= \" http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData \" xmlns:vmw= \" http://www.vmware.com/schema/ovf \" xmlns:vssd= \" http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData \" xmlns:xsi= \" http://www.w3.org/2001/XMLSchema-instance \" >\n " +
274273 "<EulaSection>\n " +
275274 " <Info>end-user license agreement</Info>\n " +
276275 " <License>END USER LICENSE AGREEMENT\n " +
@@ -395,7 +394,7 @@ public class OVFHelperTest {
395394 "</VirtualSystem>" ;
396395
397396 private String productSectionWithCategories =
398- "<VirtualSystem ovf:id=\" VMware-vCenter-Server-Appliance\" >\n " +
397+ "<VirtualSystem ovf:id=\" VMware-vCenter-Server-Appliance\" xmlns= \" http://schemas.dmtf.org/ovf/envelope/1 \" xmlns:cim= \" http://schemas.dmtf.org/wbem/wscim/1/common \" xmlns:ovf= \" http://schemas.dmtf.org/ovf/envelope/1 \" xmlns:rasd= \" http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData \" xmlns:vmw= \" http://www.vmware.com/schema/ovf \" xmlns:vssd= \" http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData \" xmlns:xsi= \" http://www.w3.org/2001/XMLSchema-instance \" >\n " +
399398 "<ProductSection ovf:required=\" false\" >\n " +
400399 " <Info>Appliance ISV branding information</Info>\n " +
401400 " <Product>VMware vCenter Server Appliance</Product>\n " +
@@ -704,49 +703,49 @@ public class OVFHelperTest {
704703 private OVFHelper ovfHelper = new OVFHelper ();
705704
706705 @ Test
707- public void testGetOVFPropertiesValidOVF () throws IOException , SAXException , ParserConfigurationException {
706+ public void testGetOVFPropertiesValidOVF () throws IOException , SAXException {
708707 List <OVFPropertyTO > props = ovfHelper .getOVFPropertiesFromXmlString (ovfFileProductSection );
709708 Assert .assertEquals (2 , props .size ());
710709 }
711710
712711 @ Test (expected = SAXParseException .class )
713- public void testGetOVFPropertiesInvalidOVF () throws IOException , SAXException , ParserConfigurationException {
712+ public void testGetOVFPropertiesInvalidOVF () throws IOException , SAXException {
714713 ovfHelper .getOVFPropertiesFromXmlString (ovfFileProductSection + "xxxxxxxxxxxxxxxxx" );
715714 }
716715
717716 @ Test
718- public void testGetOVFDeploymentOptionsValidOVF () throws IOException , SAXException , ParserConfigurationException {
717+ public void testGetOVFDeploymentOptionsValidOVF () throws IOException , SAXException {
719718 List <OVFConfigurationTO > options = ovfHelper .getOVFDeploymentOptionsFromXmlString (ovfFileDeploymentOptionsSection );
720719 Assert .assertEquals (3 , options .size ());
721720 }
722721
723722 @ Test
724- public void testGetOVFVirtualHardwareSectionValidOVF () throws IOException , SAXException , ParserConfigurationException {
723+ public void testGetOVFVirtualHardwareSectionValidOVF () throws IOException , SAXException {
725724 List <OVFVirtualHardwareItemTO > items = ovfHelper .getOVFVirtualHardwareSectionFromXmlString (ovfFileVirtualHardwareSection );
726725 Assert .assertEquals (20 , items .size ());
727726 }
728727
729728 @ Test
730- public void testGetOVFEulaSectionValidOVF () throws IOException , SAXException , ParserConfigurationException {
729+ public void testGetOVFEulaSectionValidOVF () throws IOException , SAXException {
731730 List <OVFEulaSectionTO > eulas = ovfHelper .getOVFEulaSectionFromXmlString (eulaSections );
732731 Assert .assertEquals (2 , eulas .size ());
733732 }
734733
735734 @ Test
736- public void testGetOVFPropertiesWithCategories () throws IOException , SAXException , ParserConfigurationException {
735+ public void testGetOVFPropertiesWithCategories () throws IOException , SAXException {
737736 List <OVFPropertyTO > props = ovfHelper .getOVFPropertiesFromXmlString (productSectionWithCategories );
738737 Assert .assertEquals (18 , props .size ());
739738 }
740739
741740 @ Test
742- public void testGetOperatingSystemInfo () throws IOException , SAXException , ParserConfigurationException {
741+ public void testGetOperatingSystemInfo () throws IOException , SAXException {
743742 Pair <String , String > guestOsPair = ovfHelper .getOperatingSystemInfoFromXmlString (ovfFileVirtualHardwareSection );
744743 Assert .assertEquals ("other26xLinux64Guest" , guestOsPair .first ());
745744 Assert .assertEquals ("Other 2.6x Linux (64-bit)" , guestOsPair .second ());
746745 }
747746
748747 @ Test
749- public void testGetMinimumHardwareVersion () throws IOException , SAXException , ParserConfigurationException {
748+ public void testGetMinimumHardwareVersion () throws IOException , SAXException {
750749 OVFVirtualHardwareSectionTO hardwareSection = ovfHelper .getVirtualHardwareSectionFromXmlString (ovfFileVirtualHardwareSection );
751750 Assert .assertEquals ("vmx-08" , hardwareSection .getMinimiumHardwareVersion ());
752751 }
0 commit comments