UsePolicy.sh revision 9195:f04b825b1c0c
1251881Speter#
2251881Speter# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
3251881Speter# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4251881Speter#
5251881Speter# This code is free software; you can redistribute it and/or modify it
6251881Speter# under the terms of the GNU General Public License version 2 only, as
7251881Speter# published by the Free Software Foundation.
8251881Speter#
9251881Speter# This code is distributed in the hope that it will be useful, but WITHOUT
10251881Speter# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11251881Speter# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12251881Speter# version 2 for more details (a copy is included in the LICENSE file that
13251881Speter# accompanied this code).
14251881Speter#
15251881Speter# You should have received a copy of the GNU General Public License version
16251881Speter# 2 along with this work; if not, write to the Free Software Foundation,
17251881Speter# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18251881Speter#
19251881Speter# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20251881Speter# or visit www.oracle.com if you need additional information or have any
21251881Speter# questions.
22251881Speter#
23251881Speter
24251881Speter# @test
25251881Speter# @bug 4273771
26251881Speter# @summary Need to add "usePolicy" RuntimePermission to policytool
27251881Speter#
28251881Speter# @run applet/manual=done UsePolicy.html
29251881Speter# @run shell UsePolicy.sh
30251881Speter# @run applet/manual=yesno UsePolicy.html
31251881Speter
32251881Speter# set a few environment variables so that the shell-script can run stand-alone
33251881Speter# in the source directory
34251881Speterif [ "${TESTSRC}" = "" ] ; then
35251881Speter  TESTSRC="."
36251881Speterfi
37251881Speterif [ "${TESTCLASSES}" = "" ] ; then
38251881Speter  TESTCLASSES="."
39251881Speterfi
40251881Speterif [ "${TESTJAVA}" = "" ] ; then
41251881Speter  echo "TESTJAVA not set.  Test cannot execute."
42251881Speter  echo "FAILED!!!"
43251881Speter  exit 1
44251881Speterfi
45251881Speter
46251881Speter# set platform-dependent variables
47251881SpeterOS=`uname -s`
48251881Spetercase "$OS" in
49251881Speter  SunOS | Linux | Darwin | AIX )
50251881Speter    NULL=/dev/null
51251881Speter    PS=":"
52251881Speter    FS="/"
53251881Speter    ;;
54251881Speter  CYGWIN* )
55251881Speter    NULL=/dev/null
56251881Speter    PS=";"
57251881Speter    FS="/"
58251881Speter    ;;
59251881Speter  Windows* )
60251881Speter    NULL=NUL
61251881Speter    PS=";"
62251881Speter    FS="\\"
63251881Speter    ;;
64251881Speter  * )
65251881Speter    echo "Unrecognized system!"
66251881Speter    exit 1;
67251881Speter    ;;
68251881Speteresac
69251881Speter
70251881Speter# the test code
71251881Speter
72251881Speterecho "HELLO!"
73251881Speter
74251881Speter${TESTJAVA}${FS}bin${FS}policytool
75251881Speter
76251881Speterexit $?
77251881Speter
78251881Speter