#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code 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
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# @test
# @bug 7056731
# @summary Race condition in CORBA code causes re-use of ABORTed connections
#
# @run shell 7056731.sh
#
PS=":"
FS="/"
;;
PS=";"
FS="\\"
;;
* )
echo "Unrecognized system!"
exit 1;
;;
esac
if [ "${TESTJAVA}" = "" ] ; then
echo "TESTJAVA not set. Test cannot execute. Failed."
exit 1
fi
JAVA="${TESTJAVA}${FS}bin${FS}java"
PORT=1052
echo "Testing...please wait"
echo "starting orbd"
ORB_PROC=$!
echo "started orb"
echo "starting server"
SERVER_PROC=$!
echo "started server"
echo "starting client (debug mode)"
${TESTJAVA}${FS}bin${FS}java -cp . -agentlib:jdwp=transport=dt_socket,server=y,address=8000 HelloClient -ORBInitialPort $PORT -ORBInitialHost localhost > client.$$ 2>&1 &
JVM_PROC=$!
echo "started client (debug mode)"
echo "starting debugger and issuing commands"
(sleep 2;
sleep 2;
echo "run";
sleep 2;
echo "cont";
sleep 2;
echo "cont";
sleep 2;
echo "cont";
sleep 2;
echo "suspend 1";
sleep 2;
kill -9 $SERVER_PROC &> /dev/null;
sleep 2;
echo "cont";
sleep 2;
echo "thread 1"
sleep 2;
sleep 2;
echo "resume 1";
# JVM_PROC should have exited but just in case, include it.
result=$?
then
echo "Failed"
exitCode=1;
else
echo "Passed"
exitCode=0
fi
#jtreg complaining about not being able to clean up; let's sleep
sleep 2
sleep 2
exit ${exitCode}