./test/java/awt/Toolkit/AutoShutdown/ShowExitTest/ShowExitTest.sh

Print this page
rev 5948 : Fix for JDK-7072120
   1 #!/bin/ksh -p
   2 
   3 #
   4 # Copyright (c) 2007, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #


  47  } #end of fail()
  48 
  49 #Call this from anywhere to pass the test with a message
  50 # usage: pass "reason why the test passed if applicable"
  51 pass() 
  52  { echo "The test passed!!!"
  53    echo "$*" 1>&2
  54    exit 0
  55  } #end of pass()
  56 
  57 # end of subroutines
  58 
  59 
  60 # The beginning of the script proper
  61 
  62 # Checking for proper OS
  63 OS=`uname -s`
  64 case "$OS" in
  65    SunOS )
  66       VAR="One value for Sun"
  67       DEFAULT_JDK=/usr/local/java/jdk1.2/solaris
  68       FILESEP="/"


  69       ;;
  70 
  71    Linux )
  72       VAR="A different value for Linux"
  73       DEFAULT_JDK=/usr/local/java/jdk1.4/linux-i386
  74       FILESEP="/"


  75       ;;
  76 
  77    Windows_95 | Windows_98 | Windows_NT | Windows_ME )








  78       VAR="A different value for Win32"
  79       DEFAULT_JDK=/usr/local/java/jdk1.2/win32
  80       FILESEP="\\"


  81       ;;
  82 








  83    # catch all other OSs
  84    * )
  85       echo "Unrecognized system!  $OS"
  86       fail "Unrecognized system!  $OS"
  87       ;;
  88 esac
  89 
  90 
  91 # Want this test to run standalone as well as in the harness, so do the 
  92 #  following to copy the test's directory into the harness's scratch directory 
  93 #  and set all appropriate variables:
  94 
  95 if [ -z "${TESTJAVA}" ] ; then
  96    # TESTJAVA is not set, so the test is running stand-alone.
  97    # TESTJAVA holds the path to the root directory of the build of the JDK
  98    # to be tested.  That is, any java files run explicitly in this shell
  99    # should use TESTJAVA in the path to the java interpreter.
 100    # So, we'll set this to the JDK spec'd on the command line.  If none
 101    # is given on the command line, tell the user that and use a cheesy
 102    # default.


   1 #!/bin/ksh -p
   2 
   3 #
   4 # Copyright (c) 2007, 2012, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #


  47  } #end of fail()
  48 
  49 #Call this from anywhere to pass the test with a message
  50 # usage: pass "reason why the test passed if applicable"
  51 pass()
  52  { echo "The test passed!!!"
  53    echo "$*" 1>&2
  54    exit 0
  55  } #end of pass()
  56 
  57 # end of subroutines
  58 
  59 
  60 # The beginning of the script proper
  61 
  62 # Checking for proper OS
  63 OS=`uname -s`
  64 case "$OS" in
  65    SunOS )
  66       VAR="One value for Sun"
  67       DEFAULT_JDK=/
  68       FILESEP="/"
  69       PATHSEP=":"
  70       TMP="/tmp"
  71       ;;
  72 
  73    Linux )
  74       VAR="A different value for Linux"
  75       DEFAULT_JDK=/
  76       FILESEP="/"
  77       PATHSEP=":"
  78       TMP="/tmp"
  79       ;;
  80 
  81    Darwin )
  82       VAR="A different value for MacOSX"
  83       DEFAULT_JDK=/usr
  84       FILESEP="/"
  85       PATHSEP=":"
  86       TMP="/tmp"
  87       ;;
  88 
  89    Windows* )
  90       VAR="A different value for Win32"
  91       DEFAULT_JDK="C:/Program Files/Java/jdk1.8.0"
  92       FILESEP="\\"
  93       PATHSEP=";"
  94       TMP=`cd "${SystemRoot}/Temp"; echo ${PWD}`
  95       ;;
  96 
  97     CYGWIN* )
  98       VAR="A different value for Cygwin"
  99       DEFAULT_JDK="/cygdrive/c/Program\ Files/Java/jdk1.8.0"
 100       FILESEP="/"
 101       PATHSEP=";"
 102       TMP=`cd "${SystemRoot}/Temp"; echo ${PWD}`
 103       ;;
 104 
 105    # catch all other OSs
 106    * )
 107       echo "Unrecognized system!  $OS"
 108       fail "Unrecognized system!  $OS"
 109       ;;
 110 esac
 111 
 112 
 113 # Want this test to run standalone as well as in the harness, so do the
 114 #  following to copy the test's directory into the harness's scratch directory
 115 #  and set all appropriate variables:
 116 
 117 if [ -z "${TESTJAVA}" ] ; then
 118    # TESTJAVA is not set, so the test is running stand-alone.
 119    # TESTJAVA holds the path to the root directory of the build of the JDK
 120    # to be tested.  That is, any java files run explicitly in this shell
 121    # should use TESTJAVA in the path to the java interpreter.
 122    # So, we'll set this to the JDK spec'd on the command line.  If none
 123    # is given on the command line, tell the user that and use a cheesy
 124    # default.