FailOverTest.sh revision 5116:d45bc4307996
1# 2# Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. 3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4# 5# This code is free software; you can redistribute it and/or modify it 6# under the terms of the GNU General Public License version 2 only, as 7# published by the Free Software Foundation. 8# 9# This code is distributed in the hope that it will be useful, but WITHOUT 10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12# version 2 for more details (a copy is included in the LICENSE file that 13# accompanied this code). 14# 15# You should have received a copy of the GNU General Public License version 16# 2 along with this work; if not, write to the Free Software Foundation, 17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18# 19# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20# or visit www.oracle.com if you need additional information or have any 21# questions. 22# 23 24# 25# @test 26# @bug 6370923 27# @summary SecretKeyFactory failover does not work 28# @author Brad R. Wetmore 29# 30 31if [ "${TESTJAVA}" = "" ] 32then 33 echo "TESTJAVA not set. Test cannot execute. Failed." 34 exit 1 35fi 36echo "TESTJAVA=${TESTJAVA}" 37 38if [ "${TESTSRC}" = "" ] 39then 40 TESTSRC="." 41fi 42echo "TESTSRC=${TESTSRC}" 43 44 45if [ "${TESTCLASSES}" = "" ] 46then 47 TESTCLASSES="." 48fi 49echo "TESTCLASSES=${TESTCLASSES}" 50 51# set platform-dependent variables 52OS=`uname -s` 53case "$OS" in 54 SunOS | Linux | Darwin ) 55 NULL=/dev/null 56 PS=":" 57 FS="/" 58 ;; 59 CYGWIN* ) 60 NULL=/dev/null 61 PS=";" 62 FS="/" 63 ;; 64 Windows* ) 65 NULL=NUL 66 PS=";" 67 FS="\\" 68 ;; 69 * ) 70 echo "Unrecognized system!" 71 exit 1; 72 ;; 73esac 74 75${TESTJAVA}${FS}bin${FS}javac \ 76 -d . \ 77 -classpath "${TESTSRC}${FS}P1.jar${PS}${TESTSRC}${FS}P2.jar" \ 78 ${TESTSRC}${FS}FailOverTest.java 79 80if [ $? -ne 0 ]; then 81 exit 1 82fi 83 84${TESTJAVA}${FS}bin${FS}java \ 85 -classpath "${TESTSRC}${FS}P1.jar${PS}${TESTSRC}${FS}P2.jar${PS}." \ 86 FailOverTest 87result=$? 88 89if [ $result -eq 0 ] 90then 91 echo "Passed" 92else 93 echo "Failed" 94fi 95exit $result 96