author | ohair |
Tue, 28 Dec 2010 15:53:50 -0800 | |
changeset 7668 | d4a77089c587 |
parent 5506 | 202f599c92aa |
child 12047 | 320a714614e9 |
permissions | -rw-r--r-- |
2 | 1 |
# |
7668 | 2 |
# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. |
2 | 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 |
# |
|
5506 | 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. |
|
2 | 22 |
# |
23 |
||
24 |
# @test |
|
25 |
# @bug 4087295 4785472 |
|
26 |
# @summary Enable resolveClass() to accommodate package renaming. |
|
27 |
# This fix enables one to implement a resolveClass method that maps a |
|
28 |
# Serialiazable class within a serialization stream to the same class |
|
29 |
# in a different package within the JVM runtime. See run shell script |
|
30 |
# for instructions on how to run this test. |
|
31 |
||
32 |
||
33 |
if [ "${TESTJAVA}" = "" ] |
|
34 |
then |
|
35 |
echo "TESTJAVA not set. Test cannot execute. Failed." |
|
36 |
exit 1 |
|
37 |
fi |
|
38 |
||
39 |
||
40 |
OS=`uname -s` |
|
41 |
# Need to determine the classpath separator and filepath separator based on the |
|
42 |
# operating system. |
|
43 |
case "$OS" in |
|
44 |
SunOS | Linux ) |
|
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 | 47 |
PS=";" ;; |
48 |
* ) |
|
49 |
echo "Unrecognized system!" |
|
50 |
exit 1 ;; |
|
51 |
esac |
|
52 |
||
53 |
JAVA=${TESTJAVA}/bin/java |
|
54 |
JAVAC=${TESTJAVA}/bin/javac |
|
55 |
MKDIR=mkdir |
|
56 |
RDEL="rm -r" |
|
57 |
||
58 |
if [ -d ${TESTCLASSES}/oclasses ] |
|
59 |
then |
|
60 |
${RDEL} ${TESTCLASSES}/oclasses |
|
61 |
fi |
|
62 |
if [ -d ${TESTCLASSES}/nclasses ] |
|
63 |
then |
|
64 |
${RDEL} ${TESTCLASSES}/nclasses |
|
65 |
fi |
|
66 |
if [ -d ${TESTCLASSES}/share ] |
|
67 |
then |
|
68 |
${RDEL} ${TESTCLASSES}/share |
|
69 |
fi |
|
70 |
if [ -f ${TESTCLASSES}/stream.ser ] |
|
71 |
then |
|
72 |
${RDEL} ${TESTCLASSES}/stream.ser |
|
73 |
fi |
|
74 |
||
75 |
mkdir ${TESTCLASSES}/oclasses |
|
76 |
mkdir ${TESTCLASSES}/share |
|
77 |
mkdir ${TESTCLASSES}/nclasses |
|
78 |
||
79 |
# Build sources |
|
80 |
set -e |
|
81 |
${JAVAC} -d ${TESTCLASSES}/share ${TESTSRC}/extension/ExtendedObjectInputStream.java |
|
82 |
CLASSPATH=${TESTCLASSES}/share; export CLASSPATH; |
|
83 |
${JAVAC} -d ${TESTCLASSES}/oclasses ${TESTSRC}/test/SerialDriver.java |
|
84 |
CLASSPATH=${TESTCLASSES}/share; export CLASSPATH; |
|
85 |
${JAVAC} -d ${TESTCLASSES}/nclasses ${TESTSRC}/install/SerialDriver.java |
|
86 |
||
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 | 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 | 91 |
${JAVA} install.SerialDriver -d |
92 |
rm stream.ser |
|
93 |
||
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 | 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 | 98 |
${JAVA} test.SerialDriver -d |