Author: alex.guizar(a)jboss.com
Date: 2009-11-26 22:32:13 -0500 (Thu, 26 Nov 2009)
New Revision: 342
Added:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELAtmTestCase.java
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELPurchaseTestCase.java
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELTravelAgencyTestCase.java
trunk/integration-tests/src/test/resources/samples/Tutorial_bpel_atm/
trunk/integration-tests/src/test/resources/samples/Tutorial_bpel_purchase/
trunk/integration-tests/src/test/resources/samples/Tutorial_bpel_travel_agency/
trunk/samples/tutorial/
trunk/samples/tutorial/atm/
trunk/samples/tutorial/purchase/
trunk/samples/tutorial/travel_agency/
Removed:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELAtmTestCase.java
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELPurchaseTestCase.java
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELTravelAgencyTestCase.java
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_atm/
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_purchase/
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_travel_agency/
trunk/samples/quickstart/atm/
trunk/samples/quickstart/purchase/
trunk/samples/quickstart/travel_agency/
Modified:
trunk/integration-tests/build.xml
trunk/integration-tests/pom.xml
trunk/integration-tests/src/test/resources/samples/Tutorial_bpel_atm/build.xml
trunk/integration-tests/src/test/resources/samples/Tutorial_bpel_purchase/build.xml
trunk/integration-tests/src/test/resources/samples/Tutorial_bpel_travel_agency/build.xml
Log:
RIFTSAW-34: rename comprehensive examples to Tutorial*
Modified: trunk/integration-tests/build.xml
===================================================================
--- trunk/integration-tests/build.xml 2009-11-26 17:40:48 UTC (rev 341)
+++ trunk/integration-tests/build.xml 2009-11-27 03:32:13 UTC (rev 342)
@@ -122,13 +122,14 @@
<ant
antfile="src/test/resources/samples/Quickstart_bpel_simple_correlation/build.xml"
/>
<ant
antfile="src/test/resources/samples/Quickstart_bpel_simple_invoke/build.xml"
/>
<ant
antfile="src/test/resources/samples/Quickstart_bpel_loan_approval/build.xml"
/>
- <ant antfile="src/test/resources/samples/Quickstart_bpel_atm/build.xml"
/>
- <ant
antfile="src/test/resources/samples/Quickstart_bpel_purchase/build.xml" />
- <ant
antfile="src/test/resources/samples/Quickstart_bpel_travel_agency/build.xml"
/>
<ant
antfile="src/test/resources/samples/Quickstart_esb_bpel_hello_world/build.xml"
/>
<ant
antfile="src/test/resources/samples/Quickstart_esb_bpel_loan_fault/build.xml"
/>
+ <ant antfile="src/test/resources/samples/Tutorial_bpel_atm/build.xml"
/>
+ <ant antfile="src/test/resources/samples/Tutorial_bpel_purchase/build.xml"
/>
+ <ant
antfile="src/test/resources/samples/Tutorial_bpel_travel_agency/build.xml"
/>
+
<ant antfile="src/test/resources/testcases/RiftSaw_118/build.xml" />
</target>
Modified: trunk/integration-tests/pom.xml
===================================================================
--- trunk/integration-tests/pom.xml 2009-11-26 17:40:48 UTC (rev 341)
+++ trunk/integration-tests/pom.xml 2009-11-27 03:32:13 UTC (rev 342)
@@ -1,6 +1,5 @@
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.soa.bpel</groupId>
<artifactId>integration-tests</artifactId>
@@ -8,32 +7,32 @@
<version>2.0-SNAPSHOT</version>
<name>RiftSaw::Integration-Tests</name>
- <parent>
- <groupId>org.jboss.soa</groupId>
+ <parent>
+ <groupId>org.jboss.soa</groupId>
<artifactId>bpel</artifactId>
<version>2.0-SNAPSHOT</version>
</parent>
-
- <properties>
- <jboss.jbosssx.version>2.0.2.SP3</jboss.jbosssx.version>
- <jboss.common.version>1.2.1.GA</jboss.common.version>
- <jboss.version>5.1.0.GA</jboss.version>
- </properties>
+ <properties>
+ <jboss.jbosssx.version>2.0.2.SP3</jboss.jbosssx.version>
+ <jboss.common.version>1.2.1.GA</jboss.common.version>
+ <jboss.version>5.1.0.GA</jboss.version>
+ </properties>
+
<dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.1</version>
- <scope>test</scope>
- </dependency>
-
<dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.soa.bpel.dependencies.esb</groupId>
<artifactId>jbossesb-rosetta</artifactId>
<version>${jbossesb.version}</version>
@@ -68,18 +67,24 @@
<version>1.0.1</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-client</artifactId>
- <version>${jboss.version}</version>
- <type>pom</type>
- <scope>test</scope>
- </dependency>
<dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-client</artifactId>
+ <version>${jboss.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.ws.scout</groupId>
<artifactId>scout</artifactId>
<version>1.1</version>
<scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
@@ -142,161 +147,155 @@
<version>2.1.0.GA</version>
<scope>test</scope>
</dependency>
-
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.3</version>
- <executions>
- <execution>
- <id>deploy-riftsaw</id>
- <phase>pre-integration-test</phase>
- <configuration>
- <tasks>
- <property name="compile_classpath"
refid="maven.compile.classpath" />
- <property name="runtime_classpath"
refid="maven.runtime.classpath" />
- <property name="test_classpath"
refid="maven.test.classpath" />
- <property name="plugin_classpath"
refid="maven.plugin.classpath" />
- <property name="project.version"
value="${project.version}" />
- <property name="riftsaw.engine.version"
- value="${riftsaw.engine.version}" />
- <property name="dependency.bpel.deployer"
-
value="${maven.dependency.org.jboss.soa.bpel.runtime.deployer.jar.path}" />
- <property name="dependency.bpel.engine"
-
value="${maven.dependency.org.jboss.soa.bpel.runtime.engine.jar.path}" />
- <property name="dependency.bpel.jb-bpel-store"
-
value="${maven.dependency.org.jboss.soa.bpel.runtime.jb-bpel-store.jar.path}"
/>
- <ant antfile="${basedir}/build.xml">
- <target name="unpack-distribution" />
- </ant>
- <ant antfile="${basedir}/build.xml">
- <target name="package-tests" />
- </ant>
-
- <ant antfile="${basedir}/build.xml">
- <target name="deploy-riftsaw" />
- </ant>
- <ant antfile="${basedir}/build.xml">
- <target name="start-server" />
- </ant>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- <execution>
- <id>undeploy-riftsaw</id>
- <phase>post-integration-test</phase>
- <configuration>
- <tasks>
- <property name="compile_classpath"
refid="maven.compile.classpath" />
- <property name="runtime_classpath"
refid="maven.runtime.classpath" />
- <property name="test_classpath"
refid="maven.test.classpath" />
- <property name="plugin_classpath"
refid="maven.plugin.classpath" />
- <property name="project.version"
value="${project.version}" />
- <property name="riftsaw.engine.version"
- value="${riftsaw.engine.version}" />
- <property name="dependency.bpel.deployer"
-
value="${maven.dependency.org.jboss.soa.bpel.runtime.deployer.jar.path}" />
- <property name="dependency.bpel.engine"
-
value="${maven.dependency.org.jboss.soa.bpel.runtime.engine.jar.path}" />
- <property name="dependency.bpel.jb-bpel-store"
-
value="${maven.dependency.org.jboss.soa.bpel.runtime.jb-bpel-store.jar.path}"
/>
- <ant antfile="${basedir}/build.xml">
- <target name="stop-server" />
- </ant>
- <ant antfile="${basedir}/build.xml">
- <target name="undeploy-riftsaw" />
- </ant>
- <!--
- -->
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <executions>
- <execution>
- <id>compiler-it</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>testCompile</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <additionalClasspathElements>
-
<additionalClasspathElement>${basedir}/src/test/resources/conf</additionalClasspathElement>
- </additionalClasspathElements>
- <systemProperties>
- <property>
- <name>test.dir</name>
- <value>${basedir}/target/tests</value>
- </property>
- <property>
- <name>java.naming.factory.initial</name>
- <value>org.jnp.interfaces.NamingContextFactory</value>
- </property>
- <property>
- <name>java.naming.factory.url.pkgs</name>
- <value>org.jboss.naming:org.jnp.interfaces</value>
- </property>
- <property>
- <name>java.naming.provider.url</name>
- <value>jnp://localhost:1099</value>
- </property>
- <property>
- <name>java.rmi.server.ignoreStubClasses</name>
- <value>true</value>
- </property>
- </systemProperties>
- <testFailureIgnore>true</testFailureIgnore>
- <includes>
- <include>**/*TestCase.java</include>
- <include>**/*Test.java</include>
- </includes>
- <!--
https://jira.jboss.org/jira/browse/RIFTSAW-34 -->
- <excludes>
-
<exclude>org/jboss/soa/bpel/tests/samples/QuickstartBPELAtmTestCase.java</exclude>
-
<exclude>org/jboss/soa/bpel/tests/samples/QuickstartBPELPurchaseTestCase.java</exclude>
-
<exclude>org/jboss/soa/bpel/tests/samples/QuickstartBPELTravelAgencyTestCase.java</exclude>
- </excludes>
- </configuration>
- <executions>
- <execution>
- <id>test-riftsaw</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-report-plugin</artifactId>
- </plugin>
- </plugins>
- </reporting>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.3</version>
+ <executions>
+ <execution>
+ <id>deploy-riftsaw</id>
+ <phase>pre-integration-test</phase>
+ <configuration>
+ <tasks>
+ <property name="compile_classpath"
refid="maven.compile.classpath" />
+ <property name="runtime_classpath"
refid="maven.runtime.classpath" />
+ <property name="test_classpath"
refid="maven.test.classpath" />
+ <property name="plugin_classpath"
refid="maven.plugin.classpath" />
+ <property name="project.version"
value="${project.version}" />
+ <property name="riftsaw.engine.version"
value="${riftsaw.engine.version}" />
+ <property name="dependency.bpel.deployer"
+ value="${maven.dependency.org.jboss.soa.bpel.runtime.deployer.jar.path}"
/>
+ <property name="dependency.bpel.engine"
+ value="${maven.dependency.org.jboss.soa.bpel.runtime.engine.jar.path}"
/>
+ <property name="dependency.bpel.jb-bpel-store"
+ value="${maven.dependency.org.jboss.soa.bpel.runtime.jb-bpel-store.jar.path}"
/>
+ <ant antfile="${basedir}/build.xml">
+ <target name="unpack-distribution" />
+ </ant>
+ <ant antfile="${basedir}/build.xml">
+ <target name="package-tests" />
+ </ant>
+ <ant antfile="${basedir}/build.xml">
+ <target name="deploy-riftsaw" />
+ </ant>
+ <ant antfile="${basedir}/build.xml">
+ <target name="start-server" />
+ </ant>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>undeploy-riftsaw</id>
+ <phase>post-integration-test</phase>
+ <configuration>
+ <tasks>
+ <property name="compile_classpath"
refid="maven.compile.classpath" />
+ <property name="runtime_classpath"
refid="maven.runtime.classpath" />
+ <property name="test_classpath"
refid="maven.test.classpath" />
+ <property name="plugin_classpath"
refid="maven.plugin.classpath" />
+ <property name="project.version"
value="${project.version}" />
+ <property name="riftsaw.engine.version"
value="${riftsaw.engine.version}" />
+ <property name="dependency.bpel.deployer"
+ value="${maven.dependency.org.jboss.soa.bpel.runtime.deployer.jar.path}"
/>
+ <property name="dependency.bpel.engine"
+ value="${maven.dependency.org.jboss.soa.bpel.runtime.engine.jar.path}"
/>
+ <property name="dependency.bpel.jb-bpel-store"
+ value="${maven.dependency.org.jboss.soa.bpel.runtime.jb-bpel-store.jar.path}"
/>
+ <ant antfile="${basedir}/build.xml">
+ <target name="stop-server" />
+ </ant>
+ <ant antfile="${basedir}/build.xml">
+ <target name="undeploy-riftsaw" />
+ </ant>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>compiler-it</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <additionalClasspathElements>
+ <additionalClasspathElement>${basedir}/src/test/resources/conf</additionalClasspathElement>
+ </additionalClasspathElements>
+ <systemProperties>
+ <property>
+ <name>test.dir</name>
+ <value>${basedir}/target/tests</value>
+ </property>
+ <property>
+ <name>java.naming.factory.initial</name>
+ <value>org.jnp.interfaces.NamingContextFactory</value>
+ </property>
+ <property>
+ <name>java.naming.factory.url.pkgs</name>
+ <value>org.jboss.naming:org.jnp.interfaces</value>
+ </property>
+ <property>
+ <name>java.naming.provider.url</name>
+ <value>jnp://localhost:1099</value>
+ </property>
+ <property>
+ <name>java.rmi.server.ignoreStubClasses</name>
+ <value>true</value>
+ </property>
+ </systemProperties>
+ <testFailureIgnore>true</testFailureIgnore>
+ <includes>
+ <include>**/*TestCase.java</include>
+ <include>**/*Test.java</include>
+ </includes>
+ <!--
https://jira.jboss.org/jira/browse/RIFTSAW-34 -->
+ <excludes>
+ <exclude>org/jboss/soa/bpel/tests/samples/TutorialBPELAtmTestCase.java</exclude>
+ <exclude>org/jboss/soa/bpel/tests/samples/TutorialBPELPurchaseTestCase.java</exclude>
+ <exclude>org/jboss/soa/bpel/tests/samples/TutorialBPELTravelAgencyTestCase.java</exclude>
+ </excludes>
+ </configuration>
+ <executions>
+ <execution>
+ <id>test-riftsaw</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
</project>
Deleted:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELAtmTestCase.java
===================================================================
---
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELAtmTestCase.java 2009-11-26
17:40:48 UTC (rev 341)
+++
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELAtmTestCase.java 2009-11-27
03:32:13 UTC (rev 342)
@@ -1,193 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.soa.bpel.tests.samples;
-
-import junit.framework.Test;
-
-import org.jboss.soa.bpel.tests.RiftSawTest;
-import org.jboss.soa.bpel.tests.RiftSawTestSetup;
-import org.jboss.soa.bpel.tests.samples.atm.AtmService;
-import org.jboss.soa.bpel.tests.samples.atm.FrontEnd;
-import org.jboss.soa.bpel.tests.samples.atm.InsufficientFunds;
-import org.jboss.soa.bpel.tests.samples.atm.InsufficientFunds_Exception;
-import org.jboss.soa.bpel.tests.samples.atm.UnauthorizedAccess_Exception;
-
-/**
- * Test for common ATM usage scenarios.
- *
- * @author Juan Cantu
- * @author Alejandro Guizar
- */
-public class QuickstartBPELAtmTestCase extends RiftSawTest {
-
- private FrontEnd frontEnd;
-
- private static final String TEST_NAME = "Quickstart_bpel_atm";
-
- public QuickstartBPELAtmTestCase() {
- super(TEST_NAME);
- }
-
- public static Test suite() {
- return new RiftSawTestSetup(QuickstartBPELAtmTestCase.class, TEST_NAME,
- "Quickstart_bpel_atm.war,Quickstart_bpel_atm-1.jar");
- }
-
- protected void setUp() throws Exception {
- AtmService frontEndService = new AtmService();
-
- // obtain dynamic proxy for web service port
- frontEnd = frontEndService.getFrontEndPort();
- }
-
- public void testConnect() {
- // connect to bank
- int ticketNumber = frontEnd.connect();
- assertTrue(ticketNumber > 0);
-
- // check atm is connected
- String status = frontEnd.status(ticketNumber);
- assertEquals("connected", status);
-
- // disconnect from bank
- frontEnd.disconnect(ticketNumber);
- }
-
- public void testLogOnAuthorized() {
- // connect to bank
- int ticketNumber = frontEnd.connect();
-
- // begin customer session
- final String customerName = "koen";
- try {
- frontEnd.logOn(ticketNumber, customerName);
- }
- catch (UnauthorizedAccess_Exception e) {
- fail("log on of authorized customer should succeed");
- }
-
- // end customer session
- frontEnd.logOff(customerName);
-
- // disconnect from bank
- frontEnd.disconnect(ticketNumber);
- }
-
- public void testLogOnUnauthorized() {
- // connect to bank
- int ticketNumber = frontEnd.connect();
-
- // begin customer session
- final String customerName = "nobody";
- try {
- frontEnd.logOn(ticketNumber, customerName);
- fail("log on of unauthorized customer should fail");
- }
- catch (UnauthorizedAccess_Exception e) {
- assertEquals(customerName, e.getFaultInfo().getCustomerName());
- }
-
- // disconnect from bank
- frontEnd.disconnect(ticketNumber);
- }
-
- public void testDeposit() throws UnauthorizedAccess_Exception {
- // connect to bank
- int ticketNumber = frontEnd.connect();
-
- // begin customer session
- final String customerName = "tom";
- frontEnd.logOn(ticketNumber, customerName);
-
- // get current balance
- double previousBalance = frontEnd.getBalance(customerName);
-
- // deposit some funds
- double newBalance = frontEnd.deposit(customerName, 10);
- // check the new balance is correct
- assertEquals(previousBalance + 10, newBalance, 0);
-
- // end customer session
- frontEnd.logOff(customerName);
-
- // disconnect from bank
- frontEnd.disconnect(ticketNumber);
- }
-
- public void testWithdrawUnderBalance() throws UnauthorizedAccess_Exception {
- // connect to bank
- int ticketNumber = frontEnd.connect();
-
- // begin customer session
- final String customerName = "tom";
- frontEnd.logOn(ticketNumber, customerName);
-
- // get current balance
- double previousBalance = frontEnd.getBalance(customerName);
-
- // withdraw some funds
- try {
- double newBalance = frontEnd.withdraw(customerName, 10);
- // check new balance is correct
- assertEquals(previousBalance - 10, newBalance, 0);
- }
- catch (InsufficientFunds_Exception e) {
- fail("withdraw under balance should succeed");
- }
-
- // end customer session
- frontEnd.logOff(customerName);
-
- // disconnect from bank
- frontEnd.disconnect(ticketNumber);
- }
-
- public void testWithdrawOverBalance() throws UnauthorizedAccess_Exception {
- // connect to bank
- int ticketNumber = frontEnd.connect();
-
- // begin customer session
- final String customerName = "fady";
- frontEnd.logOn(ticketNumber, customerName);
-
- // get current balance
- double previousBalance = frontEnd.getBalance(customerName);
-
- // try to withdraw an amount greater than current balance
- try {
- frontEnd.withdraw(customerName, previousBalance + 1);
- fail("withdraw over balance should fail");
- }
- catch (InsufficientFunds_Exception e) {
- InsufficientFunds faultInfo = e.getFaultInfo();
- assertEquals(customerName, faultInfo.getCustomerName());
- // check account balance has not changed
- assertEquals(previousBalance, faultInfo.getAmount(), 0);
- }
-
- // end customer session
- frontEnd.logOff(customerName);
-
- // disconnect from bank
- frontEnd.disconnect(ticketNumber);
- }
-}
\ No newline at end of file
Deleted:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELPurchaseTestCase.java
===================================================================
---
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELPurchaseTestCase.java 2009-11-26
17:40:48 UTC (rev 341)
+++
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELPurchaseTestCase.java 2009-11-27
03:32:13 UTC (rev 342)
@@ -1,107 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.soa.bpel.tests.samples;
-
-import junit.framework.Test;
-
-import org.jboss.soa.bpel.tests.RiftSawTest;
-import org.jboss.soa.bpel.tests.RiftSawTestSetup;
-import org.jboss.soa.bpel.tests.samples.purchase.CustomerInfo;
-import org.jboss.soa.bpel.tests.samples.purchase.Invoice;
-import org.jboss.soa.bpel.tests.samples.purchase.OrderFaultType;
-import org.jboss.soa.bpel.tests.samples.purchase.PurchaseOrder;
-import org.jboss.soa.bpel.tests.samples.purchase.PurchaseOrderPT;
-import org.jboss.soa.bpel.tests.samples.purchase.PurchaseSVC;
-
-/**
- * Test for common order purchasing scenarios.
- *
- * @author Jeff DeLong
- * @author Alejandro Guizar
- */
-public class QuickstartBPELPurchaseTestCase extends RiftSawTest {
-
- private PurchaseOrderPT purchaseOrderPT;
-
- private static final String TEST_NAME = "Quickstart_bpel_purchase";
-
- public QuickstartBPELPurchaseTestCase() {
- super(TEST_NAME);
- }
-
- public static Test suite() {
- return new RiftSawTestSetup(
- QuickstartBPELPurchaseTestCase.class,
- TEST_NAME,
- "Quickstart_bpel_purchase.war,Quickstart_bpel_purchase_ejb.jar,Quickstart_bpel_purchase-1.jar");
- }
-
- protected void setUp() throws Exception {
- PurchaseSVC service = new PurchaseSVC();
- purchaseOrderPT = service.getPurchaseOrderSP();
- }
-
- public void testSendPurchaseOrderAvailable() {
- CustomerInfo customerInfo = new CustomerInfo();
- customerInfo.setCustomerId("manager");
- customerInfo.setAddress("123 Main St");
-
- PurchaseOrder purchaseOrder = new PurchaseOrder();
- purchaseOrder.setOrderId(10);
- purchaseOrder.setPartNumber(23);
- purchaseOrder.setQuantity(4);
-
- try {
- Invoice invoice =
- purchaseOrderPT.sendPurchaseOrder(customerInfo, purchaseOrder);
- // In our system, the part number is also the unit price!
- // The shipper charges a flat fare of $9.50
- assertEquals(purchaseOrder.getPartNumber() * purchaseOrder.getQuantity()
- + 9.50, invoice.getAmount(), 0);
- assertEquals(purchaseOrder.getOrderId(), invoice.getOrderId());
- }
- catch (OrderFaultType e) {
- fail("shipping to available address should complete");
- }
- }
-
- public void testSendPurchaseOrderNotAvailable() {
- CustomerInfo customerInfo = new CustomerInfo();
- customerInfo.setCustomerId("freddy");
- customerInfo.setAddress("666 Elm St");
-
- PurchaseOrder purchaseOrder = new PurchaseOrder();
- purchaseOrder.setOrderId(20);
- purchaseOrder.setPartNumber(13);
- purchaseOrder.setQuantity(7);
-
- try {
- purchaseOrderPT.sendPurchaseOrder(customerInfo, purchaseOrder);
- fail("shipping to unavailable address should not complete");
- }
- catch (OrderFaultType e) {
- assertTrue(e.getFaultInfo()
- .getDetail()
- .indexOf(customerInfo.getAddress()) != -1);
- }
- }
-}
Deleted:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELTravelAgencyTestCase.java
===================================================================
---
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELTravelAgencyTestCase.java 2009-11-26
17:40:48 UTC (rev 341)
+++
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELTravelAgencyTestCase.java 2009-11-27
03:32:13 UTC (rev 342)
@@ -1,141 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.soa.bpel.tests.samples;
-
-import java.rmi.RemoteException;
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-
-import javax.xml.datatype.DatatypeFactory;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-import junit.framework.Test;
-
-import org.jboss.soa.bpel.tests.RiftSawTest;
-import org.jboss.soa.bpel.tests.RiftSawTestSetup;
-import org.jboss.soa.bpel.tests.samples.travel.Cancelation;
-import org.jboss.soa.bpel.tests.samples.travel.Detail;
-import org.jboss.soa.bpel.tests.samples.travel.Flight;
-import org.jboss.soa.bpel.tests.samples.travel.Hotel;
-import org.jboss.soa.bpel.tests.samples.travel.Invoice;
-import org.jboss.soa.bpel.tests.samples.travel.ItemSet;
-import org.jboss.soa.bpel.tests.samples.travel.Order;
-import org.jboss.soa.bpel.tests.samples.travel.Penalty;
-import org.jboss.soa.bpel.tests.samples.travel.Query;
-import org.jboss.soa.bpel.tests.samples.travel.RentalCar;
-import org.jboss.soa.bpel.tests.samples.travel.TravelAgent;
-import org.jboss.soa.bpel.tests.samples.travel.TravelService;
-
-/**
- * @author Alejandro Guizar
- */
-public class QuickstartBPELTravelAgencyTestCase extends RiftSawTest {
-
- private TravelAgent travelAgent;
-
- private Flight flight = new Flight();
- private Hotel hotel = new Hotel();
- private RentalCar car = new RentalCar();
- private XMLGregorianCalendar tripDate;
-
- private static final String TEST_NAME = "Quickstart_bpel_travel_agency";
-
- public QuickstartBPELTravelAgencyTestCase() {
- super(TEST_NAME);
- }
-
- public static Test suite() {
- return new RiftSawTestSetup(QuickstartBPELTravelAgencyTestCase.class,
- TEST_NAME,
- "Quickstart_bpel_travel_agency.war,Quickstart_bpel_travel_agency-1.jar");
- }
-
- protected void setUp() throws Exception {
- TravelService tripService = new TravelService();
- travelAgent = tripService.getTravelAgentPort();
-
- flight.setAirline("AM");
- flight.setNumber(637);
- hotel.setName("Maria Isabel");
- car.setCompany("Alamo");
-
- GregorianCalendar now = new GregorianCalendar();
- now.add(Calendar.SECOND, 10);
- tripDate = DatatypeFactory.newInstance().newXMLGregorianCalendar(now);
- }
-
- public void testPurchaseTrip() throws RemoteException {
- ItemSet items = new ItemSet();
- items.setFlight(flight); // cost: 300
- items.setHotel(hotel); // cost: 100
-
- Order order = new Order();
- order.setDate(tripDate);
- order.setItems(items);
-
- Invoice invoice = travelAgent.purchaseTrip(order);
- assertEquals(300 + 100, invoice.getCost(), 0);
- }
-
- public void testGetTripDetails() throws RemoteException {
- ItemSet items = new ItemSet();
- items.setFlight(flight);
- items.setHotel(hotel);
- items.setRentalCar(car);
-
- Order order = new Order();
- order.setDate(tripDate);
- order.setItems(items);
-
- Invoice invoice = travelAgent.purchaseTrip(order);
-
- Query query = new Query();
- query.setLocator(invoice.getLocator());
-
- Detail detail = travelAgent.getTripDetail(query);
- items = detail.getItems();
-
- assertEquals(flight.getAirline(), items.getFlight().getAirline());
- assertEquals(flight.getNumber(), items.getFlight().getNumber());
- assertEquals(hotel.getName(), items.getHotel().getName());
- assertEquals(car.getCompany(), items.getRentalCar().getCompany());
- assertEquals(invoice.getCost(), detail.getCost(), 0);
- }
-
- public void testCancelTrip() throws Exception {
- ItemSet items = new ItemSet();
- items.setFlight(flight); // fee: 100
- items.setRentalCar(car); // fee: 5
-
- Order order = new Order();
- order.setDate(tripDate);
- order.setItems(items);
-
- Invoice invoice = travelAgent.purchaseTrip(order);
-
- Cancelation reference = new Cancelation();
- reference.setLocator(invoice.getLocator());
-
- Penalty penalty = travelAgent.cancelTrip(reference);
- assertEquals(100 + 5, penalty.getFee(), 0);
- }
-}
Copied:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELAtmTestCase.java
(from rev 332,
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELAtmTestCase.java)
===================================================================
---
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELAtmTestCase.java
(rev 0)
+++
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELAtmTestCase.java 2009-11-27
03:32:13 UTC (rev 342)
@@ -0,0 +1,193 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.bpel.tests.samples;
+
+import junit.framework.Test;
+
+import org.jboss.soa.bpel.tests.RiftSawTest;
+import org.jboss.soa.bpel.tests.RiftSawTestSetup;
+import org.jboss.soa.bpel.tests.samples.atm.AtmService;
+import org.jboss.soa.bpel.tests.samples.atm.FrontEnd;
+import org.jboss.soa.bpel.tests.samples.atm.InsufficientFunds;
+import org.jboss.soa.bpel.tests.samples.atm.InsufficientFunds_Exception;
+import org.jboss.soa.bpel.tests.samples.atm.UnauthorizedAccess_Exception;
+
+/**
+ * Test for common ATM usage scenarios.
+ *
+ * @author Juan Cantu
+ * @author Alejandro Guizar
+ */
+public class TutorialBPELAtmTestCase extends RiftSawTest {
+
+ private FrontEnd frontEnd;
+
+ private static final String TEST_NAME = "Tutorial_bpel_atm";
+
+ public TutorialBPELAtmTestCase() {
+ super(TEST_NAME);
+ }
+
+ public static Test suite() {
+ return new RiftSawTestSetup(TutorialBPELAtmTestCase.class, TEST_NAME,
+ "Tutorial_bpel_atm.war,Tutorial_bpel_atm-1.jar");
+ }
+
+ protected void setUp() throws Exception {
+ AtmService frontEndService = new AtmService();
+
+ // obtain dynamic proxy for web service port
+ frontEnd = frontEndService.getFrontEndPort();
+ }
+
+ public void testConnect() {
+ // connect to bank
+ int ticketNumber = frontEnd.connect();
+ assertTrue(ticketNumber > 0);
+
+ // check atm is connected
+ String status = frontEnd.status(ticketNumber);
+ assertEquals("connected", status);
+
+ // disconnect from bank
+ frontEnd.disconnect(ticketNumber);
+ }
+
+ public void testLogOnAuthorized() {
+ // connect to bank
+ int ticketNumber = frontEnd.connect();
+
+ // begin customer session
+ final String customerName = "koen";
+ try {
+ frontEnd.logOn(ticketNumber, customerName);
+ }
+ catch (UnauthorizedAccess_Exception e) {
+ fail("log on of authorized customer should succeed");
+ }
+
+ // end customer session
+ frontEnd.logOff(customerName);
+
+ // disconnect from bank
+ frontEnd.disconnect(ticketNumber);
+ }
+
+ public void testLogOnUnauthorized() {
+ // connect to bank
+ int ticketNumber = frontEnd.connect();
+
+ // begin customer session
+ final String customerName = "nobody";
+ try {
+ frontEnd.logOn(ticketNumber, customerName);
+ fail("log on of unauthorized customer should fail");
+ }
+ catch (UnauthorizedAccess_Exception e) {
+ assertEquals(customerName, e.getFaultInfo().getCustomerName());
+ }
+
+ // disconnect from bank
+ frontEnd.disconnect(ticketNumber);
+ }
+
+ public void testDeposit() throws UnauthorizedAccess_Exception {
+ // connect to bank
+ int ticketNumber = frontEnd.connect();
+
+ // begin customer session
+ final String customerName = "tom";
+ frontEnd.logOn(ticketNumber, customerName);
+
+ // get current balance
+ double previousBalance = frontEnd.getBalance(customerName);
+
+ // deposit some funds
+ double newBalance = frontEnd.deposit(customerName, 10);
+ // check the new balance is correct
+ assertEquals(previousBalance + 10, newBalance, 0);
+
+ // end customer session
+ frontEnd.logOff(customerName);
+
+ // disconnect from bank
+ frontEnd.disconnect(ticketNumber);
+ }
+
+ public void testWithdrawUnderBalance() throws UnauthorizedAccess_Exception {
+ // connect to bank
+ int ticketNumber = frontEnd.connect();
+
+ // begin customer session
+ final String customerName = "tom";
+ frontEnd.logOn(ticketNumber, customerName);
+
+ // get current balance
+ double previousBalance = frontEnd.getBalance(customerName);
+
+ // withdraw some funds
+ try {
+ double newBalance = frontEnd.withdraw(customerName, 10);
+ // check new balance is correct
+ assertEquals(previousBalance - 10, newBalance, 0);
+ }
+ catch (InsufficientFunds_Exception e) {
+ fail("withdraw under balance should succeed");
+ }
+
+ // end customer session
+ frontEnd.logOff(customerName);
+
+ // disconnect from bank
+ frontEnd.disconnect(ticketNumber);
+ }
+
+ public void testWithdrawOverBalance() throws UnauthorizedAccess_Exception {
+ // connect to bank
+ int ticketNumber = frontEnd.connect();
+
+ // begin customer session
+ final String customerName = "fady";
+ frontEnd.logOn(ticketNumber, customerName);
+
+ // get current balance
+ double previousBalance = frontEnd.getBalance(customerName);
+
+ // try to withdraw an amount greater than current balance
+ try {
+ frontEnd.withdraw(customerName, previousBalance + 1);
+ fail("withdraw over balance should fail");
+ }
+ catch (InsufficientFunds_Exception e) {
+ InsufficientFunds faultInfo = e.getFaultInfo();
+ assertEquals(customerName, faultInfo.getCustomerName());
+ // check account balance has not changed
+ assertEquals(previousBalance, faultInfo.getAmount(), 0);
+ }
+
+ // end customer session
+ frontEnd.logOff(customerName);
+
+ // disconnect from bank
+ frontEnd.disconnect(ticketNumber);
+ }
+}
\ No newline at end of file
Copied:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELPurchaseTestCase.java
(from rev 332,
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELPurchaseTestCase.java)
===================================================================
---
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELPurchaseTestCase.java
(rev 0)
+++
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELPurchaseTestCase.java 2009-11-27
03:32:13 UTC (rev 342)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.bpel.tests.samples;
+
+import junit.framework.Test;
+
+import org.jboss.soa.bpel.tests.RiftSawTest;
+import org.jboss.soa.bpel.tests.RiftSawTestSetup;
+import org.jboss.soa.bpel.tests.samples.purchase.CustomerInfo;
+import org.jboss.soa.bpel.tests.samples.purchase.Invoice;
+import org.jboss.soa.bpel.tests.samples.purchase.OrderFaultType;
+import org.jboss.soa.bpel.tests.samples.purchase.PurchaseOrder;
+import org.jboss.soa.bpel.tests.samples.purchase.PurchaseOrderPT;
+import org.jboss.soa.bpel.tests.samples.purchase.PurchaseSVC;
+
+/**
+ * Test for common order purchasing scenarios.
+ *
+ * @author Jeff DeLong
+ * @author Alejandro Guizar
+ */
+public class TutorialBPELPurchaseTestCase extends RiftSawTest {
+
+ private PurchaseOrderPT purchaseOrderPT;
+
+ private static final String TEST_NAME = "Tutorial_bpel_purchase";
+
+ public TutorialBPELPurchaseTestCase() {
+ super(TEST_NAME);
+ }
+
+ public static Test suite() {
+ return new RiftSawTestSetup(
+ TutorialBPELPurchaseTestCase.class,
+ TEST_NAME,
+ "Tutorial_bpel_purchase.war,Tutorial_bpel_purchase_ejb.jar,Tutorial_bpel_purchase-1.jar");
+ }
+
+ protected void setUp() throws Exception {
+ PurchaseSVC service = new PurchaseSVC();
+ purchaseOrderPT = service.getPurchaseOrderSP();
+ }
+
+ public void testSendPurchaseOrderAvailable() {
+ CustomerInfo customerInfo = new CustomerInfo();
+ customerInfo.setCustomerId("manager");
+ customerInfo.setAddress("123 Main St");
+
+ PurchaseOrder purchaseOrder = new PurchaseOrder();
+ purchaseOrder.setOrderId(10);
+ purchaseOrder.setPartNumber(23);
+ purchaseOrder.setQuantity(4);
+
+ try {
+ Invoice invoice =
+ purchaseOrderPT.sendPurchaseOrder(customerInfo, purchaseOrder);
+ // In our system, the part number is also the unit price!
+ // The shipper charges a flat fare of $9.50
+ assertEquals(purchaseOrder.getPartNumber() * purchaseOrder.getQuantity()
+ + 9.50, invoice.getAmount(), 0);
+ assertEquals(purchaseOrder.getOrderId(), invoice.getOrderId());
+ }
+ catch (OrderFaultType e) {
+ fail("shipping to available address should complete");
+ }
+ }
+
+ public void testSendPurchaseOrderNotAvailable() {
+ CustomerInfo customerInfo = new CustomerInfo();
+ customerInfo.setCustomerId("freddy");
+ customerInfo.setAddress("666 Elm St");
+
+ PurchaseOrder purchaseOrder = new PurchaseOrder();
+ purchaseOrder.setOrderId(20);
+ purchaseOrder.setPartNumber(13);
+ purchaseOrder.setQuantity(7);
+
+ try {
+ purchaseOrderPT.sendPurchaseOrder(customerInfo, purchaseOrder);
+ fail("shipping to unavailable address should not complete");
+ }
+ catch (OrderFaultType e) {
+ assertTrue(e.getFaultInfo()
+ .getDetail()
+ .indexOf(customerInfo.getAddress()) != -1);
+ }
+ }
+}
Copied:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELTravelAgencyTestCase.java
(from rev 332,
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELTravelAgencyTestCase.java)
===================================================================
---
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELTravelAgencyTestCase.java
(rev 0)
+++
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELTravelAgencyTestCase.java 2009-11-27
03:32:13 UTC (rev 342)
@@ -0,0 +1,141 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.bpel.tests.samples;
+
+import java.rmi.RemoteException;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+import junit.framework.Test;
+
+import org.jboss.soa.bpel.tests.RiftSawTest;
+import org.jboss.soa.bpel.tests.RiftSawTestSetup;
+import org.jboss.soa.bpel.tests.samples.travel.Cancelation;
+import org.jboss.soa.bpel.tests.samples.travel.Detail;
+import org.jboss.soa.bpel.tests.samples.travel.Flight;
+import org.jboss.soa.bpel.tests.samples.travel.Hotel;
+import org.jboss.soa.bpel.tests.samples.travel.Invoice;
+import org.jboss.soa.bpel.tests.samples.travel.ItemSet;
+import org.jboss.soa.bpel.tests.samples.travel.Order;
+import org.jboss.soa.bpel.tests.samples.travel.Penalty;
+import org.jboss.soa.bpel.tests.samples.travel.Query;
+import org.jboss.soa.bpel.tests.samples.travel.RentalCar;
+import org.jboss.soa.bpel.tests.samples.travel.TravelAgent;
+import org.jboss.soa.bpel.tests.samples.travel.TravelService;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class TutorialBPELTravelAgencyTestCase extends RiftSawTest {
+
+ private TravelAgent travelAgent;
+
+ private Flight flight = new Flight();
+ private Hotel hotel = new Hotel();
+ private RentalCar car = new RentalCar();
+ private XMLGregorianCalendar tripDate;
+
+ private static final String TEST_NAME = "Tutorial_bpel_travel_agency";
+
+ public TutorialBPELTravelAgencyTestCase() {
+ super(TEST_NAME);
+ }
+
+ public static Test suite() {
+ return new RiftSawTestSetup(TutorialBPELTravelAgencyTestCase.class,
+ TEST_NAME,
+ "Tutorial_bpel_travel_agency.war,Tutorial_bpel_travel_agency-1.jar");
+ }
+
+ protected void setUp() throws Exception {
+ TravelService tripService = new TravelService();
+ travelAgent = tripService.getTravelAgentPort();
+
+ flight.setAirline("AM");
+ flight.setNumber(637);
+ hotel.setName("Maria Isabel");
+ car.setCompany("Alamo");
+
+ GregorianCalendar now = new GregorianCalendar();
+ now.add(Calendar.SECOND, 10);
+ tripDate = DatatypeFactory.newInstance().newXMLGregorianCalendar(now);
+ }
+
+ public void testPurchaseTrip() throws RemoteException {
+ ItemSet items = new ItemSet();
+ items.setFlight(flight); // cost: 300
+ items.setHotel(hotel); // cost: 100
+
+ Order order = new Order();
+ order.setDate(tripDate);
+ order.setItems(items);
+
+ Invoice invoice = travelAgent.purchaseTrip(order);
+ assertEquals(300 + 100, invoice.getCost(), 0);
+ }
+
+ public void testGetTripDetails() throws RemoteException {
+ ItemSet items = new ItemSet();
+ items.setFlight(flight);
+ items.setHotel(hotel);
+ items.setRentalCar(car);
+
+ Order order = new Order();
+ order.setDate(tripDate);
+ order.setItems(items);
+
+ Invoice invoice = travelAgent.purchaseTrip(order);
+
+ Query query = new Query();
+ query.setLocator(invoice.getLocator());
+
+ Detail detail = travelAgent.getTripDetail(query);
+ items = detail.getItems();
+
+ assertEquals(flight.getAirline(), items.getFlight().getAirline());
+ assertEquals(flight.getNumber(), items.getFlight().getNumber());
+ assertEquals(hotel.getName(), items.getHotel().getName());
+ assertEquals(car.getCompany(), items.getRentalCar().getCompany());
+ assertEquals(invoice.getCost(), detail.getCost(), 0);
+ }
+
+ public void testCancelTrip() throws Exception {
+ ItemSet items = new ItemSet();
+ items.setFlight(flight); // fee: 100
+ items.setRentalCar(car); // fee: 5
+
+ Order order = new Order();
+ order.setDate(tripDate);
+ order.setItems(items);
+
+ Invoice invoice = travelAgent.purchaseTrip(order);
+
+ Cancelation reference = new Cancelation();
+ reference.setLocator(invoice.getLocator());
+
+ Penalty penalty = travelAgent.cancelTrip(reference);
+ assertEquals(100 + 5, penalty.getFee(), 0);
+ }
+}
Copied: trunk/integration-tests/src/test/resources/samples/Tutorial_bpel_atm (from rev
332, trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_atm)
Modified: trunk/integration-tests/src/test/resources/samples/Tutorial_bpel_atm/build.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_atm/build.xml 2009-11-25
21:39:25 UTC (rev 332)
+++
trunk/integration-tests/src/test/resources/samples/Tutorial_bpel_atm/build.xml 2009-11-27
03:32:13 UTC (rev 342)
@@ -1,4 +1,4 @@
-<project name="Quickstart_bpel_atm" default="deploy"
basedir=".">
+<project name="Tutorial_bpel_atm" default="deploy"
basedir=".">
<description>${ant.project.name}</description>
Copied: trunk/integration-tests/src/test/resources/samples/Tutorial_bpel_purchase (from
rev 332, trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_purchase)
Modified:
trunk/integration-tests/src/test/resources/samples/Tutorial_bpel_purchase/build.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_purchase/build.xml 2009-11-25
21:39:25 UTC (rev 332)
+++
trunk/integration-tests/src/test/resources/samples/Tutorial_bpel_purchase/build.xml 2009-11-27
03:32:13 UTC (rev 342)
@@ -1,4 +1,4 @@
-<project name="Quickstart_bpel_purchase" default="deploy"
basedir=".">
+<project name="Tutorial_bpel_purchase" default="deploy"
basedir=".">
<description>${ant.project.name}</description>
Copied: trunk/integration-tests/src/test/resources/samples/Tutorial_bpel_travel_agency
(from rev 332,
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_travel_agency)
Modified:
trunk/integration-tests/src/test/resources/samples/Tutorial_bpel_travel_agency/build.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_travel_agency/build.xml 2009-11-25
21:39:25 UTC (rev 332)
+++
trunk/integration-tests/src/test/resources/samples/Tutorial_bpel_travel_agency/build.xml 2009-11-27
03:32:13 UTC (rev 342)
@@ -1,4 +1,4 @@
-<project name="Quickstart_bpel_travel_agency" default="deploy"
basedir=".">
+<project name="Tutorial_bpel_travel_agency" default="deploy"
basedir=".">
<description>${ant.project.name}</description>
Copied: trunk/samples/tutorial/atm (from rev 332, trunk/samples/quickstart/atm)
Copied: trunk/samples/tutorial/purchase (from rev 332, trunk/samples/quickstart/purchase)
Copied: trunk/samples/tutorial/travel_agency (from rev 332,
trunk/samples/quickstart/travel_agency)