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
--- a/jdk/test/java/util/prefs/AddNodeChangeListener.java Fri Nov 30 09:47:17 2012 +0100
+++ b/jdk/test/java/util/prefs/AddNodeChangeListener.java Fri Nov 30 12:00:07 2012 -0800
@@ -24,9 +24,10 @@
*/
/* @test
- * @bug 7160252
+ * @bug 7160252 7197662
* @summary Checks if events are delivered to a listener
* when a child node is added or removed
+ * @run main/othervm -Djava.util.prefs.userRoot=. AddNodeChangeListener
*/
import java.util.prefs.*;
--- a/jdk/test/java/util/prefs/CheckUserPrefsStorage.sh Fri Nov 30 09:47:17 2012 +0100
+++ b/jdk/test/java/util/prefs/CheckUserPrefsStorage.sh Fri Nov 30 12:00:07 2012 -0800
@@ -22,10 +22,10 @@
#
# @test
-# @bug 7198073
+# @bug 7198073 7197662
# @build CheckUserPrefFirst CheckUserPrefLater
# @run shell CheckUserPrefsStorage.sh
-# @summary Tests that user preferences are stored in the
+# @summary Tests that user preferences are stored in the
# permanent storage
#
@@ -50,14 +50,14 @@
esac
# run CheckUserPrefFirst - creates and stores a user pref
-${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} CheckUserPrefFirst
+${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} -Djava.util.prefs.userRoot=. CheckUserPrefFirst
result=$?
if [ "$result" -ne "0" ]; then
exit 1
fi
# run CheckUserPrefLater - Looks for the stored pref
-${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} CheckUserPrefLater
+${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} -Djava.util.prefs.userRoot=. CheckUserPrefLater
result=$?
if [ "$result" -ne "0" ]; then
exit 1
--- a/jdk/test/java/util/prefs/CommentsInXml.java Fri Nov 30 09:47:17 2012 +0100
+++ b/jdk/test/java/util/prefs/CommentsInXml.java Fri Nov 30 12:00:07 2012 -0800
@@ -23,8 +23,9 @@
/*
* @test
- * @bug 4619564
+ * @bug 4619564 7197662
* @summary XMl Comments in Preferences File lead to ClassCastException
+ * @run main/othervm -Djava.util.prefs.userRoot=. CommentsInXml
* @author kladko
*/
--- a/jdk/test/java/util/prefs/ConflictInFlush.java Fri Nov 30 09:47:17 2012 +0100
+++ b/jdk/test/java/util/prefs/ConflictInFlush.java Fri Nov 30 12:00:07 2012 -0800
@@ -23,8 +23,9 @@
/*
* @test
- * @bug 4703132
+ * @bug 4703132 7197662
* @summary flush() throws an IllegalStateException on a removed node
+ * @run main/othervm -Djava.util.prefs.userRoot=. ConflictInFlush
* @author Sucheta Dambalkar
*/
--- a/jdk/test/java/util/prefs/ExportNode.java Fri Nov 30 09:47:17 2012 +0100
+++ b/jdk/test/java/util/prefs/ExportNode.java Fri Nov 30 12:00:07 2012 -0800
@@ -24,9 +24,10 @@
/*
* @test
- * @bug 4387136 4947349
+ * @bug 4387136 4947349 7197662
* @summary Due to a bug in XMLSupport.putPreferencesInXml(...),
* node's keys would not get exported.
+ * @run main/othervm -Djava.util.prefs.userRoot=. ExportNode
* @author Konstantin Kladko
*/
import java.util.prefs.*;
--- a/jdk/test/java/util/prefs/ExportSubtree.java Fri Nov 30 09:47:17 2012 +0100
+++ b/jdk/test/java/util/prefs/ExportSubtree.java Fri Nov 30 12:00:07 2012 -0800
@@ -23,9 +23,10 @@
/* @test
- @bug 6203576 4700020
- @summary checks if the output of exportSubtree() is identical to
- the output from previous release.
+ * @bug 6203576 4700020 7197662
+ * @summary checks if the output of exportSubtree() is identical to
+ * the output from previous release.
+ * @run main/othervm -Djava.util.prefs.userRoot=. ExportSubtree
*/
import java.io.*;
--- a/jdk/test/java/util/prefs/PrefsSpi.sh Fri Nov 30 09:47:17 2012 +0100
+++ b/jdk/test/java/util/prefs/PrefsSpi.sh Fri Nov 30 12:00:07 2012 -0800
@@ -24,7 +24,7 @@
#
# @test
-# @bug 4991526 6514993
+# @bug 4991526 6514993 7197662
# @summary Unit test for Preferences jar providers
#
# @build PrefsSpi
@@ -89,12 +89,16 @@
Sys "$java" "-cp" "$TESTCLASSES${CPS}extDir/PrefsSpi.jar" \
-Djava.util.prefs.PreferencesFactory=StubPreferencesFactory \
+ -Djava.util.prefs.userRoot=. \
PrefsSpi "StubPreferences"
Sys "$java" "-cp" "$TESTCLASSES" \
+ -Djava.util.prefs.userRoot=. \
PrefsSpi "java.util.prefs.*"
Sys "$java" "-cp" "$TESTCLASSES${CPS}extDir/PrefsSpi.jar" \
+ -Djava.util.prefs.userRoot=. \
PrefsSpi "StubPreferences"
Sys "$java" "-cp" "$TESTCLASSES" "-Djava.ext.dirs=extDir" \
+ -Djava.util.prefs.userRoot=. \
PrefsSpi "StubPreferences"
rm -rf jarDir extDir
--- a/jdk/test/java/util/prefs/RemoveNullKeyCheck.java Fri Nov 30 09:47:17 2012 +0100
+++ b/jdk/test/java/util/prefs/RemoveNullKeyCheck.java Fri Nov 30 12:00:07 2012 -0800
@@ -22,9 +22,10 @@
*/
/* @test
- * @bug 7160242 7165118
+ * @bug 7160242 7165118 7197662
* @summary Check if NullPointerException is thrown if the key passed
* to remove() is null.
+ * @run main/othervm -Djava.util.prefs.userRoot=. RemoveNullKeyCheck
*/
import java.util.prefs.Preferences;
--- a/jdk/test/java/util/prefs/RemoveReadOnlyNode.java Fri Nov 30 09:47:17 2012 +0100
+++ b/jdk/test/java/util/prefs/RemoveReadOnlyNode.java Fri Nov 30 12:00:07 2012 -0800
@@ -23,10 +23,11 @@
/* @test
- @bug 6178148
- @summary check if wrong exception gets thrown if one of the child
- nodes is readonly on underlying filesystem when node is
- being removed.
+ * @bug 6178148 7197662
+ * @summary check if wrong exception gets thrown if one of the child
+ * nodes is readonly on underlying filesystem when node is
+ * being removed.
+ * @run main/othervm -Djava.util.prefs.userRoot=. RemoveReadOnlyNode
*/
import java.io.*;
--- a/jdk/test/java/util/prefs/RemoveUnregedListener.java Fri Nov 30 09:47:17 2012 +0100
+++ b/jdk/test/java/util/prefs/RemoveUnregedListener.java Fri Nov 30 12:00:07 2012 -0800
@@ -23,9 +23,10 @@
/* @test
- * @bug 4705094
+ * @bug 4705094 7197662
* @summary Checks if correct exception gets thrown when removing an
* unregistered NodeChangeListener .
+ * @run main/othervm -Djava.util.prefs.userRoot=. RemoveUnregedListener
*/
import java.util.prefs.*;