test/jdk/javax/imageio/metadata/IIOMetadataFormat/runMetadataFormatThreadTest.sh
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 22965 jdk/test/javax/imageio/metadata/IIOMetadataFormat/runMetadataFormatThreadTest.sh@78610fb00fff
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13769
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
     1
#!/bin/ksh -p
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
     2
#
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
     3
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
     4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
     5
#
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
     6
# This code is free software; you can redistribute it and/or modify it
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
     7
# under the terms of the GNU General Public License version 2 only, as
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
     8
# published by the Free Software Foundation.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
     9
#
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    10
# This code is distributed in the hope that it will be useful, but WITHOUT
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    12
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    13
# version 2 for more details (a copy is included in the LICENSE file that
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    14
# accompanied this code).
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    15
#
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    16
# You should have received a copy of the GNU General Public License version
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    17
# 2 along with this work; if not, write to the Free Software Foundation,
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    18
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    19
#
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    20
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    21
# or visit www.oracle.com if you need additional information or have any
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    22
# questions.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    23
#
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    24
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    25
#
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    26
#   @test
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    27
#   @bug        4929170 7078379
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    28
#   @summary    Tests that user-supplied IIOMetadata implementations 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    29
#                loaded by separate classloader in separate thread  
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    30
#                is able to load correspnding IIOMetadataFormat 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    31
#                implementations.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    32
#   @author     Andrew Brygin
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    33
#
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    34
#   @compile    UserPluginMetadataFormatTest.java MetadataFormatThreadTest.java MetadataTest.java
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    35
#   @run shell/timeout=60 runMetadataFormatThreadTest.sh
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    36
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    37
# Note!!!! JavaCodeForYourTest_CHANGE_THIS.java must be changed or deleted.  
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    38
# If there is any java code which will be executed during the test, it must 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    39
# be compiled by the line above.  If multiple .java files, separate the 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    40
# files by spaces on that line.  See testing page of AWT home page for
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    41
# pointers to the testharness spec. and FAQ.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    42
# Note!!!! Change AppletDeadlock.sh to the name of your test!!!!
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    43
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    44
# There are several resources which need to be present before many 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    45
#  shell scripts can run.  Following are examples of how to check for
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    46
#  many common ones.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    47
# 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    48
# Note that the shell used is the Korn Shell, KSH
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    49
#
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    50
# Also note, it is recommended that make files NOT be used.  Rather,
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    51
#  put the individual commands directly into this file.  That way,
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    52
#  it is possible to use command line arguments and other shell tech-
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    53
#  niques to find the compiler, etc on different systems.  For example,
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    54
#  a different path could be used depending on whether this were a
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    55
#  Solaris or Win32 machine, which is more difficult (if even possible)
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    56
#  in a make file.  
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    57
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    58
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    59
# Beginning of subroutines:
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    60
status=1
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    61
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    62
#Call this from anywhere to fail the test with an error message
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    63
# usage: fail "reason why the test failed"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    64
fail() 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    65
 { echo "The test failed :-("
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    66
   echo "$*" 1>&2
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    67
   exit 1
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    68
 } #end of fail()
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    69
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    70
#Call this from anywhere to pass the test with a message
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    71
# usage: pass "reason why the test passed if applicable"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    72
pass() 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    73
 { echo "The test passed!!!"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    74
   echo "$*" 1>&2
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    75
   exit 0
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    76
 } #end of pass()
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    77
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    78
# end of subroutines
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    79
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    80
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    81
# The beginning of the script proper
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    82
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    83
# Checking for proper OS
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    84
OS=`uname -s`
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    85
case "$OS" in
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    86
   SunOS )
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    87
      VAR="One value for Sun"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    88
      DEFAULT_JDK=/none
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    89
      #DEFAULT_JDK=/usr/local/java/jdk1.2/solaris
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    90
      FILESEP="/"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    91
      ;;
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    92
22602
0d9a07b0d7e9 8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents: 13769
diff changeset
    93
   Linux | Darwin | AIX )
