public void testApplyInputStream() { InputStream is = getClass().getResourceAsStream("/item.xml"); ResourceAllocationSettingData result = factory.create(injector.getInstance(ResourceAllocationSettingDataHandler.class)).parse(is); assertEquals(result.getAddress(), "0"); assertEquals(result.getDescription(), "SCSI Controller"); assertEquals(result.getElementName(), "SCSI Controller 0"); assertEquals(result.getInstanceID(), "3"); assertEquals(result.getResourceSubType(), "lsilogic"); assertEquals(result.getResourceType(), ResourceType.PARALLEL_SCSI_HBA); }
public Builder fromResourceAllocationSettingData(ResourceAllocationSettingData in) { return elementName(in.getElementName()) .instanceID(in.getInstanceID()) .caption(in.getCaption()) .description(in.getDescription()) .address(in.getAddress()) .addressOnParent(in.getAddressOnParent()) .allocationUnits(in.getAllocationUnits()) .automaticAllocation(in.isAutomaticAllocation()) .automaticDeallocation(in.isAutomaticDeallocation()) .consumerVisibility(in.getConsumerVisibility()) .limit(in.getLimit()) .mappingBehavior(in.getMappingBehavior()) .otherResourceType(in.getOtherResourceType()) .parent(in.getParent()) .poolID(in.getPoolID()) .reservation(in.getReservation()) .resourceSubType(in.getResourceSubType()) .resourceType(in.getResourceType()) .virtualQuantity(in.getVirtualQuantity()) .virtualQuantityUnits(in.getVirtualQuantityUnits()) .weight(in.getWeight()) .connections(in.getConnections()) .hostResources(in.getHostResources()); }