#! /bin/bash

#############################################################################
# GNU BPEL2oWFN -- Translating BPEL Processes into Petri Net Models
#
# Copyright (C) 2006, 2007  Niels Lohmann,
#                           Christian Gierds, and
#                           Martin Znamirowski
# Copyright (C) 2005        Niels Lohmann and
#			    Christian Gierds
#
# GNU BPEL2oWFN is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option) any
# later version.
#
# GNU BPEL2oWFN 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 General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# GNU BPEL2oWFN; if not, see http://www.gnu.org/licenses or write to the Free
# Software Foundation,Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301  USA.
#############################################################################

# File last changed $Date: 2007/06/28 07:38:18 $ by $Author: nielslohmann $.
# Version $Revision: 1.5 $

echo ""

echo "test: BPEL4Chor"

echo "1 instance"
bpel2owfn --input=$testdir/bpel4chor/chor_paper_traveler.bpel --input=$testdir/bpel4chor/chor_paper_airline.bpel --input=$testdir/bpel4chor/chor_paper_traveler.bpel --topology=$testdir/bpel4chor/chor_paper_topology1.xml --mode=choreography --parameter=communicationonly --output=choreography1 --format=owfn &> /dev/null
result1=$?

echo "10 instances"
bpel2owfn --input=$testdir/bpel4chor/chor_paper_traveler.bpel --input=$testdir/bpel4chor/chor_paper_airline.bpel --input=$testdir/bpel4chor/chor_paper_traveler.bpel --topology=$testdir/bpel4chor/chor_paper_topology10.xml --mode=choreography --parameter=communicationonly --output=choreography10 --format=owfn &> /dev/null
result2=$?


if test \( $result1 -eq 0 -a $result2 -eq 0 \) -a \
	        \( -f choreography1.owfn -a -f choreography10.owfn \)
then
  result=0
else
  result=1
fi

exit $result
