@Test public void testSelectElementWithWrongXmlPath() throws IOException, URISyntaxException { String path = "/xml/Wrongtest.xml"; String xPathQuery = "/root/element3/subelement"; Map<String, String> result = select.execute(path, XML_PATH, xPathQuery, VALUE, null, FALSE); assertEquals(ResponseNames.FAILURE, result.get(RESULT_TEXT)); assertEquals(FAILURE, result.get(RETURN_CODE)); }
@Action(name = "XpathQuery", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(SELECTED_VALUE), @Output(ERROR_MESSAGE)}, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = COMPARE_EQUAL, isDefault = true, isOnFail = true)}) public Map<String, String> execute( @Param(value = Constants.Inputs.XML_DOCUMENT, required = true) String xmlDocument, @Param(Constants.Inputs.XML_DOCUMENT_SOURCE) String xmlDocumentSource, @Param(value = Constants.Inputs.XPATH_QUERY, required = true) String xPathQuery, @Param(value = Constants.Inputs.QUERY_TYPE, required = true) String queryType, @Param(Constants.Inputs.DELIMITER) String delimiter, @Param(Constants.Inputs.SECURE_PROCESSING) String secureProcessing) { final CommonInputs commonInputs = new CommonInputs.CommonInputsBuilder() .withXmlDocument(xmlDocument) .withXmlDocumentSource(xmlDocumentSource) .withXpathQuery(xPathQuery) .withSecureProcessing(secureProcessing) .build(); final CustomInputs customInputs = new CustomInputs.CustomInputsBuilder() .withQueryType(queryType) .withDelimiter(delimiter) .build(); return new XpathQueryService().execute(commonInputs, customInputs); }
XpathQuery { @Action(name = "XpathQuery", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(SELECTED_VALUE), @Output(ERROR_MESSAGE)}, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = COMPARE_EQUAL, isDefault = true, isOnFail = true)}) public Map<String, String> execute( @Param(value = Constants.Inputs.XML_DOCUMENT, required = true) String xmlDocument, @Param(Constants.Inputs.XML_DOCUMENT_SOURCE) String xmlDocumentSource, @Param(value = Constants.Inputs.XPATH_QUERY, required = true) String xPathQuery, @Param(value = Constants.Inputs.QUERY_TYPE, required = true) String queryType, @Param(Constants.Inputs.DELIMITER) String delimiter, @Param(Constants.Inputs.SECURE_PROCESSING) String secureProcessing) { final CommonInputs commonInputs = new CommonInputs.CommonInputsBuilder() .withXmlDocument(xmlDocument) .withXmlDocumentSource(xmlDocumentSource) .withXpathQuery(xPathQuery) .withSecureProcessing(secureProcessing) .build(); final CustomInputs customInputs = new CustomInputs.CustomInputsBuilder() .withQueryType(queryType) .withDelimiter(delimiter) .build(); return new XpathQueryService().execute(commonInputs, customInputs); } }
XpathQuery { @Action(name = "XpathQuery", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(SELECTED_VALUE), @Output(ERROR_MESSAGE)}, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = COMPARE_EQUAL, isDefault = true, isOnFail = true)}) public Map<String, String> execute( @Param(value = Constants.Inputs.XML_DOCUMENT, required = true) String xmlDocument, @Param(Constants.Inputs.XML_DOCUMENT_SOURCE) String xmlDocumentSource, @Param(value = Constants.Inputs.XPATH_QUERY, required = true) String xPathQuery, @Param(value = Constants.Inputs.QUERY_TYPE, required = true) String queryType, @Param(Constants.Inputs.DELIMITER) String delimiter, @Param(Constants.Inputs.SECURE_PROCESSING) String secureProcessing) { final CommonInputs commonInputs = new CommonInputs.CommonInputsBuilder() .withXmlDocument(xmlDocument) .withXmlDocumentSource(xmlDocumentSource) .withXpathQuery(xPathQuery) .withSecureProcessing(secureProcessing) .build(); final CustomInputs customInputs = new CustomInputs.CustomInputsBuilder() .withQueryType(queryType) .withDelimiter(delimiter) .build(); return new XpathQueryService().execute(commonInputs, customInputs); }  }
XpathQuery { @Action(name = "XpathQuery", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(SELECTED_VALUE), @Output(ERROR_MESSAGE)}, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = COMPARE_EQUAL, isDefault = true, isOnFail = true)}) public Map<String, String> execute( @Param(value = Constants.Inputs.XML_DOCUMENT, required = true) String xmlDocument, @Param(Constants.Inputs.XML_DOCUMENT_SOURCE) String xmlDocumentSource, @Param(value = Constants.Inputs.XPATH_QUERY, required = true) String xPathQuery, @Param(value = Constants.Inputs.QUERY_TYPE, required = true) String queryType, @Param(Constants.Inputs.DELIMITER) String delimiter, @Param(Constants.Inputs.SECURE_PROCESSING) String secureProcessing) { final CommonInputs commonInputs = new CommonInputs.CommonInputsBuilder() .withXmlDocument(xmlDocument) .withXmlDocumentSource(xmlDocumentSource) .withXpathQuery(xPathQuery) .withSecureProcessing(secureProcessing) .build(); final CustomInputs customInputs = new CustomInputs.CustomInputsBuilder() .withQueryType(queryType) .withDelimiter(delimiter) .build(); return new XpathQueryService().execute(commonInputs, customInputs); }  @Action(name = "XpathQuery", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(SELECTED_VALUE), @Output(ERROR_MESSAGE)}, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = COMPARE_EQUAL, isDefault = true, isOnFail = true)}) Map<String, String> execute(
            @Param(value = Constants.Inputs.XML_DOCUMENT, required = true) String xmlDocument,
            @Param(Constants.Inputs.XML_DOCUMENT_SOURCE) String xmlDocumentSource,
            @Param(value = Constants.Inputs.XPATH_QUERY, required = true) String xPathQuery,
            @Param(value = Constants.Inputs.QUERY_TYPE, required = true) String queryType,
            @Param(Constants.Inputs.DELIMITER) String delimiter,
            @Param(Constants.Inputs.SECURE_PROCESSING) String secureProcessing); }
