Starting mograting BPEL iTests to 2.x code base

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@783045 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
lresende 2009-06-09 15:36:37 +00:00
parent 4a064d3ed2
commit c5b1914af2
28 changed files with 1850 additions and 0 deletions

View file

@ -0,0 +1,210 @@
<?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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>itest-bpel</artifactId>
<version>1.6-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>itest-bpel-helloworld-reference</artifactId>
<name>Apache Tuscany SCA iTest HelloWorld Reference BPEL</name>
<repositories>
<repository>
<id>apache.incubator</id>
<url>http://people.apache.org/repo/m2-incubating-repository</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-host-embedded</artifactId>
<version>1.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-implementation-java-runtime</artifactId>
<version>1.6-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-binding-ws-axis2</artifactId>
<version>1.6-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-host-tomcat</artifactId>
<version>1.6-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-implementation-bpel-ode</artifactId>
<version>1.6-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.ode</groupId>
<artifactId>ode-dao-jpa-ojpa-derby</artifactId>
<version>1.1</version>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sdo</groupId>
<artifactId>tuscany-sdo-impl</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>${artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<!-- http://jira.codehaus.org/browse/SUREFIRE-322 -->
<version>2.3.1</version>
<configuration>
<useFile>false</useFile>
<trimStackTrace>false</trimStackTrace>
<useSystemClassLoader>true</useSystemClassLoader>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.ode</groupId>
<artifactId>ode-dao-jpa-ojpa-derby</artifactId>
<version>1.1</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/test-classes/</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>test-compile</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.ode</groupId>
<artifactId>ode-dao-jpa-ojpa-derby</artifactId>
<version>1.1</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/test-classes/</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tuscany.sdo</groupId>
<artifactId>tuscany-sdo-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>generate-bpel-helloworld</id>
<phase>generate-sources</phase>
<configuration>
<schemaFile>${basedir}/src/test/resources/helloworld/helloworld.wsdl</schemaFile>
<targetDirectory>${basedir}/target/wsdl2java-source</targetDirectory>
<prefix>HelloWorld</prefix>
<noNotification>true</noNotification>
<noContainer>true</noContainer>
<noUnsettable>true</noUnsettable>
</configuration>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-maven-wsdl2java</artifactId>
<version>1.6-SNAPSHOT</version>
<executions>
<execution>
<configuration>
<wsdlFiles>
<wsdlFile>
<fileName>${basedir}/src/test/resources/helloworld/helloworld.wsdl</fileName>
</wsdlFile>
</wsdlFiles>
</configuration>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
-->
</plugins>
</build>
</project>

View file

@ -0,0 +1,31 @@
/*
* 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 greetings;
import org.osoa.sca.annotations.Remotable;
/**
* This is the business interface of the HelloWorld greetings service.
*/
@Remotable
public interface GreetingsService {
public String getGreetings(String name);
}

View file

@ -0,0 +1,33 @@
/*
* 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 greetings;
import org.osoa.sca.annotations.Service;
/**
* This class implements the HelloWorld service.
*/
@Service(GreetingsService.class)
public class GreetingsServiceImpl implements GreetingsService {
public String getGreetings(String name) {
return "Hello " + name;
}
}

View file

@ -0,0 +1,60 @@
/*
* 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 greetings;
import java.io.IOException;
import java.net.Socket;
import junit.framework.TestCase;
import org.apache.tuscany.sca.host.embedded.SCADomain;
/**
* Tests the Greetings service
*
* @version $Rev$ $Date$
*/
public class GreetingsTestCase extends TestCase {
private SCADomain scaDomain;
GreetingsService greetingsService = null;
/**
* @throws java.lang.Exception
*/
@Override
protected void setUp() throws Exception {
scaDomain = SCADomain.newInstance("greetings/greetings.composite");
greetingsService = scaDomain.getService(GreetingsService.class, "GreetingsServiceComponent");
}
/**
* @throws java.lang.Exception
*/
@Override
protected void tearDown() throws Exception {
scaDomain.close();
}
public void testInvoke() {
String response = greetingsService.getGreetings("Luciano");
assertEquals("Hello Luciano", response);
}
}

View file

@ -0,0 +1,29 @@
/*
* 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 helloworld;
import org.osoa.sca.annotations.Remotable;
/**
* The interface for the helloworld service
*/
@Remotable
public interface HelloWorldService {
public String hello(String name);
}

View file

@ -0,0 +1,47 @@
/*
* 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 helloworld;
import greetings.GreetingsService;
import org.osoa.sca.annotations.Reference;
/**
* The HelloWorld service implementation
*/
public class HelloWorldServiceImpl implements HelloWorldService {
protected GreetingsService greetingsService;
public GreetingsService getGreetingsService() {
System.out.println("Got Injected greetingsService");
return greetingsService;
}
@Reference
public void setGreetingsService(GreetingsService greetingsService) {
System.out.println("Injected greetingsService");
this.greetingsService = greetingsService;
}
public String hello(String name) {
System.out.println("Calling greeting services getGreetings");
return greetingsService.getGreetings(name);
}
}

View file

@ -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.
*/
package helloworld;
import junit.framework.TestCase;
import org.apache.tuscany.sca.host.embedded.SCADomain;
/**
* Tests the BPEL Helloworld Service
*
* @version $Rev$ $Date$
*/
public class HelloWorldTestCase extends TestCase {
private SCADomain scaDomain;
/**
* @throws java.lang.Exception
*/
@Override
protected void setUp() throws Exception {
scaDomain = SCADomain.newInstance("helloworld/helloworld.composite");
}
/**
* @throws java.lang.Exception
*/
@Override
protected void tearDown() throws Exception {
scaDomain.close();
}
public void testServiceInvocation() {
HelloWorldService bpelService = scaDomain.getService(HelloWorldService.class, "HelloWorldService");
String response = bpelService.hello("Luciano");
assertEquals("Hello Luciano", response);
}
}

View file

@ -0,0 +1,32 @@
<?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.
-->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://greetings"
xmlns:hw="http://greetings"
name="greetings">
<component name="GreetingsServiceComponent">
<implementation.java class="greetings.GreetingsServiceImpl" />
<service name="GreetingsService">
<interface.wsdl interface="http://greetings#wsdl.interface(Greetings)" />
</service>
</component>
</composite>

View file

@ -0,0 +1,87 @@
<?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 name="greetings"
targetNamespace="http://greetings"
xmlns:tns="http://greetings"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://greetings" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="getGreetings">
<complexType>
<sequence>
<element name="name" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="getGreetingsResponse">
<complexType>
<sequence>
<element name="getGreetingsReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="getGreetingsRequest">
<wsdl:part element="tns:getGreetings" name="parameters"/>
</wsdl:message>
<wsdl:message name="getGreetingsResponse">
<wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="Greetings">
<wsdl:operation name="getGreetings">
<wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
<wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="GreetingsSoapBinding" type="tns:Greetings">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getGreetings">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getGreetingsRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getGreetingsResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="GreetingsService">
<wsdl:port name="GreetingsSoapPort" binding="tns:GreetingsSoapBinding">
<wsdlsoap:address location="http://localhost:8085/GreetingsServiceComponent"/>
</wsdl:port>
</wsdl:service>
<plnk:partnerLinkType name="GreetingsPartnerLinkType">
<plnk:role name="Provider" portType="tns:Greetings"/>
</plnk:partnerLinkType>
</wsdl:definitions>

View file

@ -0,0 +1,84 @@
<!--
~ 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="HelloWorld"
targetNamespace="http://helloworld"
xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
xmlns:tns="http://helloworld"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:helloworld="http://helloworld"
xmlns:greetings="http://greetings"
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
<import location="helloworld.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"
namespace="http://helloworld"/>
<import location="../greetings/greetings.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"
namespace="http://greetings"/>
<partnerLinks>
<partnerLink name="helloPartnerLink" partnerLinkType="helloworld:HelloPartnerLinkType" myRole="me" />
<partnerLink name="greetingsPartnerLink" partnerLinkType="greetings:GreetingsPartnerLinkType" partnerRole="Provider" initializePartnerRole="yes" />
</partnerLinks>
<variables>
<variable name="helloMessage" messageType="helloworld:HelloMessage"/>
<variable name="helloResponse" messageType="helloworld:HelloMessage"/>
<variable name="greetingsRequest" messageType="greetings:getGreetingsRequest"/>
<variable name="greetingsResponse" messageType="greetings:getGreetingsResponse"/>
</variables>
<sequence>
<receive
name="start"
createInstance="yes"
operation="hello"
variable="helloMessage"
partnerLink="helloPartnerLink"
portType="helloworld:HelloWorld" />
<assign name="assignToGreetingsRequest">
<copy>
<from>$helloMessage.TestPart</from>
<to>$greetingsRequest.parameters</to>
</copy>
</assign>
<invoke name="invokeGreetings"
operation="getGreetings"
inputVariable="greetingsRequest"
outputVariable="greetingsResponse"
partnerLink="greetingsPartnerLink"
portType="greetings:Greetings" />
<assign name="assignToHelloResponse">
<copy>
<from>$greetingsResponse.parameters/greetings:getGreetingsReturn</from>
<to>$helloResponse.TestPart</to>
</copy>
</assign>
<reply name="end"
operation="hello"
partnerLink="helloPartnerLink"
portType="helloworld:HelloWorld"
variable="helloResponse"/>
</sequence>
</process>

View file

@ -0,0 +1,36 @@
<?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.
-->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://bpel"
xmlns:hns="http://helloworld"
name="helloworld">
<component name="HelloWorldService">
<implementation.bpel process="hns:HelloWorld"/>
<reference name="greetingsPartnerLink" target="GreetingsServiceComponent"/>
</component>
<component name="GreetingsServiceComponent">
<implementation.java class="greetings.GreetingsServiceImpl" />
<service name="GreetingsService">
<interface.wsdl interface="http://greetings#wsdl.interface(Greetings)" />
</service>
</component>
</composite>

View file

@ -0,0 +1,82 @@
<?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 name="helloworld"
targetNamespace="http://helloworld"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://helloworld"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
<wsdl:types>
<schema elementFormDefault="qualified"
targetNamespace="http://helloworld"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="hello">
<complexType>
<sequence>
<element name="message" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="HelloMessage">
<wsdl:part element="tns:hello" name="TestPart"/>
</wsdl:message>
<wsdl:portType name="HelloWorld">
<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:HelloWorld">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="hello">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="TestIn">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="TestOut">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HelloWorldService">
<wsdl:port name="HelloSoapPort" binding="tns:HelloSoapBinding">
<soap:address location="http://localhost:8085/ode/processes/helloWorld"/>
</wsdl:port>
</wsdl:service>
<plnk:partnerLinkType name="HelloPartnerLinkType">
<plnk:role name="me" portType="tns:HelloWorld"/>
<plnk:role name="you" portType="tns:HelloWorld"/>
</plnk:partnerLinkType>
</wsdl:definitions>

View file

@ -0,0 +1,36 @@
#
# 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.
#
# Set root logger level to WARN and its only appender to CONSOLE
log4j.rootLogger=OFF, CONSOLE
# log4j properties to work with commandline tools.
log4j.category.org.mortbay=OFF
log4j.category.org.hibernate.type=OFF
log4j.category.org.objectweb=OFF
log4j.category.org.apache.ode.axis2=OFF
log4j.category.org.apache.ode.bpel.engine=OFF
log4j.category.org.apache.ode.daohib.bpel.CorrelatorDaoImpl=OFF
log4j.category.org.apache.ode.bpel.epr=OFF
log4j.category.org.apache.tuscany.sca.implementation.bpel=DEBUG
log4j.category.org.apache.tuscany.sca.implementation.bpel.ode=DEBUG
log4j.category.org.apache.tuscany.sca.implementation.bpel.provider=DEBUG
# Console appender
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%p] - %C{1}.%M(%L) | %m%n

