< prev index next >

test/jdk/javax/accessibility/AccessibilityProvider/basic.sh

Print this page


   1 #
   2 # Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.
   8 #
   9 # This code is distributed in the hope that it will be useful, but WITHOUT
  10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 # version 2 for more details (a copy is included in the LICENSE file that
  13 # accompanied this code).
  14 #
  15 # You should have received a copy of the GNU General Public License version
  16 # 2 along with this work; if not, write to the Free Software Foundation,
  17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 #
  19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #
  23 # @test
  24 # @key headful
  25 # @bug 8055160
  26 # @summary Unit test for javax.accessibility.AccessibilitySPI
  27 #
  28 # @build Load FooProvider BarProvider UnusedProvider
  29 # @run shell basic.sh
  30 
  31 # Command-line usage: sh basic.sh /path/to/build
  32 
  33 if [ -z "$TESTJAVA" ]; then
  34   if [ $# -lt 1 ]; then exit 1; fi
  35   TESTJAVA="$1"
  36   TESTSRC=`pwd`
  37   TESTCLASSES="`pwd`"
  38 fi
  39 
  40 JAVA="$TESTJAVA/bin/java"
  41 
  42 OS=`uname -s`
  43 case "$OS" in
  44     SunOS | Darwin | AIX )
  45       FS='/'


  71   CP="$TESTCLASSES$SEP$TESTD"
  72   echo ''
  73   sh -xc "$JAVA $SECURITY_MANAGER -Djavax.accessibility.assistive_technologies=$PROVIDER1$COMMA$PROVIDER2 -cp $CP Load $1 $2 $3" 2>&1
  74   if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
  75 }
  76 
  77 # find one provider
  78 PROVIDER1="FooProvider"
  79 go pass $PROVIDER1
  80 
  81 # start using security manager
  82 SECURITY_MANAGER="-Djava.security.manager -Djava.security.policy=$TESTSRC/accessibilityProvider.sp"
  83 
  84 # find one provider (with security manager)
  85 go pass $PROVIDER1
  86 SECURITY_MANAGER=
  87 
  88 # fail if no provider found
  89 PROVIDER1="NoProvider"
  90 go fail $PROVIDER1







  91 
  92 # setup for two providers
  93 COMMA=","
  94 
  95 # find two providers, both exist
  96 PROVIDER1="FooProvider"
  97 PROVIDER2="BarProvider"
  98 go pass $PROVIDER1 $PROVIDER2
  99 
 100 # find two providers, where second one doesn't exist
 101 PROVIDER1="FooProvider"
 102 PROVIDER2="NoProvider"
 103 go fail $PROVIDER1 $PROVIDER2
 104 
 105 # find two providers, where first one doesn't exist
 106 PROVIDER1="NoProvider"
 107 PROVIDER2="BarProvider"
 108 go fail $PROVIDER1 $PROVIDER2
 109 
 110 echo ''
   1 #
   2 # Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.
   8 #
   9 # This code is distributed in the hope that it will be useful, but WITHOUT
  10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 # version 2 for more details (a copy is included in the LICENSE file that
  13 # accompanied this code).
  14 #
  15 # You should have received a copy of the GNU General Public License version
  16 # 2 along with this work; if not, write to the Free Software Foundation,
  17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 #
  19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #
  23 # @test
  24 # @key headful
  25 # @bug 8055160 8216008
  26 # @summary Unit test for javax.accessibility.AccessibilitySPI
  27 #
  28 # @build Load FooProvider BarProvider UnusedProvider
  29 # @run shell basic.sh
  30 
  31 # Command-line usage: sh basic.sh /path/to/build
  32 
  33 if [ -z "$TESTJAVA" ]; then
  34   if [ $# -lt 1 ]; then exit 1; fi
  35   TESTJAVA="$1"
  36   TESTSRC=`pwd`
  37   TESTCLASSES="`pwd`"
  38 fi
  39 
  40 JAVA="$TESTJAVA/bin/java"
  41 
  42 OS=`uname -s`
  43 case "$OS" in
  44     SunOS | Darwin | AIX )
  45       FS='/'


  71   CP="$TESTCLASSES$SEP$TESTD"
  72   echo ''
  73   sh -xc "$JAVA $SECURITY_MANAGER -Djavax.accessibility.assistive_technologies=$PROVIDER1$COMMA$PROVIDER2 -cp $CP Load $1 $2 $3" 2>&1
  74   if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
  75 }
  76 
  77 # find one provider
  78 PROVIDER1="FooProvider"
  79 go pass $PROVIDER1
  80 
  81 # start using security manager
  82 SECURITY_MANAGER="-Djava.security.manager -Djava.security.policy=$TESTSRC/accessibilityProvider.sp"
  83 
  84 # find one provider (with security manager)
  85 go pass $PROVIDER1
  86 SECURITY_MANAGER=
  87 
  88 # fail if no provider found
  89 PROVIDER1="NoProvider"
  90 go fail $PROVIDER1
  91 
  92 # pass if none provider found
  93 PROVIDER1=
  94 go pass $PROVIDER1
  95 
  96 PROVIDER1=" "
  97 go pass $PROVIDER1
  98 
  99 # setup for two providers
 100 COMMA=","
 101 
 102 # find two providers, both exist
 103 PROVIDER1="FooProvider"
 104 PROVIDER2="BarProvider"
 105 go pass $PROVIDER1 $PROVIDER2
 106 
 107 # find two providers, where second one doesn't exist
 108 PROVIDER1="FooProvider"
 109 PROVIDER2="NoProvider"
 110 go fail $PROVIDER1 $PROVIDER2
 111 
 112 # find two providers, where first one doesn't exist
 113 PROVIDER1="NoProvider"
 114 PROVIDER2="BarProvider"
 115 go fail $PROVIDER1 $PROVIDER2
 116 
 117 echo ''
< prev index next >