From 8d44eeeb96c70ce72cf998309d913dd764572e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1lm=C3=A1n=20K=C3=A9pes?= Date: Thu, 31 Jan 2019 16:21:36 +0100 Subject: [PATCH 1/2] PUT and POST methods can now have an empty body defined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kálmán Képes --- .../Bpel4RestLightOperation.java | 49 +++++++++++------ .../bpel4restlight/http/HighLevelRestApi.java | 52 +++++++++++++++++++ 2 files changed, 84 insertions(+), 17 deletions(-) diff --git a/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightOperation.java b/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightOperation.java index 3bcf2ec8f..df0b3c29a 100644 --- a/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightOperation.java +++ b/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightOperation.java @@ -63,26 +63,35 @@ public void runSync(ExtensionContext context, Element element) throws FaultExcep switch (HttpMethod.valueOf(httpMethod)) { case PUT: { - String requestPayload = Bpel4RestLightUtil.extractRequestPayload(context, element); - - responseMessage = HighLevelRestApi.Put(requestUri, requestPayload, acceptHeader, contentType); - - if (logger.isDebugEnabled()) { - logger.debug("Request message payload: " + requestPayload); - } - + try { + String requestPayload = Bpel4RestLightUtil.extractRequestPayload(context, element); + responseMessage = HighLevelRestApi.Put(requestUri, requestPayload, acceptHeader, contentType); + if (logger.isDebugEnabled()) { + logger.debug("Request message payload: " + requestPayload); + } + } catch(FaultException e) { + if (logger.isDebugEnabled()) { + logger.debug("Warning, request message payload will be empty"); + } + responseMessage = HighLevelRestApi.Put(requestUri, acceptHeader); + } break; } case POST: { - String requestPayload = Bpel4RestLightUtil.extractRequestPayload(context, element); - - responseMessage = HighLevelRestApi.Post(requestUri, requestPayload, acceptHeader, contentType); - - if (logger.isDebugEnabled()) { - logger.debug("Request message payload: \n" + requestPayload); - } - + try { + String requestPayload = Bpel4RestLightUtil.extractRequestPayload(context, element); + responseMessage = HighLevelRestApi.Post(requestUri, requestPayload, acceptHeader, contentType); + + if (logger.isDebugEnabled()) { + logger.debug("Request message payload: \n" + requestPayload); + } + } catch(FaultException e) { + if (logger.isDebugEnabled()) { + logger.debug("Warning, request message payload will be empty"); + } + responseMessage = HighLevelRestApi.Post(requestUri, acceptHeader); + } break; } @@ -114,7 +123,13 @@ private void processResponseMessage(HttpResponseMessage responseMessage, String statusCodeVariableName = Bpel4RestLightUtil.getMethodAttributeValue(context, element, MethodAttribute.STATUS_CODE_VARIABLE); - String responsePayload = responseMessage.getResponseBody().trim(); + + + String responsePayload = responseMessage.getResponseBody(); + if(responsePayload != null && !responsePayload.isEmpty()) { + responsePayload = responsePayload.trim(); + } + int statusCode = responseMessage.getStatusCode(); if (responsePayloadVariableName != null && !responsePayloadVariableName.isEmpty()) { diff --git a/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/http/HighLevelRestApi.java b/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/http/HighLevelRestApi.java index 3cff3e1be..e5ecfc759 100644 --- a/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/http/HighLevelRestApi.java +++ b/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/http/HighLevelRestApi.java @@ -40,6 +40,7 @@ public class HighLevelRestApi { * @param uri The URI of the target resource * @param requestPayload The payload of the request message * @param acceptHeaderValue The value of the accept header field to be set + * @param contentType The contentType of the request payload * @return A HttpResponseMessage providing the response message payload and status code. * * @exception FaultException @@ -67,6 +68,28 @@ public static HttpResponseMessage Put(String uri, String requestPayload, return responseMessage; } + + /** + * This method implements the HTTP PUT Method + * + * @param uri The URI of the target resource + * @param acceptHeaderValue The value of the accept header field to be set + * @return A HttpResponseMessage providing the response message payload and status code. + * + * @exception FaultException + */ + public static HttpResponseMessage Put(String uri, + String acceptHeaderValue) throws FaultException { + PutMethod method = new PutMethod(uri); + + HighLevelRestApi.setAcceptHeader(method, acceptHeaderValue); + + HttpResponseMessage responseMessage = LowLevelRestApi.executeHttpMethod(method); + // Remove Date: Fri, 1 Feb 2019 10:17:38 +0100 Subject: [PATCH 2/2] Changed implementation back to initially discussed solution on how to introduce PUT and POST calls without requests. Now extension activity definitions intended to have no request specified should be distinguishable from once that are specified incorrect or refer to non-initialized or undeclared variables (see added test cases). --- .../Bpel4RestLightOperation.java | 33 ++--- .../bpel4restlight/Bpel4RestLightUtil.java | 25 ++++ .../bpel/runtime/ExtensionContextImpl.java | 11 +- .../ode/test/RestExtensionActivitiesTest.java | 116 +++++++++++++++--- .../TestRestPostExtAct.bpel | 90 ++++++++++++++ .../TestRestPostExtAct.wsdl | 73 +++++++++++ .../deploy.xml | 30 +++++ .../restApi.xsd | 19 +++ .../test.properties | 22 ++++ .../TestRestPostExtAct.bpel | 90 ++++++++++++++ .../TestRestPostExtAct.wsdl | 73 +++++++++++ .../TestRestPostExtActNoRequest/deploy.xml | 30 +++++ .../TestRestPostExtActNoRequest/restApi.xsd | 19 +++ .../test.properties | 23 ++++ .../TestRestPostExtAct.bpel | 91 ++++++++++++++ .../TestRestPostExtAct.wsdl | 73 +++++++++++ .../deploy.xml | 30 +++++ .../restApi.xsd | 19 +++ .../test.properties | 23 ++++ .../TestRestPostExtAct.bpel | 90 ++++++++++++++ .../TestRestPostExtAct.wsdl | 73 +++++++++++ .../deploy.xml | 30 +++++ .../restApi.xsd | 19 +++ .../test.properties | 23 ++++ .../TestRestPutExtAct.bpel | 89 ++++++++++++++ .../TestRestPutExtAct.wsdl | 73 +++++++++++ .../2.0/TestRestPutExtActNoRequest/deploy.xml | 30 +++++ .../TestRestPutExtActNoRequest/restApi.xsd | 19 +++ .../test.properties | 23 ++++ 29 files changed, 1323 insertions(+), 36 deletions(-) create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/TestRestPostExtAct.bpel create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/TestRestPostExtAct.wsdl create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/deploy.xml create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/restApi.xsd create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/test.properties create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/TestRestPostExtAct.bpel create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/TestRestPostExtAct.wsdl create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/deploy.xml create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/restApi.xsd create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/test.properties create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/TestRestPostExtAct.bpel create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/TestRestPostExtAct.wsdl create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/deploy.xml create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/restApi.xsd create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/test.properties create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/TestRestPostExtAct.bpel create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/TestRestPostExtAct.wsdl create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/deploy.xml create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/restApi.xsd create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/test.properties create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/TestRestPutExtAct.bpel create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/TestRestPutExtAct.wsdl create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/deploy.xml create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/restApi.xsd create mode 100644 bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/test.properties diff --git a/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightOperation.java b/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightOperation.java index df0b3c29a..c65aa933b 100644 --- a/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightOperation.java +++ b/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightOperation.java @@ -63,33 +63,39 @@ public void runSync(ExtensionContext context, Element element) throws FaultExcep switch (HttpMethod.valueOf(httpMethod)) { case PUT: { - try { - String requestPayload = Bpel4RestLightUtil.extractRequestPayload(context, element); + if (Bpel4RestLightUtil.specifiesRequest(context, element)) { + String requestPayload = Bpel4RestLightUtil.extractRequestPayload(context, element); + responseMessage = HighLevelRestApi.Put(requestUri, requestPayload, acceptHeader, contentType); + if (logger.isDebugEnabled()) { logger.debug("Request message payload: " + requestPayload); } - } catch(FaultException e) { - if (logger.isDebugEnabled()) { - logger.debug("Warning, request message payload will be empty"); + } else { + if (logger.isDebugEnabled()) { + logger.debug("Request message payload is empty"); } - responseMessage = HighLevelRestApi.Put(requestUri, acceptHeader); - } + + responseMessage = HighLevelRestApi.Put(requestUri, acceptHeader); + } + break; } case POST: { - try { + if (Bpel4RestLightUtil.specifiesRequest(context, element)) { String requestPayload = Bpel4RestLightUtil.extractRequestPayload(context, element); + responseMessage = HighLevelRestApi.Post(requestUri, requestPayload, acceptHeader, contentType); if (logger.isDebugEnabled()) { logger.debug("Request message payload: \n" + requestPayload); } - } catch(FaultException e) { + } else { if (logger.isDebugEnabled()) { - logger.debug("Warning, request message payload will be empty"); + logger.debug("Request message payload is empty"); } + responseMessage = HighLevelRestApi.Post(requestUri, acceptHeader); } break; @@ -122,11 +128,10 @@ private void processResponseMessage(HttpResponseMessage responseMessage, element, MethodAttribute.RESPONSE_PAYLOAD_VARIABLE); String statusCodeVariableName = Bpel4RestLightUtil.getMethodAttributeValue(context, element, MethodAttribute.STATUS_CODE_VARIABLE); - - - + String responsePayload = responseMessage.getResponseBody(); - if(responsePayload != null && !responsePayload.isEmpty()) { + + if (responsePayload != null && !responsePayload.isEmpty()) { responsePayload = responsePayload.trim(); } diff --git a/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightUtil.java b/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightUtil.java index 24341092b..3ec612627 100644 --- a/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightUtil.java +++ b/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightUtil.java @@ -41,6 +41,31 @@ public class Bpel4RestLightUtil { private static final Logger logger = LoggerFactory.getLogger(Bpel4RestLightUtil.class); private static final String VARIABLE_VALUE_REFERENCE = "$bpelvar["; + + /** + * This method checks whether a request payload is specified or not. + * + * @param context The extension context required to resolve variable values. + * @param element element The extension activity DOM element containing the request payload + * @return True, if the provided extension activity specifies a request. False, otherwise + */ + public static boolean specifiesRequest(ExtensionContext context, Element element) { + boolean specifiesRequest = false; + + // Check if a reference to a variable is specified + if (element.hasAttribute("request") || element.hasAttribute("requestPayload")) { + specifiesRequest = true; + } else { + // If no variable was specified, check if a static request payload is specified + Node request = DOMUtils.findChildByType(element, Node.ELEMENT_NODE); + + if (request != null) { + specifiesRequest = true; + } + } + + return specifiesRequest; + } /** * This method extracts the request message payload from the provided extension activity. This diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExtensionContextImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExtensionContextImpl.java index 2b1595254..70c8c8f40 100644 --- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExtensionContextImpl.java +++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExtensionContextImpl.java @@ -118,8 +118,15 @@ public void writeVariable(Variable variable, Node value) throws FaultException { _context.writeVariable(vi, value); } - private Variable getVisibleVariable(String varName) { - return _scopeFrame.oscope.getVisibleVariable(varName); + private Variable getVisibleVariable(String varName) throws FaultException { + Variable var = _scopeFrame.oscope.getVisibleVariable(varName); + + if (var == null) { + throw new FaultException(new QName(Bpel20QNames.NS_WSBPEL2_0, "subLanguageExecutionFault"), + "Attempt to reference undeclared variable '" + varName + "' in BPEL extension activity."); + } + + return var; } public BpelRuntimeContext getBpelRuntimeContext() { diff --git a/bpel-test/src/test/java/org/apache/ode/test/RestExtensionActivitiesTest.java b/bpel-test/src/test/java/org/apache/ode/test/RestExtensionActivitiesTest.java index b1562de61..015f4ff0a 100644 --- a/bpel-test/src/test/java/org/apache/ode/test/RestExtensionActivitiesTest.java +++ b/bpel-test/src/test/java/org/apache/ode/test/RestExtensionActivitiesTest.java @@ -96,6 +96,46 @@ public void testPostExtAct() throws Throwable { public void testPostExtActWithWrappedRequest() throws Throwable { go("/bpel/2.0/TestRestPostExtAct2"); } + + /** + * Tests the "POST" REST extension activity without a request message specified. + * + * @throws Throwable + */ + @Test + public void testPostExtActWithoutRequest() throws Throwable { + go("/bpel/2.0/TestRestPostExtActNoRequest"); + } + + /** + * Tests the "POST" REST extension activity with undeclared request variable specified. + * + * @throws Throwable + */ + @Test + public void testPostExtActWithUndeclaredRequestVariable() throws Throwable { + go("/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable"); + } + + /** + * Tests the "POST" REST extension activity with non-initialized request variable specified. + * + * @throws Throwable + */ + @Test + public void testPostExtActWithNonInitializedRequestVariable() throws Throwable { + go("/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable"); + } + + /** + * Tests the "POST" REST extension activity with an empty request variable specified (variableName=""). + * + * @throws Throwable + */ + @Test + public void testPostExtActWithEmptyRequestVariable() throws Throwable { + go("/bpel/2.0/TestRestPostExtActEmptyRequestVariable"); + } /** * Tests the "PUT" REST extension activity. @@ -106,6 +146,16 @@ public void testPostExtActWithWrappedRequest() throws Throwable { public void testPutExtAct() throws Throwable { go("/bpel/2.0/TestRestPutExtAct"); } + + /** + * Tests the "PUT" REST extension activity without a request message specified.. + * + * @throws Throwable + */ + @Test + public void testPutExtActWithoutRequest() throws Throwable { + go("/bpel/2.0/TestRestPutExtActNoRequest"); + } /** * Tests the "DELETE" REST extension activity. @@ -172,24 +222,42 @@ private void handleHttpRequest(HttpExchange exchange) throws IOException { } else if (method.toUpperCase().equals("POST")) { String request = IOUtils.toString(exchange.getRequestBody()); - String requestValue = ""; - try { - Node reqNode = DOMUtils.stringToDOM(request); - - NodeList list = reqNode.getChildNodes(); - int i = 0; - while (i < list.getLength()) { - Node node = list.item(i); - if (node.getNodeType() == Node.ELEMENT_NODE - && ((Element) node).getLocalName().equals("value")) { - requestValue = node.getTextContent(); + if (request != null && !request.isEmpty()) { + String requestValue = ""; + try { + Node reqNode = DOMUtils.stringToDOM(request); + + NodeList list = reqNode.getChildNodes(); + int i = 0; + while (i < list.getLength()) { + Node node = list.item(i); + if (node.getNodeType() == Node.ELEMENT_NODE + && ((Element) node).getLocalName().equals("value")) { + requestValue = node.getTextContent(); + } + i++; } - i++; - } - String response = + String response = + "\n" + + " " + requestValue + + " Result\n" + + " "; + + byte[] bResponse = response.getBytes(); + + exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, bResponse.length); + exchange.getResponseBody().write(bResponse); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + + exchange.sendResponseHeaders(HttpURLConnection.HTTP_INTERNAL_ERROR, 0); + } + } else { + String response = "\n" - + " " + requestValue + + " " + "No request specified" + " Result\n" + " "; @@ -197,17 +265,13 @@ private void handleHttpRequest(HttpExchange exchange) throws IOException { exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, bResponse.length); exchange.getResponseBody().write(bResponse); - } catch (SAXException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - - exchange.sendResponseHeaders(HttpURLConnection.HTTP_INTERNAL_ERROR, 0); } exchange.close(); } else if (method.toUpperCase().equals("PUT")) { String request = IOUtils.toString(exchange.getRequestBody()); + if (request != null && !request.isEmpty()) { String requestValue = ""; try { Node reqNode = DOMUtils.stringToDOM(request); @@ -239,6 +303,18 @@ private void handleHttpRequest(HttpExchange exchange) throws IOException { exchange.sendResponseHeaders(HttpURLConnection.HTTP_INTERNAL_ERROR, 0); } + } else { + String response = + "\n" + + " " + "No request specified" + + " Result\n" + + " "; + + byte[] bResponse = response.getBytes(); + + exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, bResponse.length); + exchange.getResponseBody().write(bResponse); + } exchange.close(); } else if (method.toUpperCase().equals("DELETE")) { diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/TestRestPostExtAct.bpel b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/TestRestPostExtAct.bpel new file mode 100644 index 000000000..1f2265494 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/TestRestPostExtAct.bpel @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://localhost:8085/test + + + + + + + + + + + + + + + + + + + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/TestRestPostExtAct.wsdl b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/TestRestPostExtAct.wsdl new file mode 100644 index 000000000..2270a8bb9 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/TestRestPostExtAct.wsdl @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/deploy.xml b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/deploy.xml new file mode 100644 index 000000000..08ace8ff1 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/deploy.xml @@ -0,0 +1,30 @@ + + + + + + true + + + + + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/restApi.xsd b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/restApi.xsd new file mode 100644 index 000000000..b521dc70f --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/restApi.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/test.properties b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/test.properties new file mode 100644 index 000000000..00c51b969 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActEmptyRequestVariable/test.properties @@ -0,0 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +namespace=http://ode/bpel/unit-test.wsdl +service=HelloService +operation=hello +request1=Hello +expectedInvokeException=FaultException.class diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/TestRestPostExtAct.bpel b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/TestRestPostExtAct.bpel new file mode 100644 index 000000000..4945fbcfe --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/TestRestPostExtAct.bpel @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://localhost:8085/test + + + + + + + + + + + + + + + + + + + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/TestRestPostExtAct.wsdl b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/TestRestPostExtAct.wsdl new file mode 100644 index 000000000..2270a8bb9 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/TestRestPostExtAct.wsdl @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/deploy.xml b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/deploy.xml new file mode 100644 index 000000000..08ace8ff1 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/deploy.xml @@ -0,0 +1,30 @@ + + + + + + true + + + + + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/restApi.xsd b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/restApi.xsd new file mode 100644 index 000000000..b521dc70f --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/restApi.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/test.properties b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/test.properties new file mode 100644 index 000000000..c037448d0 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNoRequest/test.properties @@ -0,0 +1,23 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +namespace=http://ode/bpel/unit-test.wsdl +service=HelloService +operation=hello +request1=Hello +response1=.*No request specified.* + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/TestRestPostExtAct.bpel b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/TestRestPostExtAct.bpel new file mode 100644 index 000000000..a02b7330f --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/TestRestPostExtAct.bpel @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://localhost:8085/test + + + + + + + + + + + + + + + + + + + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/TestRestPostExtAct.wsdl b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/TestRestPostExtAct.wsdl new file mode 100644 index 000000000..2270a8bb9 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/TestRestPostExtAct.wsdl @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/deploy.xml b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/deploy.xml new file mode 100644 index 000000000..08ace8ff1 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/deploy.xml @@ -0,0 +1,30 @@ + + + + + + true + + + + + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/restApi.xsd b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/restApi.xsd new file mode 100644 index 000000000..b521dc70f --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/restApi.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/test.properties b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/test.properties new file mode 100644 index 000000000..7f42ce8b0 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActNonInitializedRequestVariable/test.properties @@ -0,0 +1,23 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +namespace=http://ode/bpel/unit-test.wsdl +service=HelloService +operation=hello +request1=Hello +expectedInvokeException=FaultException.class + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/TestRestPostExtAct.bpel b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/TestRestPostExtAct.bpel new file mode 100644 index 000000000..10a10cc63 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/TestRestPostExtAct.bpel @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://localhost:8085/test + + + + + + + + + + + + + + + + + + + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/TestRestPostExtAct.wsdl b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/TestRestPostExtAct.wsdl new file mode 100644 index 000000000..2270a8bb9 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/TestRestPostExtAct.wsdl @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/deploy.xml b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/deploy.xml new file mode 100644 index 000000000..08ace8ff1 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/deploy.xml @@ -0,0 +1,30 @@ + + + + + + true + + + + + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/restApi.xsd b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/restApi.xsd new file mode 100644 index 000000000..b521dc70f --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/restApi.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/test.properties b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/test.properties new file mode 100644 index 000000000..7f42ce8b0 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPostExtActUndeclaredRequestVariable/test.properties @@ -0,0 +1,23 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +namespace=http://ode/bpel/unit-test.wsdl +service=HelloService +operation=hello +request1=Hello +expectedInvokeException=FaultException.class + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/TestRestPutExtAct.bpel b/bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/TestRestPutExtAct.bpel new file mode 100644 index 000000000..e4a79949c --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/TestRestPutExtAct.bpel @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://localhost:8085/test + + + + + + + + + + + + + + + + + + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/TestRestPutExtAct.wsdl b/bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/TestRestPutExtAct.wsdl new file mode 100644 index 000000000..2270a8bb9 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/TestRestPutExtAct.wsdl @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/deploy.xml b/bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/deploy.xml new file mode 100644 index 000000000..914b8dcc0 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/deploy.xml @@ -0,0 +1,30 @@ + + + + + + true + + + + + diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/restApi.xsd b/bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/restApi.xsd new file mode 100644 index 000000000..752ea2467 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/restApi.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/test.properties b/bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/test.properties new file mode 100644 index 000000000..c037448d0 --- /dev/null +++ b/bpel-test/src/test/resources/bpel/2.0/TestRestPutExtActNoRequest/test.properties @@ -0,0 +1,23 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +namespace=http://ode/bpel/unit-test.wsdl +service=HelloService +operation=hello +request1=Hello +response1=.*No request specified.* +