View file

@ -0,0 +1,176 @@
<?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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>itest-bpel</artifactId>
<version>1.6-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>itest-bpel-helloworld-ws</artifactId>
<name>Apache Tuscany SCA iTest HelloWorld BPEL Over Web Services</name>
<repositories>
<repository>
<id>apache.incubator</id>
<url>http://people.apache.org/repo/m2-incubating-repository</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-host-embedded</artifactId>
<version>1.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-implementation-java-runtime</artifactId>
<version>1.6-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-implementation-bpel-ode</artifactId>
<version>1.6-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-binding-ws-axis2</artifactId>
<version>1.6-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sdo</groupId>
<artifactId>tuscany-sdo-impl</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-host-tomcat</artifactId>
<version>1.6-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>${artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<!-- http://jira.codehaus.org/browse/SUREFIRE-322 -->
<version>2.3.1</version>
<configuration>
<useFile>false</useFile>
<trimStackTrace>false</trimStackTrace>
<useSystemClassLoader>true</useSystemClassLoader>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>test-compile</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.ode</groupId>
<artifactId>ode-dao-jpa-ojpa-derby</artifactId>
<version>1.1</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/test-classes/</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tuscany.sdo</groupId>
<artifactId>tuscany-sdo-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>generate-bpel-helloworld</id>
<phase>generate-sources</phase>
<configuration>
<schemaFile>${basedir}/src/test/resources/helloworld/helloworld.wsdl</schemaFile>
<targetDirectory>${basedir}/target/wsdl2java-source</targetDirectory>
<prefix>HelloWorld</prefix>
<noNotification>true</noNotification>
<noContainer>true</noContainer>
<noUnsettable>true</noUnsettable>
</configuration>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-maven-wsdl2java</artifactId>
<version>1.6-SNAPSHOT</version>
<executions>
<execution>
<configuration>
<wsdlFiles>
<wsdlFile>
<fileName>${basedir}/src/test/resources/helloworld/helloworld.wsdl</fileName>
</wsdlFile>
</wsdlFiles>
</configuration>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,45 @@
/*
* 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 helloworld;
import org.apache.tuscany.implementation.bpel.example.helloworld.HelloPortType;
import org.osoa.sca.annotations.Reference;
/**
* @version $Rev$ $Date$
*/
public class HelloWorld {
private HelloPortType helloService;
public HelloWorld() {
super();
}
@Reference
public void setHelloService(HelloPortType helloService){
this.helloService = helloService;
}
public String hello(String hello) throws java.rmi.RemoteException {
System.out.println(">>> Invoking helloService.hello with : " + hello);
return this.helloService.hello(hello);
}
}

View file

@ -0,0 +1,64 @@
/*
* 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 helloworld;
import java.io.IOException;
import java.net.Socket;
import junit.framework.TestCase;
import org.apache.tuscany.implementation.bpel.example.helloworld.HelloPortType;
import org.apache.tuscany.sca.host.embedded.SCADomain;
/**
* Tests the BPEL Helloworld Service
*
* @version $Rev$ $Date$
*/
public class HelloWorldTestCase extends TestCase {
private SCADomain scaDomain;
/**
* @throws java.lang.Exception
*/
@Override
protected void setUp() throws Exception {
scaDomain = SCADomain.newInstance("helloworld/helloworld.composite");
}
/**
* @throws java.lang.Exception
*/
@Override
protected void tearDown() throws Exception {
scaDomain.close();
}
public void testPing() throws IOException {
new Socket("127.0.0.1", 8085);
}
public void testServiceInvocation() throws Exception {
HelloPortType bpelService = scaDomain.getService(HelloPortType.class, "BPELHelloWorldServiceComponent");
String response = bpelService.hello("Hello");
assertEquals("Hello World", response);
}
}

View file

@ -0,0 +1,66 @@
<!--
~ 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="HelloWorld"
targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld"
xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:test="http://tuscany.apache.org/implementation/bpel/example/helloworld.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="helloworld.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"
namespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"/>
<partnerLinks>
<partnerLink name="helloPartnerLink" partnerLinkType="test:HelloPartnerLinkType" myRole="me" />
</partnerLinks>
<variables>
<variable name="helloMessage" messageType="test:HelloMessage"/>
<variable name="tmpVar" type="xsd:string"/>
</variables>
<sequence>
<receive
name="start"
partnerLink="helloPartnerLink"
portType="test:HelloPortType"
operation="hello"
variable="helloMessage"
createInstance="yes"/>
<assign name="assign1">
<copy>
<from variable="helloMessage" part="TestPart"/>
<to variable="tmpVar"/>
</copy>
<copy>
<from>concat($tmpVar,' World')</from>
<to variable="helloMessage" part="TestPart"/>
</copy>
</assign>
<reply name="end"
partnerLink="helloPartnerLink"
portType="test:HelloPortType"
operation="hello"
variable="helloMessage"/>
</sequence>
</process>

View file

@ -0,0 +1,32 @@
<?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.
-->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://bpel"
xmlns:hns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
name="helloworld">
<component name="BPELHelloWorldServiceComponent">
<implementation.bpel process="hns:HelloWorld"/>
<service name="helloPartnerLink">
<interface.wsdl interface="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl#wsdl.interface(HelloPortType)" />
<binding.ws uri="http://localhost:8085/HelloPartnerLink" wsdlElement="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl#wsdl.service(HelloService)"/>
</service>
</component>
</composite>

View file

@ -0,0 +1,82 @@
<?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 name="helloworld"
targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
<wsdl:types>
<schema elementFormDefault="qualified"
targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="hello">
<complexType>
<sequence>
<element name="message" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="HelloMessage">
<wsdl:part element="tns:hello" name="TestPart"/>
</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">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="hello">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="TestIn">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="TestOut">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HelloService">
<wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
<soap:address location="http://localhost:8085/ode/processes/helloWorld"/>
</wsdl:port>
</wsdl:service>
<plnk:partnerLinkType name="HelloPartnerLinkType">
<plnk:role name="me" portType="tns:HelloPortType"/>
<plnk:role name="you" portType="tns:HelloPortType"/>
</plnk:partnerLinkType>
</wsdl:definitions>

View file

@ -0,0 +1,36 @@
#
# 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.
#
# Set root logger level to WARN and its only appender to CONSOLE
log4j.rootLogger=OFF, CONSOLE
# log4j properties to work with commandline tools.
log4j.category.org.mortbay=OFF
log4j.category.org.hibernate.type=OFF
log4j.category.org.objectweb=OFF
log4j.category.org.apache.ode.axis2=OFF
log4j.category.org.apache.ode.bpel.engine=OFF
log4j.category.org.apache.ode.daohib.bpel.CorrelatorDaoImpl=OFF
log4j.category.org.apache.ode.bpel.epr=OFF
log4j.category.org.apache.tuscany.sca.implementation.bpel=DEBUG
log4j.category.org.apache.tuscany.sca.implementation.bpel.ode=DEBUG
log4j.category.org.apache.tuscany.sca.implementation.bpel.provider=DEBUG
# Console appender
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%p] - %C{1}.%M(%L) | %m%n

