PixManagerRequestXMLToJava { public PRPAIN201309UV02 getPIXQueryReqObject(String reqXMLFilePath, String encodeString) throws JAXBException, IOException { PRPAIN201309UV02 reqObj = null; reqObj = getPIXReqObject(PRPAIN201309UV02.class, reqXMLFilePath); return reqObj; } PixManagerRequestXMLToJava();  PixManagerRequestXMLToJava(SimpleMarshaller marshaller); PRPAIN201301UV02 getPIXAddReqObject(String reqXMLFilePath,
			String encodeString); PRPAIN201302UV02 getPIXUpdateReqObject(String reqXMLFilePath,
			String encodeString); PRPAIN201309UV02 getPIXQueryReqObject(String reqXMLFilePath,
			String encodeString);  }
@Test public void testGetPIXQueryReqObject_by_ValidDomainXMLFile() throws JAXBException, IOException { String expectedItVersion = "XML_1.0"; String expectedId = "JW-824-v3"; PRPAIN201309UV02 pRPAIN201309UV02 = cstl .getPIXQueryReqObject( "xml/PRPA_IN201309UV02_PIXQuery_VD1INALL_Req.xml", encodeString); String actualItversion = pRPAIN201309UV02.getITSVersion(); JXPathContext context = JXPathContext.newContext(pRPAIN201309UV02); String actualId = (String) context .getValue("controlActProcess/queryByParameter/value/parameterList/patientIdentifier[1]/value[1]/extension"); assertEquals(expectedItVersion, actualItversion); assertEquals(expectedId, actualId); }
@Test public void testGetPIXQueryReqObject_by_ValidDomainXMLString() throws JAXBException, IOException, URISyntaxException { String expectedItVersion = "XML_1.0"; String xmlString = FileUtils.readFileToString(new File(getClass() .getClassLoader() .getResource("xml/PRPA_IN201309UV02_PIXQuery_VD1INALL_Req.xml") .toURI())); PRPAIN201309UV02 pRPAIN201309UV02 = cstl.getPIXQueryReqObject( xmlString, encodeString); String actualItversion = pRPAIN201309UV02.getITSVersion(); assertEquals(expectedItVersion, actualItversion); }
@Test public void testGetPIXQueryReqObject_by_null_Exception() throws JAXBException, IOException { thrown.expect(JAXBException.class); cstl.getPIXQueryReqObject(null, encodeString); }
@Ignore("Not required anymore since the marshaller implementation is changed") @Test public void testGetPIXQueryReqObject_by_usup_Exception() throws JAXBException, IOException, URISyntaxException { thrown.expect(JAXBException.class); String xmlString = FileUtils.readFileToString(new File(getClass() .getClassLoader() .getResource("xml/PRPA_IN201309UV02_PIXQuery_VD1INALL_Req.xml") .toURI())); cstl.getPIXQueryReqObject(xmlString, "UTF-123"); }