jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh
author michaelm
Tue, 06 Mar 2012 20:34:38 +0000
changeset 12047 320a714614e9
parent 7668 d4a77089c587
child 14342 8435a30053c1
permissions -rw-r--r--
7113349: Initial changeset for Macosx port to jdk Reviewed-by: jjh, alanb, dholmes, anthony, ohrstrom, ksrini, jrose, weijun, smarks Contributed-by: Alan Bateman <alan.bateman@oracle.com>, Alexander Potochkin <alexander.potochkin@oracle.com>, Alexander Zuev <alexander.zuev@oracle.com>, Andrew Brygin <andrew.brygin@oracle.com>, Artem Ananiev <artem.ananiev@oracle.com>, Alex Strange <astrange@apple.com>, Bino George <bino@apple.com>, Christine Lu <christine.lu@oracle.com>, David Katleman <david.katleman@oracle.com>, David Durrence <david_durrence@apple.com>, Dmitry Cherepanov <dmitry.cherepanov@oracle.com>, Greg Lewis <glewis@eyesbeyond.com>, Kevin Miller <kevin_m_miller@apple.com>, Kurt Miller <kurt@intricatesoftware.com>, Landon Fuller <landonf@plausiblelabs.com>, Leonid Romanov <leonid.romanov@oracle.com>, Loefty Walkowiak <loefty@apple.com>, Mark Reinhold <mark.reinhold@oracle.com>, Naoto Sato <naoto.sato@oracle.com>, Philip Race <philip.race@oracle.com>, Roger Hoover <rhoover@apple.com>, Scott Kovatch <scott.kovatch@oracle.com>, Sergey ByloKhov <sergey.bylokhov@oracle.com>, Mike Swingler <swingler@apple.com>, Tomas Hurka <tomas.hurka@oracle.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
7668
d4a77089c587 6962318: Update copyright year
ohair
parents: 5506
diff changeset
     2
# Copyright (c) 1998, 2010, 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
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
OS=`uname -s`
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
# Need to determine the classpath separator and filepath separator based on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
# operating system.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
case "$OS" in
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    44
SunOS | Linux | Darwin )
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
  PS=":"  ;;
4656
bbf13888e57a 6910835: TESTS: 3 java/io run.sh tests fail when run on Windows XP CYGWIN
ohair
parents: 2
diff changeset
    46
Windows* | CYGWIN* )
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
  PS=";"  ;;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
* )
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
  echo "Unrecognized system!"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
  exit 1  ;;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
esac
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
JAVA=${TESTJAVA}/bin/java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
JAVAC=${TESTJAVA}/bin/javac
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
MKDIR=mkdir
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
RDEL="rm -r"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    58
if [ -d ${TESTCLASSES}/oclasses ]
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
then
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    60
   ${RDEL} ${TESTCLASSES}/oclasses
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
fi
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    62
if [ -d ${TESTCLASSES}/nclasses ]
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}/nclasses
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}/share ]
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}/share
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 [ -f ${TESTCLASSES}/stream.ser ]
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
   ${RDEL} ${TESTCLASSES}/stream.ser
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
mkdir ${TESTCLASSES}/oclasses
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
mkdir ${TESTCLASSES}/share
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
mkdir ${TESTCLASSES}/nclasses
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
# Build sources
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 7668
diff changeset
    80
set -e
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
${JAVAC} -d ${TESTCLASSES}/share ${TESTSRC}/extension/ExtendedObjectInputStream.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
CLASSPATH=${TESTCLASSES}/share; export CLASSPATH;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
${JAVAC} -d ${TESTCLASSES}/oclasses ${TESTSRC}/test/SerialDriver.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
CLASSPATH=${TESTCLASSES}/share; export CLASSPATH;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
${JAVAC} -d ${TESTCLASSES}/nclasses ${TESTSRC}/install/SerialDriver.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
# 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
    88
CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
${JAVA} 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
    90
CLASSPATH="${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
${JAVA} install.SerialDriver -d
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
rm stream.ser
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
# 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
    95
CLASSPATH="${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
${JAVA} 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
    97
CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
${JAVA} test.SerialDriver -d