# launch the EJB servers
(echo $JAVA_OPTS | grep jonas.services >/dev/null) || export JAVA_OPTS="$JAVA_OPTS -Djonas.services=security,jtm,dbm,ejb"
jonas start -n jonas_1
jonas admin -n jonas_1 -a DB.jar
jonas admin -n jonas_1 -a Perfs_1.jar
jonas admin -n jonas_1 -a Perfs_2.jar
jonas admin -n jonas_1 -a Perfs2_3.jar
jonas start -n jonas_2
jonas admin -n jonas_2 -a Perfs_3.jar
jonas admin -n jonas_2 -a Perfs2_1.jar
jonas admin -n jonas_2 -a Perfs2_2.jar

XTRA_CLASSES=$JPROJ_BASE/jonas_tests/perfs/classes/$OBJECTWEB_ORB

# launch the clients
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -i
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b 400 -p 1 -r 1 -w 0 -n 1 -s 100 -h
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b 100 -p 1 -r 1 -w 0 -n 1 -s 100
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b 200 -p 1 -r 0 -w 1 -n 1 -s 100 -h
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b  40 -p 1 -r 0 -w 1 -n 1 -s 100
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b 200 -p 1 -r 5 -w 2 -n 1 -s 800 -h
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b  40 -p 1 -r 5 -w 2 -n 1 -s 800
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b 200 -p 1 -r 2 -w 2 -n 2 -s 100 -h
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b  40 -p 1 -r 2 -w 2 -n 2 -s 100
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b 200 -p 2 -r 4 -w 2 -n 3 -s 100 -h
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b  40 -p 2 -r 4 -w 2 -n 3 -s 100
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b 200 -p 3 -r 1 -w 1 -n 1 -s 100 -h
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b  40 -p 3 -r 1 -w 1 -n 1 -s 100

jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -i -cmp2
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b 400 -p 1 -r 1 -w 0 -n 1 -s 100 -h -cmp2
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b 100 -p 1 -r 1 -w 0 -n 1 -s 100 -cmp2
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b 200 -p 1 -r 0 -w 1 -n 1 -s 100 -h -cmp2
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b  40 -p 1 -r 0 -w 1 -n 1 -s 100 -cmp2
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b 200 -p 1 -r 5 -w 2 -n 1 -s 800 -h -cmp2
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b  40 -p 1 -r 5 -w 2 -n 1 -s 800 -cmp2
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b 200 -p 1 -r 2 -w 2 -n 2 -s 100 -h -cmp2
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b  40 -p 1 -r 2 -w 2 -n 2 -s 100 -cmp2
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b 200 -p 2 -r 4 -w 2 -n 3 -s 100 -h -cmp2
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b  40 -p 2 -r 4 -w 2 -n 3 -s 100 -cmp2
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b 200 -p 3 -r 1 -w 1 -n 1 -s 100 -h -cmp2
jclient -cp $XTRA_CLASSES applis.ejb.perfs.PerfsClient -b  40 -p 3 -r 1 -w 1 -n 1 -s 100 -cmp2

# kill des servers
jonas stop -n jonas_2
jonas stop -n jonas_1
