jdk/test/tools/launcher/MultipleJRE.sh
author ksrini
Mon, 10 Nov 2014 08:43:27 -0800
changeset 27938 7f7f8bf64dd7
parent 17933 b18cda672b79
child 28109 c510e26fcd55
permissions -rw-r--r--
8058407: Remove Multiple JRE support in the Java launcher Reviewed-by: alanb, darcy, ksrini Contributed-by: neil.toda@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17933
b18cda672b79 8014834: shell tests don't begin with #!/bin/sh
emc
parents: 15254
diff changeset
     1
#!/bin/sh
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
# @test MultipleJRE.sh
2598
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
     3
# @bug 4811102 4953711 4955505 4956301 4991229 4998210 5018605 6387069 6733959
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
# @build PrintVersion
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# @build UglyPrintVersion
2598
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
     6
# @build ZipMeUp
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# @run shell MultipleJRE.sh
27938
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
     8
# @summary Verify Multiple JRE version support has been removed
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
# @author Joseph E. Kowalski
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2598
diff changeset
    12
# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
# under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2598
diff changeset
    29
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2598
diff changeset
    30
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2598
diff changeset
    31
# questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
# Verify directory context variables are set
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
if [ "${TESTJAVA}" = "" ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
  echo "TESTJAVA not set.  Test cannot execute.  Failed."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
  exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    41
if [ "${COMPILEJAVA}" = "" ]; then
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    42
  COMPILEJAVA="${TESTJAVA}"
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    43
fi
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    44
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
if [ "${TESTSRC}" = "" ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
  echo "TESTSRC not set.  Test cannot execute.  Failed."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
  exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
if [ "${TESTCLASSES}" = "" ]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
  exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
14786
a9f61e0cbe61 8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents: 5506
diff changeset
    57
JAVAEXE="$TESTJAVA/bin/java ${TESTVMOPTS}"
a9f61e0cbe61 8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents: 5506
diff changeset
    58
JAVA="$TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES"
15254
3997a6f357cb 8005978: shell tests need to use the $COMPILEJDK for javac, jar and other tools
alanb
parents: 14786
diff changeset
    59
JAR="$COMPILEJAVA/bin/jar ${TESTTOOLVMOPTS}"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
OS=`uname -s`;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
#
2598
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
    63
# Tests whether we are on windows (true) or not.
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
    64
#
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
    65
IsWindows() {
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
    66
    case "$OS" in
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
    67
        Windows* | CYGWIN* )
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
    68
            printf "true"
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
    69
	;;
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
    70
	* )
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
    71
            printf "false"
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
    72
	;;
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
    73
    esac
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
    74
}
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
    75
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
    76
#
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
# Shell routine to test for the proper rejection of syntactically incorrect
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
# version specifications.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
TestSyntax() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
	mess="`$JAVA -version:\"$1\" -version 2>&1`"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
	if [ $? -eq 0 ]; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
		echo "Invalid version syntax $1 accepted"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
		exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
	fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
	prefix="`echo "$mess" | cut -d ' ' -f 1-3`"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
	if [ "$prefix" != "Error: Syntax error" ]; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
		echo "Unexpected error message for invalid syntax $1"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
		exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
	fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
# Just as the name says.  We sprinkle these in the appropriate location
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
# in the test file system and they just say who they are pretending to be.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
CreateMockVM() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
	mkdir -p jdk/j2re$1/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
	echo "#!/bin/sh"    > jdk/j2re$1/bin/java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
	echo "echo \"$1\"" >> jdk/j2re$1/bin/java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
	chmod +x jdk/j2re$1/bin/java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
# Constructs the jar file needed by these tests.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
CreateJar() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
	mkdir -p META-INF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
	echo "Manifest-Version: 1.0" > META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
	echo "Main-Class: PrintVersion" >> META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
	if [ "$1" != "" ]; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
		echo "JRE-Version: $1" >> META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
	fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
	cp $TESTCLASSES/PrintVersion.class .
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
	$JAR $2cmf META-INF/MANIFEST.MF PrintVersion PrintVersion.class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
# Constructs a jar file using zip.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
CreateZippyJar() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
	mkdir -p META-INF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
	echo "Manifest-Version: 1.0" > META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
	echo "Main-Class: PrintVersion" >> META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
	if [ "$1" != "" ]; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
		echo "JRE-Version: $1" >> META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
	fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
	cp $TESTCLASSES/PrintVersion.class .
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
	/usr/bin/zip $2 PrintVersion META-INF/MANIFEST.MF PrintVersion.class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
