#! /bin/sh

# run examples alltogether with only 1 jonas server

##### run the JOnAS Server
echo; echo "---> run the JOnAS Server"; echo
cd $JONAS_ROOT/examples/src
rm -f server0.audit order.txt
jonas start

##### Put example classes in CLASSPATH
export CLASSPATH=$CLASSPATH:$JONAS_ROOT/examples/classes

##### run message receptor for JMS test
echo; echo "---> run message receptor for JMS test"; echo
xterm -title "JMS MsgReceptor" -sb  -geometry 80x10 -e jclient jms.MsgReceptor &

##### sb
echo; echo "---> sb"; echo
jonas admin -a sb.jar
jclient sb.ClientOp

##### eb (cmp1 | cmp2 | explicit)
echo; echo "---> eb"; echo
cd $JONAS_ROOT/examples/src/eb
ant init_db
jonas admin -a eb.jar
jclient eb.ClientAccount AccountImplHome
jclient eb.ClientAccount AccountImpl2Home
jclient eb.ClientAccount AccountExplHome

##### jms
echo; echo "---> jms"; echo
jonas admin -a jms.jar
jclient jms.EjbCompClient

##### lb
echo; echo "---> lb"; echo
jonas admin -a lb.jar
jclient lb.Client


##### sampleappli
echo; echo "---> sampleappli"; echo
jonas admin -a sampleappli.jar
jclient sampleappli.SampleAppliClient

##### samplemdb
echo; echo "---> samplemdb"; echo
jonas admin -a samplemdb.jar
jclient samplemdb.MdbClient
jonas admin -r samplemdb.jar

##### stop all servers
echo; echo "---> stop all servers"; echo
jonas stop
echo "End of Test."
echo "You can kill JMS MsgReceptor now."
