You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mi...@apache.org on 2009/01/29 04:49:54 UTC
svn commit: r738736 - in /ode/branches/APACHE_ODE_1.X/axis2-war/src/test:
java/org/apache/ode/axis2/ resources/TestRampart4Process/
resources/TestRampart4Process/basic/
resources/TestRampart4Process/basic/process-template/
Author: midon
Date: Thu Jan 29 03:49:54 2009
New Revision: 738736
URL: http://svn.apache.org/viewvc?rev=738736&view=rev
Log:
create a working process before adding security to it
Added:
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/Rampart4ProcessBasicTest.java
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/HelloWorld2.bpel
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/HelloWorld2.wsdl
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/deploy.xml
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/testRequest.soap
Added: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/Rampart4ProcessBasicTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/Rampart4ProcessBasicTest.java?rev=738736&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/Rampart4ProcessBasicTest.java (added)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/Rampart4ProcessBasicTest.java Thu Jan 29 03:49:54 2009
@@ -0,0 +1,85 @@
+/*
+ * 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 static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.AfterTest;
+import org.apache.axis2.transport.http.server.SimpleHttpServer;
+import org.apache.axis2.transport.http.SimpleHTTPServer;
+
+import java.io.File;
+import java.io.FileFilter;
+
+/**
+ *
+ *
+ */
+public class Rampart4ProcessBasicTest extends Axis2TestBase {
+
+// @DataProvider(name = "bundles")
+// public Object[][] testPolicySamples() throws Exception {
+// File[] policies = new File(getClass().getClassLoader().getResource("TestRampartBasic").getFile()).listFiles(new FileFilter() {
+// public boolean accept(File pathname) {
+// return pathname.isDirectory() && pathname.getName().matches("process-basic-sample\\d*");
+// }
+// });
+// Object[][] bundles = new Object[policies.length][];
+// for (int i = 0; i < policies.length; i++) {
+// bundles[i] = new Object[]{"TestRampartBasic/" + policies[i].getName()};
+// }
+//// bundles = new Object[][]{new Object[]{"TestRampartBasic/process-basic-sample02"}};
+// return bundles;
+// }
+//
+
+ @BeforeClass
+ protected void setUp() throws Exception {
+ // mind the annotation above: start the server only once for all tests
+ startServer("TestRampart4Process/basic", "webapp/WEB-INF/conf/axis2.xml");
+ }
+
+ @AfterClass
+ protected void tearDown() throws Exception {
+ // mind the annotation above: start the server only once for all tests
+ super.tearDown();
+ }
+
+ @Test
+ public void executeProcess() throws Exception {
+ String bundleName = "TestRampart4Process/basic/process-template";
+ if (server.isDeployed(new File(bundleName).getName())) {
+ server.undeployProcess(bundleName);
+ }
+ server.deployProcess(bundleName);
+ try {
+ String response = server.sendRequestFile("http://localhost:8888/processes/helloWorld",
+ bundleName, "testRequest.soap");
+ System.out.println(response);
+ assertTrue(response.contains("helloResponse") && response.contains("Hello Darling!"));
+ } finally {
+ server.undeployProcess(bundleName);
+ }
+ }
+}
\ No newline at end of file
Added: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/HelloWorld2.bpel
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/HelloWorld2.bpel?rev=738736&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/HelloWorld2.bpel (added)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/HelloWorld2.bpel Thu Jan 29 03:49:54 2009
@@ -0,0 +1,55 @@
+<!--
+ ~ 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="inVar" messageType="test:HelloMessage"/>
+ <variable name="outVar" messageType="test:HelloMessage"/>
+ </variables>
+
+ <sequence>
+ <receive name="start" partnerLink="helloPartnerLink" portType="test:HelloPortType"
+ operation="hello" variable="inVar" createInstance="yes"/>
+
+ <assign>
+ <copy>
+ <from>concat(concat("Hello ", $inVar.TestPart), "!")</from>
+ <to>$outVar.TestPart</to>
+ </copy>
+ </assign>
+ <reply name="end" partnerLink="helloPartnerLink" portType="test:HelloPortType"
+ operation="hello" variable="outVar"/>
+ </sequence>
+</process>
Added: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/HelloWorld2.wsdl
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/HelloWorld2.wsdl?rev=738736&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/HelloWorld2.wsdl (added)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/HelloWorld2.wsdl Thu Jan 29 03:49:54 2009
@@ -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="TestPart" 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:8080/ode/processes/helloWorld"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="HelloPartnerLinkType">
+ <plnk:role name="me" portType="tns:HelloPortType"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
+
Added: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/deploy.xml
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/deploy.xml?rev=738736&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/deploy.xml (added)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/deploy.xml Thu Jan 29 03:49:54 2009
@@ -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">
+
+
+ <process name="pns:HelloWorld2">
+ <active>true</active>
+ <provide partnerLink="helloPartnerLink">
+ <service name="wns:HelloService" port="HelloPort"/>
+ </provide>
+ </process>
+</deploy>
Added: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/testRequest.soap
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/testRequest.soap?rev=738736&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/testRequest.soap (added)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/resources/TestRampart4Process/basic/process-template/testRequest.soap Thu Jan 29 03:49:54 2009
@@ -0,0 +1,28 @@
+<?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">
+ <TestPart xmlns="">Darling</TestPart>
+ </ns1:hello>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>