jdk/test/tools/launcher/MultipleJRE.sh
changeset 28424 3e9d7d7dd362
parent 28109 c510e26fcd55
equal deleted inserted replaced
28423:0bf78b38bc0b 28424:3e9d7d7dd362
    85 	prefix="`echo "$mess" | cut -d ' ' -f 1-3`"
    85 	prefix="`echo "$mess" | cut -d ' ' -f 1-3`"
    86 	if [ "$prefix" != "Error: Syntax error" ]; then
    86 	if [ "$prefix" != "Error: Syntax error" ]; then
    87 		echo "Unexpected error message for invalid syntax $1"
    87 		echo "Unexpected error message for invalid syntax $1"
    88 		exit 1
    88 		exit 1
    89 	fi
    89 	fi
    90 }
       
    91 
       
    92 #
       
    93 # Shell routine to ensure help page does not include mjre options
       
    94 #
       
    95 TestHelp() {
       
    96     mess="`$JAVA -help 2>&1`"
       
    97     # make sure it worked
       
    98     if [ $? -ne 0 ]; then
       
    99         echo "java -help failed ????"
       
   100         exit 1
       
   101     fi
       
   102 
       
   103     echo $mess | grep '\-version:<value>' > /dev/null 2>&1
       
   104     if [ $? -eq 0 ]; then
       
   105        echo "help message contains obsolete option version:<value>"
       
   106        exit 1
       
   107     fi
       
   108 
       
   109     echo $mess | grep '\-jre-restrict-search' > /dev/null 2>&1
       
   110     if [ $? -eq 0 ]; then
       
   111        echo "help message contains obsolete option jre-restrict-search"
       
   112        exit 1
       
   113     fi
       
   114 
       
   115     echo $mess | grep '\-no-jre-restrict-search' > /dev/null 2>&1
       
   116     if [ $? -eq 0 ]; then
       
   117        echo "help message contains obsolete option no-jre-restrict-search"
       
   118        exit 1
       
   119     fi
       
   120 }
    90 }
   121 
    91 
   122 #
    92 #
   123 # Just as the name says.  We sprinkle these in the appropriate location
    93 # Just as the name says.  We sprinkle these in the appropriate location
   124 # in the test file system and they just say who they are pretending to be.
    94 # in the test file system and they just say who they are pretending to be.
   459 	CreateFullJar "" ""
   429 	CreateFullJar "" ""
   460 	CommentZipFile "AfairlyLongNameEatsUpDirectorySpaceBetter20"
   430 	CommentZipFile "AfairlyLongNameEatsUpDirectorySpaceBetter20"
   461 	LaunchVM "" "${RELEASE}"
   431 	LaunchVM "" "${RELEASE}"
   462 fi
   432 fi
   463 
   433 
   464 #
       
   465 # Now test specification of mJRE
       
   466 #
       
   467 #   In some cases this should result in failure of the command,
       
   468 #   in some cases, a warning messages, with the command succeeding.
       
   469 #
       
   470 
       
   471 	# Commandline use of "-version:" should fail
       
   472 	#   with a message containing "no longer supported"
       
   473 	LaunchVM "-version:1.10+" "Error: Specifying an alternate JDK/JRE"
       
   474 	LaunchVM "-version:prettymuchanything" "Error: Specifying an alternate JDK/JRE"
       
   475 
       
   476 	# Commandline use of "-jre-restrict-search" should now fail
       
   477 	LaunchVM "-jre-restrict-search" "\-jre\-no\-restrict\-search are also no longer valid"
       
   478 	# Commandline use of "-jre-no-restrict-search" should now fail
       
   479 	LaunchVM "-jre-no-restrict-search" "\-jre\-no\-restrict\-search are also no longer valid"
       
   480 
       
   481 
       
   482 	# mJRE directives to use a specific version should be flagged
       
   483 	#   with a warning, but the jar should be executed with the
       
   484 	#   current jre
       
   485 	CreateFullJar "junk request" ""
       
   486 	LaunchVM "" "${RELEASE}"
       
   487         # Going to silently ignore JRE-Version setting in jar file manifest
       
   488 	#LaunchVM "" "warning: The jarfile JRE-Version"
       
   489 
       
   490 	# Verify help does not contain obsolete options
       
   491 	TestHelp
       
   492 
       
   493 exit 0
   434 exit 0