UsePolicy.sh revision 5116:d45bc4307996
150476Speter#
21987Swollman# Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
31987Swollman# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
41987Swollman#
5100346Sru# This code is free software; you can redistribute it and/or modify it
6100346Sru# under the terms of the GNU General Public License version 2 only, as
7100346Sru# published by the Free Software Foundation.
8100346Sru#
9100346Sru# This code is distributed in the hope that it will be useful, but WITHOUT
10100346Sru# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11100346Sru# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12100346Sru# version 2 for more details (a copy is included in the LICENSE file that
13100346Sru# accompanied this code).
14100346Sru#
15100346Sru# You should have received a copy of the GNU General Public License version
16100346Sru# 2 along with this work; if not, write to the Free Software Foundation,
17100346Sru# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18100346Sru#
19100346Sru# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20100346Sru# or visit www.oracle.com if you need additional information or have any
21100346Sru# questions.
22100346Sru#
23100346Sru
24100346Sru# @test
25100346Sru# @bug 4273771
26100346Sru# @summary Need to add "usePolicy" RuntimePermission to policytool
27100346Sru#
28100346Sru# @run applet/manual=done UsePolicy.html
29100346Sru# @run shell UsePolicy.sh
30100346Sru# @run applet/manual=yesno UsePolicy.html
31100346Sru
32100346Sru# set a few environment variables so that the shell-script can run stand-alone
33100346Sru# in the source directory
34100346Sruif [ "${TESTSRC}" = "" ] ; then
35132211Sscottl  TESTSRC="."
364257Sphkfi
37100346Sruif [ "${TESTCLASSES}" = "" ] ; then
38100346Sru  TESTCLASSES="."
39100346Srufi
40100346Sruif [ "${TESTJAVA}" = "" ] ; then
41100346Sru  echo "TESTJAVA not set.  Test cannot execute."
42100346Sru  echo "FAILED!!!"
43100346Sru  exit 1
44100346Srufi
45100346Sru
46100346Sru# set platform-dependent variables
47100346SruOS=`uname -s`
48100346Srucase "$OS" in
49100346Sru  SunOS | Linux | Darwin )
50100346Sru    NULL=/dev/null
51100346Sru    PS=":"
52100346Sru    FS="/"
53100346Sru    ;;
54100346Sru  Windows* )
55100346Sru    NULL=NUL
56100346Sru    PS=";"
57100346Sru    FS="\\"
58100346Sru    ;;
59100346Sru  * )
60100346Sru    echo "Unrecognized system!"
61100346Sru    exit 1;
62100346Sru    ;;
63100346Sruesac
64100346Sru
65100346Sru# the test code
66100346Sru
67100346Sruecho "HELLO!"
68100346Sru
69100346Sru${TESTJAVA}${FS}bin${FS}policytool
70100346Sru
71100346Sruexit $?
72100346Sru
73100346Sru