test/tools/javac/ProtectedInnerClass/ProtectedInnerClass.sh

Mon, 07 Jan 2013 17:51:05 +0000

author
jjh
date
Mon, 07 Jan 2013 17:51:05 +0000
changeset 1478
a9cb93cca229
parent 1305
9d47f4850714
permissions
-rw-r--r--

8005647: langtools/test/tools/javap/MethodParameters.java fails on windows
Summary: Fix javap to not output \r\r\n
Reviewed-by: jjg

     1 #
     2 # Copyright (c) 1998, 2012, 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 #
    24 # @test
    25 # @bug 4087314 4800342
    26 # @summary Verify allowed access to protected class from another package.
    27 # @author William Maddox (maddox)
    28 #
    29 # @run shell ProtectedInnerClass.sh
    32 if [ "${TESTSRC}" = "" ]
    33 then
    34   echo "TESTSRC not set.  Test cannot execute.  Failed."
    35   exit 1
    36 fi
    37 echo "TESTSRC=${TESTSRC}"
    38 if [ "${TESTJAVA}" = "" ]
    39 then
    40   echo "TESTJAVA not set.  Test cannot execute.  Failed."
    41   exit 1
    42 fi
    43 echo "TESTJAVA=${TESTJAVA}"
    44 if [ "${TESTCLASSES}" = "" ]
    45 then
    46   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
    47   exit 1
    48 fi
    49 echo "TESTCLASSES=${TESTCLASSES}"
    50 echo "CLASSPATH=${CLASSPATH}"
    52 # set platform-dependent variables
    53 OS=`uname -s`
    54 case "$OS" in
    55   SunOS | Linux | Darwin )
    56     PS=":"
    57     FS="/"
    58     ;;
    59   CYGWIN* ) 
    60     PS=";" # native PS, not Cygwin PS
    61     FS="/"
    62     ;;
    63   Windows* )
    64     PS=";"
    65     FS="\\"
    66     ;;
    67   * )
    68     echo "Unrecognized system!"
    69     exit 1;
    70     ;;
    71 esac
    73 rm -f ${TESTCLASSES}${FS}p1${FS}*.class ${TESTCLASSES}${FS}p2${FS}*.class
    75 "${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d "${TESTCLASSES}" "${TESTSRC}${FS}p1${FS}ProtectedInnerClass1.java" "${TESTSRC}${FS}p2${FS}ProtectedInnerClass2.java"
    76 "${TESTJAVA}${FS}bin${FS}java" ${TESTVMOPTS} -classpath "${CLASSPATH}${PS}${TESTCLASSES}" p2.ProtectedInnerClass2
    77 result=$?
    78 if [ $result -eq 0 ]
    79 then
    80   echo "Passed"
    81 else
    82   echo "Failed"
    83 fi
    84 exit $result

mercurial