You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by rr...@apache.org on 2010/08/20 13:59:23 UTC
svn commit: r987465 - in /ode/trunk/axis2-war/src/test:
java/org/apache/ode/axis2/ resources/TestMultiPartMessage/
Author: rr
Date: Fri Aug 20 11:59:22 2010
New Revision: 987465
URL: http://svn.apache.org/viewvc?rev=987465&view=rev
Log:
MultiPartMessageTest
Added:
ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/MultiPartMessageTest.java
ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/
ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/HelloWorld2.bpel
ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/HelloWorld2.wsdl
ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/deploy.xml
ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/testRequest.soap
Added: ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/MultiPartMessageTest.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/MultiPartMessageTest.java?rev=987465&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/MultiPartMessageTest.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/MultiPartMessageTest.java Fri Aug 20 11:59:22 2010
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+package org.apache.ode.axis2;
+
+import org.testng.annotations.Test;
+import static org.testng.AssertJUnit.assertTrue;
+
+/**
+ * Tests that timeouts set in the *.endpoint files are applied.
+ * The test is designed so a fault must be received.
+ *
+ * Actually, the process invokes a 3-sec long operation (see the process request).
+ * The specified timeouts are lesser than 3-sec, so if properly applied, a fault should be trown.
+ * If not applied, the default 120-sec timeouts will be used. 5sec < 120sec, so the request will succeed.
+ *
+ */
+public class MultiPartMessageTest extends Axis2TestBase {
+ @Test(dataProvider="configs")
+ public void test() throws Exception {
+ String bundleName = "TestMultiPartMessage";
+ if (server.isDeployed(bundleName)) server.undeployProcess(bundleName);
+ server.deployProcess(bundleName);
+ try {
+ String response = sendRequestFile("http://localhost:8888/ode/processes/helloWorld",
+ bundleName, "testRequest.soap");
+ System.out.println(response);
+ assertTrue(response.contains("abc1") && response.contains("abc2"));
+ } finally {
+ server.undeployProcess(bundleName);
+ }
+ }
+}
Added: ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/HelloWorld2.bpel
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/HelloWorld2.bpel?rev=987465&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/HelloWorld2.bpel (added)
+++ ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/HelloWorld2.bpel Fri Aug 20 11:59:22 2010
@@ -0,0 +1,56 @@
+<!--
+ ~ 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.
+ -->
+<process name="HelloWorld2"
+ targetNamespace="http://ode/bpel/unit-test"
+ xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+ xmlns:tns="http://ode/bpel/unit-test"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:test="http://ode/bpel/unit-test.wsdl"
+ queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+ expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
+
+ <import location="HelloWorld2.wsdl"
+ namespace="http://ode/bpel/unit-test.wsdl"
+ importType="http://schemas.xmlsoap.org/wsdl/" />
+
+ <partnerLinks>
+ <partnerLink name="helloPartnerLink"
+ partnerLinkType="test:HelloPartnerLinkType" myRole="me" />
+ </partnerLinks>
+
+ <variables>
+ <variable name="myVar" messageType="test:HelloMessage"/>
+ <variable name="myVar2" messageType="test:HelloMessage"/>
+ </variables>
+
+ <sequence>
+ <receive name="start" partnerLink="helloPartnerLink" portType="test:HelloPortType"
+ operation="hello" variable="myVar" createInstance="yes"/>
+
+ <assign>
+ <copy>
+ <from><literal><message xmlns=""><part1>abc1</part1><part2>abc2</part2></message></literal></from>
+ <to>$myVar2</to>
+ </copy>
+ </assign>
+
+ <reply name="end" partnerLink="helloPartnerLink" portType="test:HelloPortType"
+ operation="hello" variable="myVar2"/>
+ </sequence>
+</process>
Added: ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/HelloWorld2.wsdl
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/HelloWorld2.wsdl?rev=987465&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/HelloWorld2.wsdl (added)
+++ ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/HelloWorld2.wsdl Fri Aug 20 11:59:22 2010
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ ~ 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.
+ -->
+
+<wsdl:definitions
+ targetNamespace="http://ode/bpel/unit-test.wsdl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://ode/bpel/unit-test.wsdl"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+
+ <wsdl:message name="HelloMessage">
+ <wsdl:part name="part1" type="xsd:string"/>
+ <wsdl:part name="part2" type="xsd:string"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloPortType">
+ <wsdl:operation name="hello">
+ <wsdl:input message="tns:HelloMessage" name="TestIn"/>
+ <wsdl:output message="tns:HelloMessage" name="TestOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="hello">
+ <soap:operation soapAction="" style="rpc"/>
+ <wsdl:input>
+ <soap:body
+ namespace="http://ode/bpel/unit-test.wsdl"
+ use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body
+ namespace="http://ode/bpel/unit-test.wsdl"
+ use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="HelloService">
+ <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
+ <soap:address location="http://localhost:8888/ode/processes/helloWorld"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="HelloPartnerLinkType">
+ <plnk:role name="me" portType="tns:HelloPortType"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
+
Added: ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/deploy.xml
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/deploy.xml?rev=987465&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/deploy.xml (added)
+++ ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/deploy.xml Fri Aug 20 11:59:22 2010
@@ -0,0 +1,30 @@
+<!--
+ ~ 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.
+ -->
+<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+ xmlns:pns="http://ode/bpel/unit-test"
+ xmlns:wns="http://ode/bpel/unit-test.wsdl" xmlns:dns="http://axis2.ode.apache.org">
+
+
+ <process name="pns:HelloWorld2">
+ <active>true</active>
+ <provide partnerLink="helloPartnerLink">
+ <service name="wns:HelloService" port="HelloPort"/>
+ </provide>
+ </process>
+</deploy>
Added: ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/testRequest.soap
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/testRequest.soap?rev=987465&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/testRequest.soap (added)
+++ ode/trunk/axis2-war/src/test/resources/TestMultiPartMessage/testRequest.soap Fri Aug 20 11:59:22 2010
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ ~ 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.
+ -->
+
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
+ <!-- test soap message -->
+ <SOAP-ENV:Body>
+ <ns1:hello xmlns:ns1="http://ode/bpel/unit-test.wsdl">
+ <part1 xmlns="">Hello1</part1>
+ <part2 xmlns="">Hello2</part2>
+ </ns1:hello>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>