5381N/A#
5381N/A# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
5381N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5381N/A#
5381N/A# This code is free software; you can redistribute it and/or modify it
5381N/A# under the terms of the GNU General Public License version 2 only, as
5381N/A# published by the Free Software Foundation.
5381N/A#
5381N/A# This code is distributed in the hope that it will be useful, but WITHOUT
5381N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5381N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5381N/A# version 2 for more details (a copy is included in the LICENSE file that
5381N/A# accompanied this code).
5381N/A#
5381N/A# You should have received a copy of the GNU General Public License version
5381N/A# 2 along with this work; if not, write to the Free Software Foundation,
5381N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5381N/A#
5381N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5381N/A# or visit www.oracle.com if you need additional information or have any
5381N/A# questions.
5381N/A#
5381N/A
5381N/A# @test
5853N/A# @bug 7198073 7197662
5381N/A# @build CheckUserPrefFirst CheckUserPrefLater
5381N/A# @run shell CheckUserPrefsStorage.sh
5853N/A# @summary Tests that user preferences are stored in the
5381N/A# permanent storage
5381N/A#
5381N/A
5381N/AOS=`uname -s`
5381N/Acase "$OS" in
5381N/A SunOS | Linux | Darwin )
5381N/A PS=":"
5381N/A FS="/"
5381N/A ;;
5381N/A CYGWIN* )
5381N/A PS=";"
5381N/A FS="/"
5381N/A ;;
5381N/A Windows* )
5381N/A PS=";"
5381N/A FS="\\"
5381N/A ;;
5381N/A * )
5381N/A echo "Unrecognized system!"
5381N/A exit 1;
5381N/A ;;
5381N/Aesac
5381N/A
5381N/A# run CheckUserPrefFirst - creates and stores a user pref
5853N/A${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} -Djava.util.prefs.userRoot=. CheckUserPrefFirst
5381N/Aresult=$?
5381N/Aif [ "$result" -ne "0" ]; then
5381N/A exit 1
5381N/Afi
5381N/A
5381N/A# run CheckUserPrefLater - Looks for the stored pref
5853N/A${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} -Djava.util.prefs.userRoot=. CheckUserPrefLater
5381N/Aresult=$?
5381N/Aif [ "$result" -ne "0" ]; then
5381N/A exit 1
5381N/Afi
5381N/A
5381N/A# no failures, exit.
5381N/Aexit 0
5381N/A