jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh
author simonis
Fri, 17 Jan 2014 21:54:30 +0100
changeset 22602 0d9a07b0d7e9
parent 15254 3997a6f357cb
child 23010 6dadb192ad81
permissions -rw-r--r--
8028537: PPC64: Updated the JDK regression tests to run on AIX Reviewed-by: alanb Contributed-by: luchsh@linux.vnet.ibm.com, spoole@linux.vnet.ibm.com, volker.simonis@gmail.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
14342
8435a30053c1 7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents: 12047
diff changeset
     2
# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4656
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4656
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4656
diff changeset
    21
# questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
# @test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
# @bug 4087295 4785472
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
# @summary Enable resolveClass() to accommodate package renaming.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# This fix enables one to implement a resolveClass method that maps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
# Serialiazable class within a serialization stream to the same class
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
# in a different package within the JVM runtime. See run shell script
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
# for instructions on how to run this test.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
if [ "${TESTJAVA}" = "" ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
  echo "TESTJAVA not set.  Test cannot execute.  Failed."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
  exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    39
if [ "${COMPILEJAVA}" = "" ] ; then
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    40
  COMPILEJAVA="${TESTJAVA}"
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    41
fi
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    42
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
OS=`uname -s`
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
# Need to determine the classpath separator and filepath separator based on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
# operating system.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
case "$OS" in
22602
0d9a07b0d7e9 8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents: 15254
diff changeset
    48
SunOS | Linux | Darwin | AIX )
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
  PS=":"  ;;
4656
bbf13888e57a 6910835: TESTS: 3 java/io run.sh tests fail when run on Windows XP CYGWIN
ohair
parents: 2
diff changeset
    50
Windows* | CYGWIN* )
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
  PS=";"  ;;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
* )
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
  echo "Unrecognized system!"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
  exit 1  ;;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
esac
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
JAVA=${TESTJAVA}/bin/java
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    58
JAVAC=${COMPILEJAVA}/bin/javac
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
MKDIR=mkdir
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
RDEL="rm -r"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    62
if [ -d ${TESTCLASSES}/oclasses ]
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
then
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    64
   ${RDEL} ${TESTCLASSES}/oclasses
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
fi
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    66
if [ -d ${TESTCLASSES}/nclasses ]
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
then
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    68
   ${RDEL} ${TESTCLASSES}/nclasses
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
fi
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    70
if [ -d ${TESTCLASSES}/share ]
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
then
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    72
   ${RDEL} ${TESTCLASSES}/share
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
fi
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    74
if [ -f ${TESTCLASSES}/stream.ser ]
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
   ${RDEL} ${TESTCLASSES}/stream.ser
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
mkdir ${TESTCLASSES}/oclasses
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
mkdir ${TESTCLASSES}/share
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
mkdir ${TESTCLASSES}/nclasses
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
# Build sources
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    84
set -e
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    85
${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES}/share \
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    86
    ${TESTSRC}/extension/ExtendedObjectInputStream.java
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
CLASSPATH=${TESTCLASSES}/share; export CLASSPATH;
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    88
${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES}/oclasses \
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    89
    ${TESTSRC}/test/SerialDriver.java
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
CLASSPATH=${TESTCLASSES}/share; export CLASSPATH;
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    91
${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${TESTCLASSES}/nclasses \
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    92
    ${TESTSRC}/install/SerialDriver.java
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
# Run Case 1. Map test.SerialDriver within stream to install.SerialDriver.
4656
bbf13888e57a 6910835: TESTS: 3 java/io run.sh tests fail when run on Windows XP CYGWIN
ohair
parents: 2
diff changeset
    95
CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
14786
a9f61e0cbe61 8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents: 14342
diff changeset
    96
${JAVA} ${TESTVMOPTS} test.SerialDriver -s
4656
bbf13888e57a 6910835: TESTS: 3 java/io run.sh tests fail when run on Windows XP CYGWIN
ohair
parents: 2
diff changeset
    97
CLASSPATH="${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
14786
a9f61e0cbe61 8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents: 14342
diff changeset
    98
${JAVA} ${TESTVMOPTS} install.SerialDriver -d
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
rm stream.ser
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
# Run Case 2. Map install.SerialDriver within stream to test.SerialDriver.
4656
bbf13888e57a 6910835: TESTS: 3 java/io run.sh tests fail when run on Windows XP CYGWIN
ohair
parents: 2
diff changeset
   102
CLASSPATH="${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
14786
a9f61e0cbe61 8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents: 14342
diff changeset
   103
${JAVA} ${TESTVMOPTS} install.SerialDriver -s
4656
bbf13888e57a 6910835: TESTS: 3 java/io run.sh tests fail when run on Windows XP CYGWIN
ohair
parents: 2
diff changeset
   104
CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
14786
a9f61e0cbe61 8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents: 14342
diff changeset
   105
${JAVA} ${TESTVMOPTS} test.SerialDriver -d