Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2014-03-07 06:14:20 -0500
committerEike Stepper2014-03-07 06:14:20 -0500
commite9a6a17ccb0e8cba5eac1660a2d8626392fe3499 (patch)
tree5b376e7b874cc5df5e3a716b537f512fe5c8d78f /plugins/org.eclipse.net4j.tests/src/org
parentb0a023ae94356818d8dbb0f407a710e9af578e4e (diff)
downloadcdo-e9a6a17ccb0e8cba5eac1660a2d8626392fe3499.tar.gz
cdo-e9a6a17ccb0e8cba5eac1660a2d8626392fe3499.tar.xz
cdo-e9a6a17ccb0e8cba5eac1660a2d8626392fe3499.zip
[429864] Reconnecting session misses commits that occured while being unconnected
https://bugs.eclipse.org/bugs/show_bug.cgi?id=429864
Diffstat (limited to 'plugins/org.eclipse.net4j.tests/src/org')
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java47
1 files changed, 45 insertions, 2 deletions
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
index b073c1c0dc..9912df358d 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
@@ -16,7 +16,9 @@ import org.eclipse.net4j.util.ReflectUtil;
import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
import org.eclipse.net4j.util.concurrent.TrackableTimerTask;
import org.eclipse.net4j.util.event.EventUtil;
+import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.event.INotifier;
import org.eclipse.net4j.util.io.IORuntimeException;
import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.net4j.util.io.TMPUtil;
@@ -60,12 +62,20 @@ public abstract class AbstractOMTest extends TestCase
public static final long DEFAULT_TIMEOUT_EXPECTED = 3 * 1000;
- private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, AbstractOMTest.class);
-
public static boolean EXTERNAL_LOG;
public static boolean SUPPRESS_OUTPUT;
+ private static final IListener DUMPER = new IListener()
+ {
+ public void notifyEvent(IEvent event)
+ {
+ IOUtil.OUT().println(event);
+ }
+ };
+
+ private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, AbstractOMTest.class);
+
private static boolean consoleEnabled;
private static String testName;
@@ -691,6 +701,39 @@ public abstract class AbstractOMTest extends TestCase
}
}
+ public static void dumpEvents(Object notifier)
+ {
+ dumpEvents(notifier, true);
+ }
+
+ public static void dumpEvents(Object notifier, boolean on)
+ {
+ if (notifier instanceof INotifier)
+ {
+ INotifier iNotifier = (INotifier)notifier;
+ IListener[] listeners = iNotifier.getListeners();
+
+ boolean wasOn = false;
+ for (int i = 0; i < listeners.length; i++)
+ {
+ if (listeners[i] == DUMPER)
+ {
+ wasOn = true;
+ break;
+ }
+ }
+
+ if (on && !wasOn)
+ {
+ iNotifier.addListener(DUMPER);
+ }
+ else if (!on && wasOn)
+ {
+ iNotifier.removeListener(DUMPER);
+ }
+ }
+ }
+
public static void skipTest(boolean skip)
{
if (skip)

Back to the top