jdk/test/java/util/prefs/CheckUserPrefsStorage.sh
author khazra
Fri, 30 Nov 2012 12:00:07 -0800
changeset 14694 6d6d54dc0ae1
parent 14186 bfb891f72a79
child 14786 a9f61e0cbe61
permissions -rw-r--r--
7197662: (prefs) java/util/prefs/AddNodeChangeListener.java fails by timeout or by "couldn't get file lock" Summary: Set -Djava.util.prefs.userRoot to current working directory of user in the prefs tests Reviewed-by: alanb, chegar, weijun, dxu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14186
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
     1
#
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
     2
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
     4
#
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
     7
# published by the Free Software Foundation.
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
     8
#
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    13
# accompanied this code).
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    14
#
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    18
#
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    21
# questions.
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    22
#
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    23
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    24
# @test
14694
6d6d54dc0ae1 7197662: (prefs) java/util/prefs/AddNodeChangeListener.java fails by timeout or by "couldn't get file lock"
khazra
parents: 14186
diff changeset
    25
# @bug 7198073 7197662
14186
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    26
# @build CheckUserPrefFirst CheckUserPrefLater
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    27
# @run shell CheckUserPrefsStorage.sh
14694
6d6d54dc0ae1 7197662: (prefs) java/util/prefs/AddNodeChangeListener.java fails by timeout or by "couldn't get file lock"
khazra
parents: 14186
diff changeset
    28
# @summary Tests that user preferences are stored in the
14186
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    29
#          permanent storage
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    30
#
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    31
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    32
OS=`uname -s`
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    33
case "$OS" in
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    34
  SunOS | Linux | Darwin )
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    35
    PS=":"
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    36
    FS="/"
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    37
    ;;
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    38
  CYGWIN* )
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    39
    PS=";"
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    40
    FS="/"
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    41
    ;;
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    42
  Windows* )
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    43
    PS=";"
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    44
    FS="\\"
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    45
    ;;
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    46
  * )
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    47
    echo "Unrecognized system!"
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    48
    exit 1;
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    49
    ;;
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    50
esac
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    51
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    52
# run CheckUserPrefFirst - creates and stores a user pref
14694
6d6d54dc0ae1 7197662: (prefs) java/util/prefs/AddNodeChangeListener.java fails by timeout or by "couldn't get file lock"
khazra
parents: 14186
diff changeset
    53
${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} -Djava.util.prefs.userRoot=. CheckUserPrefFirst
14186
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    54
result=$?
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    55
if [ "$result" -ne "0" ]; then
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    56
    exit 1
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    57
fi
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    58
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    59
# run CheckUserPrefLater - Looks for the stored pref
14694
6d6d54dc0ae1 7197662: (prefs) java/util/prefs/AddNodeChangeListener.java fails by timeout or by "couldn't get file lock"
khazra
parents: 14186
diff changeset
    60
${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} -Djava.util.prefs.userRoot=. CheckUserPrefLater
14186
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    61
result=$?
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    62
if [ "$result" -ne "0" ]; then
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    63
    exit 1
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    64
fi
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    65
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    66
# no failures, exit.
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    67
exit 0
bfb891f72a79 7198073: (prefs) user prefs not saved [macosx]
khazra
parents:
diff changeset
    68