#! /bin/bash

#############################################################################
# Copyright 2005, 2006 Niels Lohmann, Christian Gierds                      #
#                                                                           #
# This file is part of GNU BPEL2oWFN.                                       #
#                                                                           #
# 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 2 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; see file COPYING. if not, write to the Free Software  #
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. #
#############################################################################

# File last changed $Date: 2007/06/04 13:06:11 $ by $Author: nielslohmann $.
# Version $Revision: 1.10 $

echo ""

echo "test: choreography mode"
echo "customer 1"
bpel2owfn --input=$testdir/consistency/coffee.bpel --input=$testdir/consistency/customer1.bpel --mode=choreography --format=lola --parameter=communicationonly --parameter=reduce --output=coffee_customer1 &> /dev/null
result1=$?

echo "customer 2"
bpel2owfn --input=$testdir/consistency/coffee.bpel --input=$testdir/consistency/customer2.bpel --mode=choreography --format=lola --parameter=communicationonly --parameter=reduce --output=coffee_customer2 &> /dev/null
result2=$?

echo "customer 3"
bpel2owfn --input=$testdir/consistency/coffee.bpel --input=$testdir/consistency/customer3.bpel --mode=choreography --format=lola --parameter=communicationonly --parameter=reduce --output=coffee_customer3 &> /dev/null
result3=$?

if test \( $result1 -eq 0 -a $result2 -eq 0 -a $result3 -eq 0 \) \
	-a \( -f coffee_customer1.lola -a -f coffee_customer1.task \) \
	-a \( -f coffee_customer2.lola -a -f coffee_customer2.task \) \
	-a \( -f coffee_customer3.lola -a -f coffee_customer3.task \)
then
  result=0
else
  result=1
fi

exit $result
