#! /bin/bash

#############################################################################
# Copyright 2005, 2006, 2007 Niels Lohmann                                  #
#                                                                           #
# 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/04/20 10:33:12 $ by $Author: nielslohmann $.
# Version $Revision: 1.11 $

echo ""

echo "test: reading WS-BPEL 2.0 executable process (auctionService)"
bpel2owfn --input=$testdir/testfiles/auctionService.bpel &> /dev/null
result1=$?

echo "test: reading WS-BPEL 2.0 executable process (loanApprovalProcess)"
bpel2owfn --input=$testdir/testfiles/loanApprovalProcess.bpel &> /dev/null
result2=$?

echo "test: reading WS-BPEL 2.0 executable process (purchaseOrderProcess)"
bpel2owfn --input=$testdir/testfiles/purchaseOrderProcess.bpel &> /dev/null
result3=$?

echo "test: reading WS-BPEL 2.0 abstract process (OrderingServiceProcess)"
bpel2owfn --input=$testdir/testfiles/OrderingServiceProcess.bpel &> /dev/null
result4=$?

echo "test: reading WS-BPEL 2.0 abstract process (shippingService)"
bpel2owfn --input=$testdir/testfiles/shippingService.bpel &> /dev/null
result5=$?

echo "test: reading BPEL4WS 1.1 executable process (loanApprovalProcess)"
bpel2owfn --input=$testdir/testfiles/loan.bpel &> /dev/null
result6=$?

echo "test: reading BPEL4WS 1.1 executable process (purchaseOrderProcess)"
bpel2owfn --input=$testdir/testfiles/purchase.bpel &> /dev/null
result7=$?

echo "test: reading BPEL4WS 1.1 abstract process (shippingService)"
bpel2owfn --input=$testdir/testfiles/shipping.bpel &> /dev/null
result8=$?

if test \( $result1 -eq 0 -a $result2 -eq 0 -a $result3 -eq 0 -a $result4 -eq 0 -a $result5 -eq 0 -a $result6 -eq 0 -a $result7 -eq 0 -a $result8 -eq 0 \)
then
  result=0
else
  result=1
fi

exit $result
