@Test public void testNonElementXPathQuery() { String xPathQuery = " String name = "atName"; String value = "test value"; Map<String, String> result = setValue.execute(xml, EMPTY, xPathQuery, name, value, FALSE); assertEquals(ResponseNames.FAILURE, result.get(RESULT_TEXT)); assertEquals(FAILURE, result.get(RETURN_CODE)); assertEquals(PARSING_ERROR + SET_VALUE_FAILURE + NEED_ELEMENT_TYPE, result.get(ERROR_MESSAGE)); }
@Action(name = "Set Value", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(RESULT_XML), @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 = XML_DOCUMENT, required = true) String xmlDocument, @Param(value = XML_DOCUMENT_SOURCE, required = true) String xmlDocumentSource, @Param(value = XPATH_ELEMENT_QUERY, required = true) String xPathQuery, @Param(value = ATTRIBUTE_NAME) String attributeName, @Param(value = VALUE, required = true) String value, @Param(value = SECURE_PROCESSING) String secureProcessing) { final CommonInputs inputs = new CommonInputs.CommonInputsBuilder() .withXmlDocument(xmlDocument) .withXmlDocumentSource(xmlDocumentSource) .withXpathQuery(xPathQuery) .withSecureProcessing(secureProcessing) .build(); final CustomInputs customInputs = new CustomInputs.CustomInputsBuilder() .withAttributeName(attributeName) .withValue(value) .build(); return new SetValueService().execute(inputs, customInputs); }
SetValue { @Action(name = "Set Value", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(RESULT_XML), @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 = XML_DOCUMENT, required = true) String xmlDocument, @Param(value = XML_DOCUMENT_SOURCE, required = true) String xmlDocumentSource, @Param(value = XPATH_ELEMENT_QUERY, required = true) String xPathQuery, @Param(value = ATTRIBUTE_NAME) String attributeName, @Param(value = VALUE, required = true) String value, @Param(value = SECURE_PROCESSING) String secureProcessing) { final CommonInputs inputs = new CommonInputs.CommonInputsBuilder() .withXmlDocument(xmlDocument) .withXmlDocumentSource(xmlDocumentSource) .withXpathQuery(xPathQuery) .withSecureProcessing(secureProcessing) .build(); final CustomInputs customInputs = new CustomInputs.CustomInputsBuilder() .withAttributeName(attributeName) .withValue(value) .build(); return new SetValueService().execute(inputs, customInputs); } }
SetValue { @Action(name = "Set Value", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(RESULT_XML), @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 = XML_DOCUMENT, required = true) String xmlDocument, @Param(value = XML_DOCUMENT_SOURCE, required = true) String xmlDocumentSource, @Param(value = XPATH_ELEMENT_QUERY, required = true) String xPathQuery, @Param(value = ATTRIBUTE_NAME) String attributeName, @Param(value = VALUE, required = true) String value, @Param(value = SECURE_PROCESSING) String secureProcessing) { final CommonInputs inputs = new CommonInputs.CommonInputsBuilder() .withXmlDocument(xmlDocument) .withXmlDocumentSource(xmlDocumentSource) .withXpathQuery(xPathQuery) .withSecureProcessing(secureProcessing) .build(); final CustomInputs customInputs = new CustomInputs.CustomInputsBuilder() .withAttributeName(attributeName) .withValue(value) .build(); return new SetValueService().execute(inputs, customInputs); }  }
SetValue { @Action(name = "Set Value", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(RESULT_XML), @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 = XML_DOCUMENT, required = true) String xmlDocument, @Param(value = XML_DOCUMENT_SOURCE, required = true) String xmlDocumentSource, @Param(value = XPATH_ELEMENT_QUERY, required = true) String xPathQuery, @Param(value = ATTRIBUTE_NAME) String attributeName, @Param(value = VALUE, required = true) String value, @Param(value = SECURE_PROCESSING) String secureProcessing) { final CommonInputs inputs = new CommonInputs.CommonInputsBuilder() .withXmlDocument(xmlDocument) .withXmlDocumentSource(xmlDocumentSource) .withXpathQuery(xPathQuery) .withSecureProcessing(secureProcessing) .build(); final CustomInputs customInputs = new CustomInputs.CustomInputsBuilder() .withAttributeName(attributeName) .withValue(value) .build(); return new SetValueService().execute(inputs, customInputs); }  @Action(name = "Set Value", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(RESULT_XML), @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 = XML_DOCUMENT, required = true) String xmlDocument,
            @Param(value = XML_DOCUMENT_SOURCE, required = true) String xmlDocumentSource,
            @Param(value = XPATH_ELEMENT_QUERY, required = true) String xPathQuery,
            @Param(value = ATTRIBUTE_NAME) String attributeName,
            @Param(value = VALUE, required = true) String value,
            @Param(value = SECURE_PROCESSING) String secureProcessing); }
SetValue { @Action(name = "Set Value", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(RESULT_XML), @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 = XML_DOCUMENT, required = true) String xmlDocument, @Param(value = XML_DOCUMENT_SOURCE, required = true) String xmlDocumentSource, @Param(value = XPATH_ELEMENT_QUERY, required = true) String xPathQuery, @Param(value = ATTRIBUTE_NAME) String attributeName, @Param(value = VALUE, required = true) String value, @Param(value = SECURE_PROCESSING) String secureProcessing) { final CommonInputs inputs = new CommonInputs.CommonInputsBuilder() .withXmlDocument(xmlDocument) .withXmlDocumentSource(xmlDocumentSource) .withXpathQuery(xPathQuery) .withSecureProcessing(secureProcessing) .build(); final CustomInputs customInputs = new CustomInputs.CustomInputsBuilder() .withAttributeName(attributeName) .withValue(value) .build(); return new SetValueService().execute(inputs, customInputs); }  @Action(name = "Set Value", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(RESULT_XML), @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 = XML_DOCUMENT, required = true) String xmlDocument,
            @Param(value = XML_DOCUMENT_SOURCE, required = true) String xmlDocumentSource,
            @Param(value = XPATH_ELEMENT_QUERY, required = true) String xPathQuery,
            @Param(value = ATTRIBUTE_NAME) String attributeName,
            @Param(value = VALUE, required = true) String value,
            @Param(value = SECURE_PROCESSING) String secureProcessing);  }