# Constructs a jar file with a Main-Class attribute of greater than
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
# 80 characters to validate the continuation line processing.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
# Make this just long enough to require two continuation lines.  Longer
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
# paths take too much away from the restricted Windows maximum path length.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
# Note: see the variable UGLYCLASS and its check for path length.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
# Make sure that 5018605 remains fixed by including additional sections
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
# in the Manifest which contain the same names as those allowed in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
# main section.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
PACKAGE=reallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongpackagename
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
UGLYCLASS=$TESTCLASSES/$PACKAGE/UglyPrintVersion.class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
CreateUglyJar() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
	mkdir -p META-INF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
	echo "Manifest-Version: 1.0" > META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
	echo "Main-Class: $PACKAGE.UglyPrintVersion" >> META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
	if [ "$1" != "" ]; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
		echo "JRE-Version: $1" >> META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
	fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
	echo "" >> META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
	echo "Name: NotToBeFound.class" >> META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
	echo "Main-Class: NotToBeFound" >> META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
	mkdir -p $PACKAGE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
	cp $UGLYCLASS $PACKAGE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
	$JAR $2cmf META-INF/MANIFEST.MF PrintVersion \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
	    $PACKAGE/UglyPrintVersion.class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
# Constructs a jar file with a fair number of "zip directory" entries and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
# the MANIFEST.MF entry at or near the end of that directory to validate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
# the ability to transverse that directory.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
CreateFullJar() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
	mkdir -p META-INF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
	echo "Manifest-Version: 1.0" > META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
	echo "Main-Class: PrintVersion" >> META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
	if [ "$1" != "" ]; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
	    echo "JRE-Version: $1" >> META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
	fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
	cp $TESTCLASSES/PrintVersion.class .
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
	for i in 0 1 2 3 4 5 6 7 8 9 ; do
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
		for j in 0 1 2 3 4 5 6 7 8 9 ; do
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
			touch AfairlyLongNameEatsUpDirectorySpaceBetter$i$j
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
		done
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
	done
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
	$JAR $2cMf PrintVersion PrintVersion.class AfairlyLong*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
	$JAR $2umf META-INF/MANIFEST.MF PrintVersion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
	rm -f AfairlyLong*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
# Creates a jar file with the attributes which caused the failure
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
# described in 4991229.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
# Generate a bunch of CENTAB entries, each of which is 64 bytes long
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
# which practically guarentees we will hit the appropriate power of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
# two buffer (initially 1K).  Note that due to the perversity of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
# zip/jar files, the first entry gets extra stuff so it needs a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
# shorter name to compensate.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
CreateAlignedJar() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
	mkdir -p META-INF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
	echo "Manifest-Version: 1.0" > META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
	echo "Main-Class: PrintVersion" >> META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
	if [ "$1" != "" ]; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
	    echo "JRE-Version: $1" >> META-INF/MANIFEST.MF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
	fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
	cp $TESTCLASSES/PrintVersion.class .
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
	touch 57BytesSpecial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
	for i in 0 1 2 3 4 5 6 7 8 9 ; do
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
		for j in 0 1 2 3 4 5 6 7 8 9 ; do
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
			touch 64BytesPerEntry-$i$j
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
		done
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
	done
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
	$JAR $2cMf PrintVersion 57* 64* PrintVersion.class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
	$JAR $2umf META-INF/MANIFEST.MF PrintVersion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
	rm -f 57* 64*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
