. $OSPL_HOME/examples/functions

check_osplhome

stopOSPL

startOSPL

echo "=== Launching Lifecycle "

echo "=== (step 1)"

./subscriber > subResult_1.txt &
cmd_pid=$!
sleep 2
./publisher  false dispose > pubResult_1.txt

waitForProcessTermination $cmd_pid 30

stopOSPL

startOSPL

echo "=== (step 2)"

./subscriber > subResult_2.txt &
cmd_pid=$!
sleep 2
./publisher false unregister > pubResult_2.txt

waitForProcessTermination $cmd_pid 30

stopOSPL

startOSPL

echo "=== (step 3)"

./subscriber > subResult_3.txt &
cmd_pid=$!
sleep 2
./publisher false stoppub > pubResult_3.txt

waitForProcessTermination $cmd_pid 30

lifecycleCheckResult

stopOSPL