View file

@ -0,0 +1,162 @@
<?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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>itest-bpel</artifactId>
<version>1.6-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>itest-bpel-helloworld</artifactId>
<name>Apache Tuscany SCA iTest HelloWorld BPEL</name>
<repositories>
<repository>
<id>apache.incubator</id>
<url>http://people.apache.org/repo/m2-incubating-repository</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-host-embedded</artifactId>
<version>1.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-implementation-java-runtime</artifactId>
<version>1.6-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-implementation-bpel-ode</artifactId>
<version>1.6-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sdo</groupId>
<artifactId>tuscany-sdo-impl</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>${artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<!-- http://jira.codehaus.org/browse/SUREFIRE-322 -->
<version>2.3.1</version>
<configuration>
<useFile>false</useFile>
<trimStackTrace>false</trimStackTrace>
<useSystemClassLoader>true</useSystemClassLoader>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>test-compile</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.ode</groupId>
<artifactId>ode-dao-jpa-ojpa-derby</artifactId>
<version>1.1</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/test-classes/</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tuscany.sdo</groupId>
<artifactId>tuscany-sdo-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>generate-bpel-helloworld</id>
<phase>generate-sources</phase>
<configuration>
<schemaFile>${basedir}/src/test/resources/helloworld/helloworld.wsdl</schemaFile>
<targetDirectory>${basedir}/target/wsdl2java-source</targetDirectory>
<prefix>HelloWorld</prefix>
<noNotification>true</noNotification>
<noContainer>true</noContainer>
<noUnsettable>true</noUnsettable>
</configuration>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-maven-wsdl2java</artifactId>
<version>1.6-SNAPSHOT</version>
<executions>
<execution>
<configuration>
<wsdlFiles>
<wsdlFile>
<fileName>${basedir}/src/test/resources/helloworld/helloworld.wsdl</fileName>
</wsdlFile>
</wsdlFiles>
</configuration>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,45 @@
/*
* 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 helloworld;
import org.apache.tuscany.implementation.bpel.example.helloworld.HelloPortType;
import org.osoa.sca.annotations.Reference;
/**
* @version $Rev$ $Date$
*/
public class HelloWorld {
private HelloPortType helloService;
public HelloWorld() {
super();
}
@Reference
public void setHelloService(HelloPortType helloService){
this.helloService = helloService;
}
public String hello(String hello) throws java.rmi.RemoteException {
System.out.println(">>> Invoking helloService.hello with : " + hello);
return this.helloService.hello(hello);
}
}

View file

@ -0,0 +1,63 @@
/*
* 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 helloworld;
import junit.framework.TestCase;
import org.apache.tuscany.implementation.bpel.example.helloworld.HelloPortType;
import org.apache.tuscany.sca.host.embedded.SCADomain;
/**
* Tests the BPEL Helloworld Service
*
* @version $Rev$ $Date$
*/
public class HelloWorldTestCase extends TestCase {
private SCADomain scaDomain;
/**
* @throws java.lang.Exception
*/
@Override
protected void setUp() throws Exception {
scaDomain = SCADomain.newInstance("helloworld/helloworld.composite");
}
/**
* @throws java.lang.Exception
*/
@Override
protected void tearDown() throws Exception {
scaDomain.close();
}
public void testServiceInvocation() throws Exception {
HelloPortType bpelService = scaDomain.getService(HelloPortType.class, "BPELHelloWorldService");
String response = bpelService.hello("Hello");
assertEquals("Hello World", response);
}
public void testReferenceInvocation() throws Exception {
HelloWorld bpelService = scaDomain.getService(HelloWorld.class, "BPELHelloWorld");
String response = bpelService.hello("Hello");
assertEquals("Hello World", response);
}
}

View file

@ -0,0 +1,66 @@
<!--
~ 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="HelloWorld"
targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld"
xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:test="http://tuscany.apache.org/implementation/bpel/example/helloworld.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="helloworld.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"
namespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"/>
<partnerLinks>
<partnerLink name="helloPartnerLink" partnerLinkType="test:HelloPartnerLinkType" myRole="me" />
</partnerLinks>
<variables>
<variable name="helloMessage" messageType="test:HelloMessage"/>
<variable name="tmpVar" type="xsd:string"/>
</variables>
<sequence>
<receive
name="start"
partnerLink="helloPartnerLink"
portType="test:HelloPortType"
operation="hello"
variable="helloMessage"
createInstance="yes"/>
<assign name="assign1">
<copy>
<from variable="helloMessage" part="TestPart"/>
<to variable="tmpVar"/>
</copy>
<copy>
<from>concat($tmpVar,' World')</from>
<to variable="helloMessage" part="TestPart"/>
</copy>
</assign>
<reply name="end"
partnerLink="helloPartnerLink"
portType="test:HelloPortType"
operation="hello"
variable="helloMessage"/>
</sequence>
</process>

View file

@ -0,0 +1,36 @@
<?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.
-->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://bpel"
xmlns:hns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
name="helloworld">
<component name="BPELHelloWorld">
<implementation.java class="helloworld.HelloWorld"/>
<reference name="helloService" target="BPELHelloWorldService">
<!-- Workaround for databinding issue -->
<!-- interface.wsdl interface="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl#wsdl.interface(HelloPortType)" / -->
</reference>
</component>
<component name="BPELHelloWorldService">
<implementation.bpel process="hns:HelloWorld"/>
</component>
</composite>

View file

@ -0,0 +1,82 @@
<?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 name="helloworld"
targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
<wsdl:types>
<schema elementFormDefault="qualified"
targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="hello">
<complexType>
<sequence>
<element name="message" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="HelloMessage">
<wsdl:part element="tns:hello" name="TestPart"/>
</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">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="hello">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="TestIn">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="TestOut">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HelloService">
<wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
<soap:address location="http://localhost:8085/ode/processes/helloWorld"/>
</wsdl:port>
</wsdl:service>
<plnk:partnerLinkType name="HelloPartnerLinkType">
<plnk:role name="me" portType="tns:HelloPortType"/>
<plnk:role name="you" portType="tns:HelloPortType"/>
</plnk:partnerLinkType>
</wsdl:definitions>

View file

@ -0,0 +1,36 @@
#
# 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.
#
# Set root logger level to WARN and its only appender to CONSOLE
log4j.rootLogger=OFF, CONSOLE
# log4j properties to work with commandline tools.
log4j.category.org.mortbay=OFF
log4j.category.org.hibernate.type=OFF
log4j.category.org.objectweb=OFF
log4j.category.org.apache.ode.axis2=OFF
log4j.category.org.apache.ode.bpel.engine=OFF
log4j.category.org.apache.ode.daohib.bpel.CorrelatorDaoImpl=OFF
log4j.category.org.apache.ode.bpel.epr=OFF
log4j.category.org.apache.tuscany.sca.implementation.bpel=DEBUG
log4j.category.org.apache.tuscany.sca.implementation.bpel.ode=DEBUG
log4j.category.org.apache.tuscany.sca.implementation.bpel.provider=DEBUG
# Console appender
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%p] - %C{1}.%M(%L) | %m%n

View file

@ -0,0 +1,37 @@
<?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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-itest</artifactId>
<version>1.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>itest-bpel</artifactId>
<packaging>pom</packaging>
<name>Apache Tuscany SCA BPEL Integration Tests</name>
<modules>
<module>helloworld</module>
<module>helloworld-ws</module>
<module>helloworld-reference</module>
</modules>
</project>