# Adds comments to a jar/zip file.  This serves two purposes:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
#   1)	Make sure zip file comments (both per file and per archive) are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
#	properly processed and ignored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
#   2)	A long file comment creates a mondo "Central Directory" entry in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
#	the zip file. Such a "mondo" entry could also be due to a very
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
#	long file name (path) or a long "Ext" entry, but adding the long
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
#	comment is the easiest way.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
#
27938
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   225
MONDO=" Mondo comment line 00 is designed to take up space - lots and lots of space.  Mondo comment line 01 is designed to take up space - lots and lots of space.  Mondo comment line 02 is designed to take up space - lots and lots of space.  Mondo comment line 03 is designed to take up space - lots and lots of space.  Mondo comment line 04 is designed to take up space - lots and lots of space.  Mondo comment line 05 is designed to take up space - lots and lots of space.  Mondo comment line 06 is designed to take up space - lots and lots of space.  Mondo comment line 07 is designed to take up space - lots and lots of space.  Mondo comment line 08 is designed to take up space - lots and lots of space.  Mondo comment line 09 is designed to take up space - lots and lots of space.  Mondo comment line 0a is designed to take up space - lots and lots of space.  Mondo comment line 0b is designed to take up space - lots and lots of space.  Mondo comment line 0c is designed to take up space - lots and lots of space.  Mondo comment line 0d is designed to take up space - lots and lots of space.  Mondo comment line 0e is designed to take up space - lots and lots of space.  Mondo comment line 0f is designed to take up space - lots and lots of space.  Mondo comment line 10 is designed to take up space - lots and lots of space.  Mondo comment line 11 is designed to take up space - lots and lots of space.  Mondo comment line 12 is designed to take up space - lots and lots of space.  Mondo comment line 13 is designed to take up space - lots and lots of space.  Mondo comment line 14 is designed to take up space - lots and lots of space.  Mondo comment line 15 is designed to take up space - lots and lots of space.  Mondo comment line 16 is designed to take up space - lots and lots of space.  Mondo comment line 17 is designed to take up space - lots and lots of space.  Mondo comment line 18 is designed to take up space - lots and lots of space.  Mondo comment line 19 is designed to take up space - lots and lots of space.  Mondo comment line 1a is designed to take up space - lots and lots of space.  Mondo comment line 1b is designed to take up space - lots and lots of space.  Mondo comment line 1c is designed to take up space - lots and lots of space.  Mondo comment line 1d is designed to take up space - lots and lots of space.  Mondo comment line 1e is designed to take up space - lots and lots of space.  Mondo comment line 1f is designed to take up space - lots and lots of space.  Mondo comment line 20 is designed to take up space - lots and lots of space.  Mondo comment line 21 is designed to take up space - lots and lots of space.  Mondo comment line 22 is designed to take up space - lots and lots of space.  Mondo comment line 23 is designed to take up space - lots and lots of space.  Mondo comment line 24 is designed to take up space - lots and lots of space.  Mondo comment line 25 is designed to take up space - lots and lots of space.  Mondo comment line 26 is designed to take up space - lots and lots of space.  Mondo comment line 27 is designed to take up space - lots and lots of space.  Mondo comment line 28 is designed to take up space - lots and lots of space.  Mondo comment line 29 is designed to take up space - lots and lots of space.  Mondo comment line 2a is designed to take up space - lots and lots of space.  Mondo comment line 2b is designed to take up space - lots and lots of space.  Mondo comment line 2c is designed to take up space - lots and lots of space.  Mondo comment line 2d is designed to take up space - lots and lots of space.  Mondo comment line 2e is designed to take up space - lots and lots of space.  Mondo comment line 2f is designed to take up space - lots and lots of space.  Mondo comment line 30 is designed to take up space - lots and lots of space.  Mondo comment line 31 is designed to take up space - lots and lots of space.  Mondo comment line 32 is designed to take up space - lots and lots of space.  Mondo comment line 33 is designed to take up space - lots and lots of space.  Mondo comment line 34 is designed to take up space - lots and lots of space.  Mondo comment line 35 is designed to take up space - lots and lots of space.  Mondo comment line 36 is designed to take up space - lots and lots of space.  Mondo comment line 37 is designed to take up space - lots and lots of space.  Mondo comment line 38 is designed to take up space - lots and lots of space.  Mondo comment line 39 is designed to take up space - lots and lots of space.  Mondo comment line 3a is designed to take up space - lots and lots of space.  Mondo comment line 3b is designed to take up space - lots and lots of space.  Mondo comment line 3c is designed to take up space - lots and lots of space.  Mondo comment line 3d is designed to take up space - lots and lots of space.  Mondo comment line 3e is designed to take up space - lots and lots of space.  Mondo comment line 3f is designed to take up space - lots and lots of space.  Mondo comment line 40 is designed to take up space - lots and lots of space.  Mondo comment line 41 is designed to take up space - lots and lots of space.  Mondo comment line 42 is designed to take up space - lots and lots of space.  Mondo comment line 43 is designed to take up space - lots and lots of space.  Mondo comment line 44 is designed to take up space - lots and lots of space.  Mondo comment line 45 is designed to take up space - lots and lots of space.  Mondo comment line 46 is designed to take up space - lots and lots of space.  Mondo comment line 47 is designed to take up space - lots and lots of space.  Mondo comment line 48 is designed to take up space - lots and lots of space.  Mondo comment line 49 is designed to take up space - lots and lots of space.  Mondo comment line 4a is designed to take up space - lots and lots of space.  Mondo comment line 4b is designed to take up space - lots and lots of space.  Mondo comment line 4c is designed to take up space - lots and lots of space.  Mondo comment line 4d is designed to take up space - lots and lots of space.  Mondo comment line 4e is designed to take up space - lots and lots of space.  Mondo comment line 4f is designed to take up space - lots and lots of space.  Mondo comment line 50 is designed to take up space - lots and lots of space.  Mondo comment line 51 is designed to take up space - lots and lots of space.  Mondo comment line 52 is designed to take up space - lots and lots of space.  Mondo comment line 53 is designed to take up space - lots and lots of space.  Mondo comment line 54 is designed to take up space - lots and lots of space.  Mondo comment line 55 is designed to take up space - lots and lots of space.  Mondo comment line 56 is designed to take up space - lots and lots of space.  Mondo comment line 57 is designed to take up space - lots and lots of space.  Mondo comment line 58 is designed to take up space - lots and lots of space.  Mondo comment line 59 is designed to take up space - lots and lots of space.  Mondo comment line 5a is designed to take up space - lots and lots of space.  Mondo comment line 5b is designed to take up space - lots and lots of space.  Mondo comment line 5c is designed to take up space - lots and lots of space.  Mondo comment line 5d is designed to take up space - lots and lots of space.  Mondo comment line 5e is designed to take up space - lots and lots of space.  Mondo comment line 5f is designed to take up space - lots and lots of space.  Mondo comment line 60 is designed to take up space - lots and lots of space.  Mondo comment line 61 is designed to take up space - lots and lots of space.  Mondo comment line 62 is designed to take up space - lots and lots of space.  Mondo comment line 63 is designed to take up space - lots and lots of space.  Mondo comment line 64 is designed to take up space - lots and lots of space.  Mondo comment line 65 is designed to take up space - lots and lots of space.  Mondo comment line 66 is designed to take up space - lots and lots of space.  Mondo comment line 67 is designed to take up space - lots and lots of space.  Mondo comment line 68 is designed to take up space - lots and lots of space.  Mondo comment line 69 is designed to take up space - lots and lots of space.  Mondo comment line 6a is designed to take up space - lots and lots of space.  Mondo comment line 6b is designed to take up space - lots and lots of space.  Mondo comment line 6c is designed to take up space - lots and lots of space.  Mondo comment line 6d is designed to take up space - lots and lots of space.  Mondo comment line 6e is designed to take up space - lots and lots of space.  Mondo comment line 6f is designed to take up space - lots and lots of space.  Mondo comment line 70 is designed to take up space - lots and lots of space.  Mondo comment line 71 is designed to take up space - lots and lots of space.  Mondo comment line 72 is designed to take up space - lots and lots of space.  Mondo comment line 73 is designed to take up space - lots and lots of space.  Mondo comment line 74 is designed to take up space - lots and lots of space.  Mondo comment line 75 is designed to take up space - lots and lots of space.  Mondo comment line 76 is designed to take up space - lots and lots of space.  Mondo comment line 77 is designed to take up space - lots and lots of space.  Mondo comment line 78 is designed to take up space - lots and lots of space.  Mondo comment line 79 is designed to take up space - lots and lots of space.  Mondo comment line 7a is designed to take up space - lots and lots of space.  Mondo comment line 7b is designed to take up space - lots and lots of space.  Mondo comment line 7c is designed to take up space - lots and lots of space.  Mondo comment line 7d is designed to take up space - lots and lots of space.  Mondo comment line 7e is designed to take up space - lots and lots of space.  Mondo comment line 7f is designed to take up space - lots and lots of space.  Mondo comment line 80 is designed to take up space - lots and lots of space.  Mondo comment line 81 is designed to take up space - lots and lots of space.  Mondo comment line 82 is designed to take up space - lots and lots of space.  Mondo comment line 83 is designed to take up space - lots and lots of space.  Mondo comment line 84 is designed to take up space - lots and lots of space.  Mondo comment line 85 is designed to take up space - lots and lots of space.  Mondo comment line 86 is designed to take up space - lots and lots of space.  Mondo comment line 87 is designed to take up space - lots and lots of space.  Mondo comment line 88 is designed to take up space - lots and lots of space.  Mondo comment line 89 is designed to take up space - lots and lots of space.  Mondo comment line 8a is designed to take up space - lots and lots of space.  Mondo comment line 8b is designed to take up space - lots and lots of space.  Mondo comment line 8c is designed to take up space - lots and lots of space.  Mondo comment line 8d is designed to take up space - lots and lots of space.  Mondo comment line 8e is designed to take up space - lots and lots of space.  Mondo comment line 8f is designed to take up space - lots and lots of space.  Mondo comment line 90 is designed to take up space - lots and lots of space.  Mondo comment line 91 is designed to take up space - lots and lots of space.  Mondo comment line 92 is designed to take up space - lots and lots of space.  Mondo comment line 93 is designed to take up space - lots and lots of space.  Mondo comment line 94 is designed to take up space - lots and lots of space.  Mondo comment line 95 is designed to take up space - lots and lots of space.  Mondo comment line 96 is designed to take up space - lots and lots of space.  Mondo comment line 97 is designed to take up space - lots and lots of space.  Mondo comment line 98 is designed to take up space - lots and lots of space.  Mondo comment line 99 is designed to take up space - lots and lots of space.  Mondo comment line 9a is designed to take up space - lots and lots of space.  Mondo comment line 9b is designed to take up space - lots and lots of space.  Mondo comment line 9c is designed to take up space - lots and lots of space.  Mondo comment line 9d is designed to take up space - lots and lots of space.  Mondo comment line 9e is designed to take up space - lots and lots of space.  Mondo comment line 9f is designed to take up space - lots and lots of space.  Mondo comment line a0 is designed to take up space - lots and lots of space.  Mondo comment line a1 is designed to take up space - lots and lots of space.  Mondo comment line a2 is designed to take up space - lots and lots of space.  Mondo comment line a3 is designed to take up space - lots and lots of space.  Mondo comment line a4 is designed to take up space - lots and lots of space.  Mondo comment line a5 is designed to take up space - lots and lots of space.  Mondo comment line a6 is designed to take up space - lots and lots of space.  Mondo comment line a7 is designed to take up space - lots and lots of space.  Mondo comment line a8 is designed to take up space - lots and lots of space.  Mondo comment line a9 is designed to take up space - lots and lots of space.  Mondo comment line aa is designed to take up space - lots and lots of space.  Mondo comment line ab is designed to take up space - lots and lots of space.  Mondo comment line ac is designed to take up space - lots and lots of space.  Mondo comment line ad is designed to take up space - lots and lots of space.  Mondo comment line ae is designed to take up space - lots and lots of space.  Mondo comment line af is designed to take up space - lots and lots of space.  Mondo comment line b0 is designed to take up space - lots and lots of space.  Mondo comment line b1 is designed to take up space - lots and lots of space.  Mondo comment line b2 is designed to take up space - lots and lots of space.  Mondo comment line b3 is designed to take up space - lots and lots of space.  Mondo comment line b4 is designed to take up space - lots and lots of space.  Mondo comment line b5 is designed to take up space - lots and lots of space.  Mondo comment line b6 is designed to take up space - lots and lots of space.  Mondo comment line b7 is designed to take up space - lots and lots of space.  Mondo comment line b8 is designed to take up space - lots and lots of space.  Mondo comment line b9 is designed to take up space - lots and lots of space.  Mondo comment line ba is designed to take up space - lots and lots of space.  Mondo comment line bb is designed to take up space - lots and lots of space.  Mondo comment line bc is designed to take up space - lots and lots of space.  Mondo comment line bd is designed to take up space - lots and lots of space.  Mondo comment line be is designed to take up space - lots and lots of space.  Mondo comment line bf is designed to take up space - lots and lots of space.  Mondo comment line c0 is designed to take up space - lots and lots of space.  Mondo comment line c1 is designed to take up space - lots and lots of space.  Mondo comment line c2 is designed to take up space - lots and lots of space.  Mondo comment line c3 is designed to take up space - lots and lots of space.  Mondo comment line c4 is designed to take up space - lots and lots of space.  Mondo comment line c5 is designed to take up space - lots and lots of space.  Mondo comment line c6 is designed to take up space - lots and lots of space.  Mondo comment line c7 is designed to take up space - lots and lots of space.  Mondo comment line c8 is designed to take up space - lots and lots of space.  Mondo comment line c9 is designed to take up space - lots and lots of space.  Mondo comment line ca is designed to take up space - lots and lots of space.  Mondo comment line cb is designed to take up space - lots and lots of space.  Mondo comment line cc is designed to take up space - lots and lots of space.  Mondo comment line cd is designed to take up space - lots and lots of space.  Mondo comment line ce is designed to take up space - lots and lots of space.  Mondo comment line cf is designed to take up space - lots and lots of space.  Mondo comment line d0 is designed to take up space - lots and lots of space.  Mondo comment line d1 is designed to take up space - lots and lots of space.  Mondo comment line d2 is designed to take up space - lots and lots of space.  Mondo comment line d3 is designed to take up space - lots and lots of space.  Mondo comment line d4 is designed to take up space - lots and lots of space.  Mondo comment line d5 is designed to take up space - lots and lots of space.  Mondo comment line d6 is designed to take up space - lots and lots of space.  Mondo comment line d7 is designed to take up space - lots and lots of space.  Mondo comment line d8 is designed to take up space - lots and lots of space.  Mondo comment line d9 is designed to take up space - lots and lots of space.  Mondo comment line da is designed to take up space - lots and lots of space.  Mondo comment line db is designed to take up space - lots and lots of space.  Mondo comment line dc is designed to take up space - lots and lots of space.  Mondo comment line dd is designed to take up space - lots and lots of space.  Mondo comment line de is designed to take up space - lots and lots of space.  Mondo comment line df is designed to take up space - lots and lots of space.  Mondo comment line e0 is designed to take up space - lots and lots of space.  Mondo comment line e1 is designed to take up space - lots and lots of space.  Mondo comment line e2 is designed to take up space - lots and lots of space.  Mondo comment line e3 is designed to take up space - lots and lots of space.  Mondo comment line e4 is designed to take up space - lots and lots of space.  Mondo comment line e5 is designed to take up space - lots and lots of space.  Mondo comment line e6 is designed to take up space - lots and lots of space.  Mondo comment line e7 is designed to take up space - lots and lots of space.  Mondo comment line e8 is designed to take up space - lots and lots of space.  Mondo comment line e9 is designed to take up space - lots and lots of space.  Mondo comment line ea is designed to take up space - lots and lots of space.  Mondo comment line eb is designed to take up space - lots and lots of space.  Mondo comment line ec is designed to take up space - lots and lots of space.  Mondo comment line ed is designed to take up space - lots and lots of space.  Mondo comment line ee is designed to take up space - lots and lots of space.  Mondo comment line ef is designed to take up space - lots and lots of space.  Mondo comment line f0 is designed to take up space - lots and lots of space.  Mondo comment line f1 is designed to take up space - lots and lots of space.  Mondo comment line f2 is designed to take up space - lots and lots of space.  Mondo comment line f3 is designed to take up space - lots and lots of space.  Mondo comment line f4 is designed to take up space - lots and lots of space.  Mondo comment line f5 is designed to take up space - lots and lots of space.  Mondo comment line f6 is designed to take up space - lots and lots of space.  Mondo comment line f7 is designed to take up space - lots and lots of space.  Mondo comment line f8 is designed to take up space - lots and lots of space.  Mondo comment line f9 is designed to take up space - lots and lots of space.  Mondo comment line fa is designed to take up space - lots and lots of space.  Mondo comment line fb is designed to take up space - lots and lots of space.  Mondo comment line fc is designed to take up space - lots and lots of space.  Mondo comment line fd is designed to take up space - lots and lots of space.  Mondo comment line fe is designed to take up space - lots and lots of space.  Mondo comment line ff is designed to take up space - lots and lots of space."
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
CommentZipFile() {
27938
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   227
	mkdir -p META-INF
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   228
	echo "Manifest-Version: 1.0" > META-INF/MANIFEST.MF
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   229
	echo "Main-Class: PrintVersion" >> META-INF/MANIFEST.MF
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   230
	if [ "$1" != "" ]; then
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   231
	    echo "JRE-Version: $1" >> META-INF/MANIFEST.MF
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
	fi
27938
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   233
	cp $TESTCLASSES/PrintVersion.class .
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   234
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   235
	# The remaining code in CommentZipFile essentially replaces the
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   236
	#   following code, which added comments to the jar file.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   237
	#   Unfortunately zipnote has been broken since 3.0 [ 2008 ] and
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   238
	#   there has been no new [ fixed ] version.  zipnote has probably
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   239
	#   always failed, or failed for a long time without causing the
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   240
	#   test to fail.  So no comments were added to the file.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   241
	#   The comments are added using zip(1) during the creation of the
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   242
	#   zip file.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   243
	#
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   244
	# NOTE:
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   245
	#   It seems the original intent of this test was to add a very long
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   246
	#   comment for one file.  But zip allows a max of 256 characters, so
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   247
	#   we settle for adding 256-character comments to lots of files.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   248
	#
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   249
	# $JAR $2cMf PrintVersion PrintVersion.class AfairlyLong*
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   250
	# $JAR $2umf META-INF/MANIFEST.MF PrintVersion
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   251
	# /usr/bin/zipnote PrintVersion.zip > zipout
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   252
	# ... code to modify zipout adding comments
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   253
	# /usr/bin/zipnote -w PrintVersion.zip < zipin
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   254
	# mv PrintVersion.zip PrintVersion
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   255
	#
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   256
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   257
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   258
	for i in 0 1 2 3 4 5 6 7 8 9 ; do
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   259
		for j in 0 1 2 3 4 5 6 7 8 9 ; do
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   260
			touch AfairlyLongNameEatsUpDirectorySpaceBetter$i$j
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   261
		done
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   262
	done
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   263
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   264
        zip -$2c PrintVersion.zip PrintVersion.class AfairlyLong* META-INF/MANIFEST.MF << FINI
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   265
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   266
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   267
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   268
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   269
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   270
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   271
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   272
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   273
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   274
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   275
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   276
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   277
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   278
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   279
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   280
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   281
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   282
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   283
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   284
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   285
$MONDO
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   286
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   287
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   288
File Comment Line.
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   289
FINI
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   290
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   291
	rm -f AfairlyLong*
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   292
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    mv PrintVersion.zip PrintVersion
27938
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   294
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
# Attempt to launch a vm using a version specifier and make sure the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
# resultant launch (probably a "mock vm") is appropriate.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
LaunchVM() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
	if [ "$1" != "" ]; then
27938
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   303
		mess="`$JAVA \"$1\" -jar PrintVersion 2>&1`"
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   304
		if [ $? -eq 0 ]; then
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   305
			echo "Unexpected success of -Version:$1"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
			echo "$mess"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
			exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
		fi
27938
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   309
	else
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   310
		mess="`$JAVA -jar PrintVersion 2>&1`"
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   311
		if [ $? -ne 0 ]; then
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   312
			prefix=`echo "$mess" | cut -d ' ' -f 1-3`
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   313
			if [ "$prefix" != "Unable to locate" ]; then
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   314
				echo "$mess"
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   315
				exit 1
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   316
			fi
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   317
			echo "Unexpected error in attempting to locate $1"
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   318
			exit 1
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   319
		fi
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   320
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
	fi
27938
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   322
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
	echo $mess | grep "$2" > /dev/null 2>&1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
	if [ $? != 0 ]; then
27938
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   325
	    echo "Launched $mess, expected $1"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
	    exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
	fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
2598
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   330
# Tests very long Main-Class attribute in the jar
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   331
TestLongMainClass() {
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   332
    JVER=$1
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   333
    if [ "$JVER" = "mklink" ]; then
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   334
        JVER=XX
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   335
        JDKXX=jdk/j2re$JVER
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   336
        rm -rf jdk
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   337
        mkdir jdk
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   338
        ln -s $TESTJAVA $JDKXX
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   339
        JAVA_VERSION_PATH="`pwd`/jdk"
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   340
        export JAVA_VERSION_PATH
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   341
    fi
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   342
    $JAVAEXE -cp $TESTCLASSES ZipMeUp UglyBetty.jar 4097 
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   343
    message="`$JAVAEXE -version:$JVER -jar UglyBetty.jar 2>&1`"
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   344
    echo $message | grep "Error: main-class: attribute exceeds system limits" > /dev/null 2>&1
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   345
    if [ $? -ne 0 ]; then
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   346
        printf "Long manifest test did not get expected error"
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   347
        exit 1
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   348
    fi
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   349
    unset JAVA_VERSION_PATH
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   350
    rm -rf jdk
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   351
}
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   352
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
# Main test sequence starts here
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
#
27938
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   356
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
RELEASE=`$JAVA -version 2>&1 | head -n 1 | cut -d ' ' -f 3 | \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
  sed -e "s/\"//g"`
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
BASE_RELEASE=`echo $RELEASE | sed -e "s/-.*//g"`
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
# Make sure that the generic jar/manifest reading code works. Test both
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
# compressed and "stored" jar files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
# The "Ugly" jar (long manifest line) tests are only run if the combination
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
# of the file name length restrictions and the length of the cwd allow it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
CreateJar "" ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
LaunchVM "" "${RELEASE}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
CreateJar "" "0"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
LaunchVM "" "${RELEASE}"
2598
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   372
if [ `IsWindows` = "true" ]; then
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   373
    MAXIMUM_PATH=255;
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   374
else
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   375
    MAXIMUM_PATH=1024;
6f980e1d6e31 6733959: Insufficient checks for "Main-Class" manifest entry in JAR files
ksrini
parents: 2
diff changeset
   376
fi
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
PATH_LENGTH=`printf "%s" "$UGLYCLASS" | wc -c`
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
if [ ${PATH_LENGTH} -lt ${MAXIMUM_PATH} ]; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
	CreateUglyJar "" ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
	LaunchVM "" "${RELEASE}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
	CreateUglyJar "" "0"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
	LaunchVM "" "${RELEASE}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
    printf "Warning: Skipped UglyJar test, path length exceeded, %d" $MAXIMUM_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
    printf " allowed, the current path is %d\n" $PATH_LENGTH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
CreateAlignedJar "" ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
LaunchVM "" "${RELEASE}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
CreateFullJar "" ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
LaunchVM "" "${RELEASE}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
# 4998210 shows that some very strange behaviors are semi-supported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
# In this case, it's the ability to prepend any kind of stuff to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
# jar file and require that the jar file still work.  Note that this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
# "interface" isn't publically supported and we may choose to break
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
# it in the future, but this test guarantees that we won't break it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
# without informed consent. We take advantage the fact that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
# "FullJar" we just tested is probably the best jar to begin with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
# for this test.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
echo "This is just meaningless bytes to prepend to the jar" > meaningless
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
mv PrintVersion meaningfull
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
cat meaningless meaningfull > PrintVersion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
LaunchVM "" "${RELEASE}" 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
rm meaningless meaningfull
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
# Officially, one must use "the jar command to create a jar file.  However,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
# all the comments about jar commands **imply** that jar files and zip files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
# are equivalent.  (Note: this isn't true due to the "0xcafe" insertion.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
# On systems which have a command line zip, test the ability to use zip
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
# to construct a jar and then use it (6387069).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
if [ -x /usr/bin/zip ]; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
	CreateZippyJar "" "-q"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
	LaunchVM "" "${RELEASE}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
# jar files shouldn't have comments, but it is possible that somebody added
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
# one by using zip -c, zip -z, zipnote or a similar utility.  On systems
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
# that have "zipnote", verify this functionality.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
# This serves a dual purpose of creating a very large "central directory
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
# entry" which validates to code to read such entries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
if [ -x /usr/bin/zipnote ]; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
	CreateFullJar "" ""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
	CommentZipFile "AfairlyLongNameEatsUpDirectorySpaceBetter20"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
	LaunchVM "" "${RELEASE}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
#
27938
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   436
# Now test specification of mJRE
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
#
27938
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   438
#   In some cases this should result in failure of the command,
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   439
#   in some cases, a warning messages, with the command succeeding.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
27938
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   442
	# Commandline use of "-version:" should fail
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   443
	#   with a message containing "no longer supported"
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   444
	LaunchVM "-version:1.10+" "Error: Specifying an alternate JDK/JRE"
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   445
	LaunchVM "-version:prettymuchanything" "Error: Specifying an alternate JDK/JRE"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
27938
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   447
	# Commandline use of "-jre-restrict-search" should now fail
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   448
	LaunchVM "-jre-restrict-search" "\-jre\-no\-restrict\-search are also no longer valid"
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   449
	# Commandline use of "-jre-no-restrict-search" should now fail
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   450
	LaunchVM "-jre-no-restrict-search" "\-jre\-no\-restrict\-search are also no longer valid"
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   451
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
27938
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   453
	# mJRE directives to use a specific version should be flagged
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   454
	#   with a warning, but the jar should be executed with the
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   455
	#   current jre
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   456
	CreateFullJar "junk request" ""
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   457
	LaunchVM "" "${RELEASE}"
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   458
        # Going to silently ignore JRE-Version setting in jar file manifest
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   459
	#LaunchVM "" "warning: The jarfile JRE-Version"
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   460
	
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
exit 0
27938
7f7f8bf64dd7 8058407: Remove Multiple JRE support in the Java launcher
ksrini
parents: 17933
diff changeset
   463