You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@river.apache.org by pe...@apache.org on 2013/02/24 09:07:01 UTC

svn commit: r1449444 - in /river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance: NotifyCounter.java snapshot/SnapshotNotifyCounter.java

Author: peter_firmstone
Date: Sun Feb 24 08:07:01 2013
New Revision: 1449444

URL: http://svn.apache.org/r1449444
Log:
Attempt to fix another failing javaspace test

com/sun/jini/test/spec/javaspace/conformance/ExpirationNotifyTest.td
     [java] Test Failed: Test Failed: com.sun.jini.qa.harness.TestException: Not all listeners've got expected number of events.

Modified:
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/NotifyCounter.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/snapshot/SnapshotNotifyCounter.java

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/NotifyCounter.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/NotifyCounter.java?rev=1449444&r1=1449443&r2=1449444&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/NotifyCounter.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/NotifyCounter.java Sun Feb 24 08:07:01 2013
@@ -51,18 +51,18 @@ public class NotifyCounter
 {
 
     /** Template for which this class counts events */
-    protected Entry template;
+    protected final Entry template;
 
     /** Time for which this listener will count events */
-    protected long leaseTime;
+    protected volatile long leaseTime;
 
     /** number of events */
-    protected long maxEvNum;
+    private volatile long maxEvNum;
 
     /** the proxy */
-    private Object proxy;
+    private final Object proxy;
 
-    private static Configuration configuration;
+    private volatile static Configuration configuration;
 
     public static void setConfiguration(Configuration configuration) {
 	NotifyCounter.configuration = configuration;
@@ -122,11 +122,12 @@ public class NotifyCounter
     }
 
     /**
-     * Method which counts events.
+     * Method which counts events.  Synchronized to ensure earlier event number
+     * doesn't inadvertently overwrite larger value.
      *
      * @param ev RemoteEvent received.
      */
-    public void notify(RemoteEvent ev) {
+    public synchronized void notify(RemoteEvent ev) {
         maxEvNum = Math.max(ev.getSequenceNumber(), maxEvNum);
     }
 

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/snapshot/SnapshotNotifyCounter.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/snapshot/SnapshotNotifyCounter.java?rev=1449444&r1=1449443&r2=1449444&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/snapshot/SnapshotNotifyCounter.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/snapshot/SnapshotNotifyCounter.java Sun Feb 24 08:07:01 2013
@@ -37,10 +37,7 @@ import com.sun.jini.test.spec.javaspace.
 public class SnapshotNotifyCounter extends NotifyCounter {
 
     /** Snapshot of template */
-    private Entry snapshot;
-
-    /** Space in which we will create snapshot */
-    private JavaSpace space;
+    private final Entry snapshot;
 
     /**
      * Constructor with no arguments, set template to null, and lease time to 0.