13769
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    94
      VAR="A different value for Linux"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    95
      DEFAULT_JDK=/none
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    96
      #DEFAULT_JDK=/usr/local/java/jdk1.4/linux-i386
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    97
      FILESEP="/"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    98
      ;;
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
    99
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   100
   Windows_95 | Windows_98 | Windows_NT | Windows_ME )
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   101
      VAR="A different value for Win32"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   102
      DEFAULT_JDK=/none
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   103
      #DEFAULT_JDK=/usr/local/java/jdk1.2/win32
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   104
      FILESEP="\\"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   105
      ;;
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   106
    
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   107
    CYGWIN* )
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   108
      VAR="A different value for CYGWIN"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   109
      DEFAULT_JDK=/none
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   110
      FILESEP="/"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   111
      ;;
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   112
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   113
   # catch all other OSs
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   114
   * )
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   115
      echo "Unrecognized system!  $OS"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   116
      fail "Unrecognized system!  $OS"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   117
      ;;
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   118
esac
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   119
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   120
# check that some executable or other file you need is available, abort if not
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   121
#  note that the name of the executable is in the fail string as well.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   122
# this is how to check for presence of the compiler, etc.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   123
#RESOURCE=`whence SomeProgramOrFileNeeded`
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   124
#if [ "${RESOURCE}" = "" ] ; 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   125
#   then fail "Need SomeProgramOrFileNeeded to perform the test" ; 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   126
#fi
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   127
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   128
# IT'S FINE TO DELETE THIS IF NOT NEEDED!
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   129
# check if an environment variable you need is set, give it a default if not
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   130
#if [ -z "${NEEDED_VAR}" ] ; then
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   131
#   # The var is NOT set, so give it a default
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   132
#   NEEDED_VAR=/some/default/value/such/as/a/path
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   133
#fi
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   134
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   135
# IT'S FINE TO DELETE THIS IF NOT NEEDED!
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   136
#if [ -z "${NEEDED_LATER_VAR}" ] ; then
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   137
#   # The var is NOT set, so give it a default
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   138
#   # will need it in other scripts called from this one, so export it
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   139
#   NEEDED_LATER_VAR="/a/different/path/note/the/quotes"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   140
#   export NEEDED_LATER_VAR
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   141
#fi
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   142
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   143
# Want this test to run standalone as well as in the harness, so do the 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   144
#  following to copy the test's directory into the harness's scratch directory 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   145
#  and set all appropriate variables:
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   146
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   147
if [ -z "${TESTJAVA}" ] ; then
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   148
   # TESTJAVA is not set, so the test is running stand-alone.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   149
   # TESTJAVA holds the path to the root directory of the build of the JDK
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   150
   # to be tested.  That is, any java files run explicitly in this shell
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   151
   # should use TESTJAVA in the path to the java interpreter.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   152
   # So, we'll set this to the JDK spec'd on the command line.  If none
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   153
   # is given on the command line, tell the user that and use a cheesy
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   154
   # default.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   155
   # THIS IS THE JDK BEING TESTED.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   156
   if [ -n "$1" ] ;
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   157
      then TESTJAVA=$1
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   158
      else echo "no JDK specified on command line so using default!"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   159
	 TESTJAVA=$DEFAULT_JDK
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   160
   fi
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   161
   TESTSRC=.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   162
   TESTCLASSES=.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   163
   STANDALONE=1;
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   164
fi
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   165
echo "JDK under test is: $TESTJAVA"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   166
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   167
#Deal with .class files:
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   168
if [ -n "${STANDALONE}" ] ; 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   169
   then 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   170
   #if standalone, remind user to cd to dir. containing test before running it
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   171
   echo "Just a reminder: cd to the dir containing this test when running it"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   172
   # then compile all .java files (if there are any) into .class files
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   173
   if [ -a *.java ] ; 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   174
      then echo "Reminder, this test should be in its own directory with all"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   175
      echo "supporting files it needs in the directory with it."
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   176
      ${TESTJAVA}/bin/javac ./*.java ; 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   177
   fi
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   178
   # else in harness so copy all the class files from where jtreg put them
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   179
   # over to the scratch directory this test is running in. 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   180
   else cp ${TESTCLASSES}/*.class . ;
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   181
fi
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   182
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   183
#if in test harness, then copy the entire directory that the test is in over 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   184
# to the scratch directory.  This catches any support files needed by the test.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   185
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   186
#if [ -z "${STANDALONE}" ] ; 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   187
#   then cp ${TESTSRC}/* . 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   188
#fi
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   189
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   190
#Just before executing anything, make sure it has executable permission!
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   191
chmod 777 ./*
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   192
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   193
###############  YOUR TEST CODE HERE!!!!!!!  #############
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   194
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   195
#All files required for the test should be in the same directory with
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   196
# this file.  If converting a standalone test to run with the harness,
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   197
# as long as all files are in the same directory and it returns 0 for
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   198
# pass, you should be able to cut and paste it into here and it will
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   199
# run with the test harness.
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   200
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   201
# This is an example of running something -- test
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   202
# The stuff below catches the exit status of test then passes or fails
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   203
# this shell test as appropriate ( 0 status is considered a pass here )
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   204
#./test # DELETE THIS LINE AND REPLACE WITH YOUR OWN COMMAND!!!
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   205
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   206
if [ -d ./test_classes ] ; then 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   207
    rm -rf ./test_calsses
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   208
fi
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   209
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   210
mkdir ./test_classes
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   211
 
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   212
# split application classes and test plugin classes
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   213
mv ./UserPluginMetadataFormatTest*.class ./test_classes
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   214
22965
78610fb00fff 8028711: TEST_BUG: Shell tests should pass through VM options
alanb
parents: 22602
diff changeset
   215
$TESTJAVA/bin/java ${TESTVMOPTS} \
78610fb00fff 8028711: TEST_BUG: Shell tests should pass through VM options
alanb
parents: 22602
diff changeset
   216
    MetadataFormatThreadTest test_classes UserPluginMetadataFormatTest
13769
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   217
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   218
###############  END YOUR TEST CODE !!!!! ############
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   219
status=$?
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   220
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   221
# pass or fail the test based on status of the command
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   222
if [ $status -eq "0" ];
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   223
   then pass "Test passed - no stack trace printing"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   224
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   225
   else fail "Test failure - stack trace was printed"
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   226
fi
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   227
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   228
#For additional examples of how to write platform independent KSH scripts,
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   229
# see the jtreg file itself.  It is a KSH script for both Solaris and Win32
ba52da5186ad 7186799: Regression tests for ImageIO metadata fail on second run
bae
parents:
diff changeset
   230