10
|
1 |
#!/bin/sh
|
|
2 |
|
|
3 |
#
|
|
4 |
# Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
|
|
5 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
6 |
#
|
|
7 |
# This code is free software; you can redistribute it and/or modify it
|
|
8 |
# under the terms of the GNU General Public License version 2 only, as
|
|
9 |
# published by the Free Software Foundation.
|
|
10 |
#
|
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that
|
|
15 |
# accompanied this code).
|
|
16 |
#
|
|
17 |
# You should have received a copy of the GNU General Public License version
|
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
20 |
#
|
|
21 |
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
|
22 |
# CA 95054 USA or visit www.sun.com if you need additional information or
|
|
23 |
# have any questions.
|
|
24 |
#
|
|
25 |
|
|
26 |
# @test
|
|
27 |
# @bug 5008759 4998341 5018369 5032476 5060121 5096932 5096931
|
|
28 |
# @run shell ../verifyVariables.sh
|
|
29 |
# @build Aggregate
|
|
30 |
# @run shell print.sh
|
|
31 |
# @summary test availabilty of print option
|
|
32 |
# @author Joseph D. Darcy
|
|
33 |
|
|
34 |
OS=`uname -s`;
|
|
35 |
case "${OS}" in
|
|
36 |
Windows* | CYGWIN* )
|
|
37 |
SEP=";"
|
|
38 |
;;
|
|
39 |
|
|
40 |
* )
|
|
41 |
SEP=":"
|
|
42 |
;;
|
|
43 |
esac
|
|
44 |
|
|
45 |
# Construct path to apt executable
|
|
46 |
APT="${TESTJAVA}/bin/apt ${TESTTOOLVMOPTS} \
|
|
47 |
-print "
|
|
48 |
|
|
49 |
printf "%s\n" "APT = ${APT}"
|
|
50 |
|
|
51 |
PRINT_FILES="${TESTSRC}/MisMatch.java \
|
|
52 |
${TESTSRC}/GenClass.java \
|
|
53 |
${TESTSRC}/Misc.java \
|
|
54 |
${TESTSRC}/Lacuna.java"
|
|
55 |
|
|
56 |
for i in ${PRINT_FILES}
|
|
57 |
do
|
|
58 |
# Delete any existing class file
|
|
59 |
FILENAME=`basename $i .java`
|
|
60 |
rm -f ${FILENAME}.class
|
|
61 |
|
|
62 |
printf "%s\n" "Printing ${i}"
|
|
63 |
${APT} ${i}
|
|
64 |
|
|
65 |
RESULT=$?
|
|
66 |
case "$RESULT" in
|
|
67 |
0 )
|
|
68 |
;;
|
|
69 |
|
|
70 |
* )
|
|
71 |
echo "Problem printing file ${i}."
|
|
72 |
exit 1
|
|
73 |
esac
|
|
74 |
|
|
75 |
# Verify compilation did not occur
|
|
76 |
if [ -f ${FILENAME}.class ]; then
|
|
77 |
printf "Improper compilation occured for %s.\n" ${i}
|
|
78 |
exit 1
|
|
79 |
fi
|
|
80 |
|
|
81 |
done
|
|
82 |
|
|
83 |
# check for mutliple methods and no static initializer
|
|
84 |
|
|
85 |
${APT} -XclassesAsDecls -cp ${TESTCLASSES} -print Aggregate > aggregate.txt
|
|
86 |
diff aggregate.txt ${TESTSRC}/goldenAggregate.txt
|
|
87 |
|
|
88 |
RESULT=$?
|
|
89 |
case "$RESULT" in
|
|
90 |
0 )
|
|
91 |
;;
|
|
92 |
|
|
93 |
* )
|
|
94 |
echo "Expected output not received"
|
|
95 |
exit 1
|
|
96 |
esac
|
|
97 |
|
|
98 |
exit 0
|