changeset 5850:1aa871010e23

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
author khazra
date Tue, 02 Apr 2013 12:01:35 -0700
parents 53585f4d6494
children 885ad3351534
files test/java/util/prefs/AddNodeChangeListener.java test/java/util/prefs/CheckUserPrefsStorage.sh test/java/util/prefs/CommentsInXml.java test/java/util/prefs/ConflictInFlush.java test/java/util/prefs/ExportNode.java test/java/util/prefs/ExportSubtree.java test/java/util/prefs/PrefsSpi.sh test/java/util/prefs/RemoveReadOnlyNode.java test/java/util/prefs/RemoveUnregedListener.java
diffstat 9 files changed, 28 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/util/prefs/AddNodeChangeListener.java	Tue Feb 05 12:28:47 2013 +0100
+++ b/test/java/util/prefs/AddNodeChangeListener.java	Tue Apr 02 12:01:35 2013 -0700
@@ -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/test/java/util/prefs/CheckUserPrefsStorage.sh	Tue Feb 05 12:28:47 2013 +0100
+++ b/test/java/util/prefs/CheckUserPrefsStorage.sh	Tue Apr 02 12:01:35 2013 -0700
@@ -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/test/java/util/prefs/CommentsInXml.java	Tue Feb 05 12:28:47 2013 +0100
+++ b/test/java/util/prefs/CommentsInXml.java	Tue Apr 02 12:01:35 2013 -0700
@@ -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/test/java/util/prefs/ConflictInFlush.java	Tue Feb 05 12:28:47 2013 +0100
+++ b/test/java/util/prefs/ConflictInFlush.java	Tue Apr 02 12:01:35 2013 -0700
@@ -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/test/java/util/prefs/ExportNode.java	Tue Feb 05 12:28:47 2013 +0100
+++ b/test/java/util/prefs/ExportNode.java	Tue Apr 02 12:01:35 2013 -0700
@@ -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/test/java/util/prefs/ExportSubtree.java	Tue Feb 05 12:28:47 2013 +0100
+++ b/test/java/util/prefs/ExportSubtree.java	Tue Apr 02 12:01:35 2013 -0700
@@ -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/test/java/util/prefs/PrefsSpi.sh	Tue Feb 05 12:28:47 2013 +0100
+++ b/test/java/util/prefs/PrefsSpi.sh	Tue Apr 02 12:01:35 2013 -0700
@@ -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/test/java/util/prefs/RemoveReadOnlyNode.java	Tue Feb 05 12:28:47 2013 +0100
+++ b/test/java/util/prefs/RemoveReadOnlyNode.java	Tue Apr 02 12:01:35 2013 -0700
@@ -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/test/java/util/prefs/RemoveUnregedListener.java	Tue Feb 05 12:28:47 2013 +0100
+++ b/test/java/util/prefs/RemoveUnregedListener.java	Tue Apr 02 12:01:35 2013 -0700
@@ -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.*;