< prev index next >

test/jdk/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh

Print this page
rev 59383 : [mq]: final
   1 #!/bin/ksh -p
   2 
   3 #
   4 # Copyright (c) 2012, 2018, 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 #


  42    echo "exit status was $status"
  43    exit $status
  44  } #end of fail()
  45 
  46 #Call this from anywhere to pass the test with a message
  47 # usage: pass "reason why the test passed if applicable"
  48 pass() 
  49  { echo "The test passed!!!"
  50    echo "$*" 1>&2
  51    exit 0
  52  } #end of pass()
  53 
  54 # end of subroutines
  55 
  56 
  57 # The beginning of the script proper
  58 
  59 # Checking for proper OS
  60 OS=`uname -s`
  61 case "$OS" in
  62    AIX | CYGWIN* | Darwin | Linux | SunOS )
  63       FILESEP="/"
  64       ;;
  65     
  66    Windows* )
  67       FILESEP="\\"
  68       ;;
  69 
  70    # catch all other OSs
  71    * )
  72       echo "Unrecognized system!  $OS"
  73       fail "Unrecognized system!  $OS"
  74       ;;
  75 esac
  76 
  77 # check that some executable or other file you need is available, abort if not
  78 #  note that the name of the executable is in the fail string as well.
  79 # this is how to check for presence of the compiler, etc.
  80 #RESOURCE=`whence SomeProgramOrFileNeeded`
  81 #if [ "${RESOURCE}" = "" ] ; 
  82 #   then fail "Need SomeProgramOrFileNeeded to perform the test" ; 


 105 fi
 106 echo "JDK under test is: $TESTJAVA"
 107 
 108 #if in test harness, then copy the entire directory that the test is in over 
 109 # to the scratch directory.  This catches any support files needed by the test.
 110 if [ -z "${STANDALONE}" ] ; 
 111    then cp ${TESTSRC}/* . 
 112 fi
 113 case "$OS" in
 114   Windows* | CYGWIN* )
 115     ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} \
 116                          --add-exports java.desktop/sun.awt=ALL-UNNAMED \
 117                          --add-exports java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \
 118                          *.java
 119     status=$?
 120     if [ ! $status -eq "0" ]; then
 121       fail "Compilation failed";
 122     fi
 123     ;;
 124 
 125   AIX | Linux | SunOS )
 126     ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} \
 127                          --add-exports java.desktop/sun.awt=ALL-UNNAMED \
 128                          --add-exports java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \
 129                          *.java
 130     status=$?
 131     if [ ! $status -eq "0" ]; then
 132       fail "Compilation failed";
 133     fi
 134     ;;
 135 
 136   Darwin)
 137     ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} \
 138                          --add-exports java.desktop/sun.awt=ALL-UNNAMED \
 139                          --add-exports java.desktop/sun.lwawt.macosx=ALL-UNNAMED ${CP} \
 140                          *.java
 141     status=$?
 142     if [ ! $status -eq "0" ]; then
 143       fail "Compilation failed";
 144     fi
 145     ;;


 155   Windows* | CYGWIN* )
 156     ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \
 157                          --add-opens java.desktop/sun.awt=ALL-UNNAMED \
 158                          --add-opens java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \
 159                          TestWrapped sun.awt.windows.WToolkit
 160     status=$?
 161     if [ ! $status -eq "0" ]; then
 162       fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.awt.windows.WToolkit";
 163     fi
 164     ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \
 165                          --add-opens java.desktop/sun.awt=ALL-UNNAMED \
 166                          --add-opens java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \
 167                          -Dawt.toolkit=sun.awt.windows.WToolkit \
 168                          TestWrapped sun.awt.windows.WToolkit
 169     status=$?
 170     if [ ! $status -eq "0" ]; then
 171       fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.awt.windows.WToolkit";
 172     fi
 173     ;;
 174 
 175   AIX | Linux | SunOS )
 176     ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \
 177                          --add-opens java.desktop/sun.awt=ALL-UNNAMED \
 178                          --add-opens java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \
 179                          -Dawt.toolkit=sun.awt.X11.XToolkit \
 180                          TestWrapped sun.awt.X11.XToolkit
 181     status=$?
 182     if [ ! $status -eq "0" ]; then
 183       fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.awt.xawt.XToolkit";
 184     fi
 185     AWT_TOOLKIT=XToolkit ${TESTJAVA}/bin/java ${TESTVMOPTS} \
 186                          --add-opens java.desktop/sun.awt=ALL-UNNAMED \
 187                          --add-opens java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \
 188                                               -Djava.awt.headless=true \
 189                                               TestWrapped sun.awt.X11.XToolkit
 190     status=$?
 191     if [ ! $status -eq "0" ]; then
 192       fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.awt.xawt.XToolkit";
 193     fi
 194     ;;
 195 


   1 #!/bin/ksh -p
   2 
   3 #
   4 # Copyright (c) 2012, 2020, 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 #


  42    echo "exit status was $status"
  43    exit $status
  44  } #end of fail()
  45 
  46 #Call this from anywhere to pass the test with a message
  47 # usage: pass "reason why the test passed if applicable"
  48 pass() 
  49  { echo "The test passed!!!"
  50    echo "$*" 1>&2
  51    exit 0
  52  } #end of pass()
  53 
  54 # end of subroutines
  55 
  56 
  57 # The beginning of the script proper
  58 
  59 # Checking for proper OS
  60 OS=`uname -s`
  61 case "$OS" in
  62    AIX | CYGWIN* | Darwin | Linux )
  63       FILESEP="/"
  64       ;;
  65     
  66    Windows* )
  67       FILESEP="\\"
  68       ;;
  69 
  70    # catch all other OSs
  71    * )
  72       echo "Unrecognized system!  $OS"
  73       fail "Unrecognized system!  $OS"
  74       ;;
  75 esac
  76 
  77 # check that some executable or other file you need is available, abort if not
  78 #  note that the name of the executable is in the fail string as well.
  79 # this is how to check for presence of the compiler, etc.
  80 #RESOURCE=`whence SomeProgramOrFileNeeded`
  81 #if [ "${RESOURCE}" = "" ] ; 
  82 #   then fail "Need SomeProgramOrFileNeeded to perform the test" ; 


 105 fi
 106 echo "JDK under test is: $TESTJAVA"
 107 
 108 #if in test harness, then copy the entire directory that the test is in over 
 109 # to the scratch directory.  This catches any support files needed by the test.
 110 if [ -z "${STANDALONE}" ] ; 
 111    then cp ${TESTSRC}/* . 
 112 fi
 113 case "$OS" in
 114   Windows* | CYGWIN* )
 115     ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} \
 116                          --add-exports java.desktop/sun.awt=ALL-UNNAMED \
 117                          --add-exports java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \
 118                          *.java
 119     status=$?
 120     if [ ! $status -eq "0" ]; then
 121       fail "Compilation failed";
 122     fi
 123     ;;
 124 
 125   AIX | Linux )
 126     ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} \
 127                          --add-exports java.desktop/sun.awt=ALL-UNNAMED \
 128                          --add-exports java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \
 129                          *.java
 130     status=$?
 131     if [ ! $status -eq "0" ]; then
 132       fail "Compilation failed";
 133     fi
 134     ;;
 135 
 136   Darwin)
 137     ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} \
 138                          --add-exports java.desktop/sun.awt=ALL-UNNAMED \
 139                          --add-exports java.desktop/sun.lwawt.macosx=ALL-UNNAMED ${CP} \
 140                          *.java
 141     status=$?
 142     if [ ! $status -eq "0" ]; then
 143       fail "Compilation failed";
 144     fi
 145     ;;


 155   Windows* | CYGWIN* )
 156     ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \
 157                          --add-opens java.desktop/sun.awt=ALL-UNNAMED \
 158                          --add-opens java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \
 159                          TestWrapped sun.awt.windows.WToolkit
 160     status=$?
 161     if [ ! $status -eq "0" ]; then
 162       fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.awt.windows.WToolkit";
 163     fi
 164     ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \
 165                          --add-opens java.desktop/sun.awt=ALL-UNNAMED \
 166                          --add-opens java.desktop/sun.awt.windows=ALL-UNNAMED ${CP} \
 167                          -Dawt.toolkit=sun.awt.windows.WToolkit \
 168                          TestWrapped sun.awt.windows.WToolkit
 169     status=$?
 170     if [ ! $status -eq "0" ]; then
 171       fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.awt.windows.WToolkit";
 172     fi
 173     ;;
 174 
 175   AIX | Linux )
 176     ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \
 177                          --add-opens java.desktop/sun.awt=ALL-UNNAMED \
 178                          --add-opens java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \
 179                          -Dawt.toolkit=sun.awt.X11.XToolkit \
 180                          TestWrapped sun.awt.X11.XToolkit
 181     status=$?
 182     if [ ! $status -eq "0" ]; then
 183       fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.awt.xawt.XToolkit";
 184     fi
 185     AWT_TOOLKIT=XToolkit ${TESTJAVA}/bin/java ${TESTVMOPTS} \
 186                          --add-opens java.desktop/sun.awt=ALL-UNNAMED \
 187                          --add-opens java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \
 188                                               -Djava.awt.headless=true \
 189                                               TestWrapped sun.awt.X11.XToolkit
 190     status=$?
 191     if [ ! $status -eq "0" ]; then
 192       fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.awt.xawt.XToolkit";
 193     fi
 194     ;;
 195 


< prev index next >