XpathQuery { @Action(name = "XpathQuery", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(SELECTED_VALUE), @Output(ERROR_MESSAGE)}, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = COMPARE_EQUAL, isDefault = true, isOnFail = true)}) public Map<String, String> execute( @Param(value = Constants.Inputs.XML_DOCUMENT, required = true) String xmlDocument, @Param(Constants.Inputs.XML_DOCUMENT_SOURCE) String xmlDocumentSource, @Param(value = Constants.Inputs.XPATH_QUERY, required = true) String xPathQuery, @Param(value = Constants.Inputs.QUERY_TYPE, required = true) String queryType, @Param(Constants.Inputs.DELIMITER) String delimiter, @Param(Constants.Inputs.SECURE_PROCESSING) String secureProcessing) { final CommonInputs commonInputs = new CommonInputs.CommonInputsBuilder() .withXmlDocument(xmlDocument) .withXmlDocumentSource(xmlDocumentSource) .withXpathQuery(xPathQuery) .withSecureProcessing(secureProcessing) .build(); final CustomInputs customInputs = new CustomInputs.CustomInputsBuilder() .withQueryType(queryType) .withDelimiter(delimiter) .build(); return new XpathQueryService().execute(commonInputs, customInputs); }  @Action(name = "XpathQuery", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(SELECTED_VALUE), @Output(ERROR_MESSAGE)}, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = SUCCESS, matchType = COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = FAILURE, matchType = COMPARE_EQUAL, isDefault = true, isOnFail = true)}) Map<String, String> execute(
            @Param(value = Constants.Inputs.XML_DOCUMENT, required = true) String xmlDocument,
            @Param(Constants.Inputs.XML_DOCUMENT_SOURCE) String xmlDocumentSource,
            @Param(value = Constants.Inputs.XPATH_QUERY, required = true) String xPathQuery,
            @Param(value = Constants.Inputs.QUERY_TYPE, required = true) String queryType,
            @Param(Constants.Inputs.DELIMITER) String delimiter,
            @Param(Constants.Inputs.SECURE_PROCESSING) String secureProcessing);  }