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 31 if [ "${TESTJAVA}" = "" ] 32 then 33 echo "TESTJAVA not set. Test cannot execute. Failed." 34 exit 1 35 fi 36 echo "TESTJAVA=${TESTJAVA}" 37 38 if [ "${TESTSRC}" = "" ] 39 then 40 TESTSRC="." 41 fi 42 echo "TESTSRC=${TESTSRC}" 43 44 45 if [ "${TESTCLASSES}" = "" ] 46 then 47 TESTCLASSES="." 48 fi 49 echo "TESTCLASSES=${TESTCLASSES}" 50 51 # set platform-dependent variables 52 OS=`uname -s` 53 case "$OS" in 54 SunOS | Linux | Darwin | AIX ) 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 ;; 73 esac 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 80 if [ $? -ne 0 ]; then 81 exit 1 82 fi 83 84 ${TESTJAVA}${FS}bin${FS}java \ 85 ${TESTVMOPTS} \ 86 -Djava.security.properties=${TESTSRC}${FS}security.properties \ 87 -classpath "${TESTSRC}${FS}P1.jar${PS}${TESTSRC}${FS}P2.jar${PS}." \ 88 FailOverTest 89 result=$? 90 91 if [ $result -eq 0 ] 92 then 93 echo "Passed" 94 else 95 echo "Failed" 96 fi 97 exit $result