[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/pojo/event ...
Jason Thomas Greene
jgreene at jboss.com
Wed May 30 02:08:03 EDT 2007
User: jgreene
Date: 07/05/30 02:08:03
Modified: tests/functional/org/jboss/cache/pojo/event
ListTest.java LocalTest.java MapTest.java
SetTest.java
Log:
Switch to new notification system
Resolve jmx test failure
ensure that the pojo package is api only
Revision Changes Path
1.5 +11 -58 JBossCache/tests/functional/org/jboss/cache/pojo/event/ListTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ListTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/event/ListTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- ListTest.java 23 May 2007 10:28:53 -0000 1.4
+++ ListTest.java 30 May 2007 06:08:03 -0000 1.5
@@ -37,8 +37,6 @@
Log log_ = LogFactory.getLog(ListTest.class);
PojoCache cache_;
static Throwable ex1_;
- static boolean pre_;
- static boolean post_;
static int counter_;
public ListTest(String name)
@@ -61,8 +59,6 @@
private void reset()
{
ListTest.ex1_ = null;
- ListTest.pre_ = false;
- ListTest.post_ = false;
ListTest.counter_ = 0;
}
@@ -85,17 +81,14 @@
list.add("test2");
cache_.attach("a", list);
assertNull("Exception should be null but " + ListTest.ex1_, ListTest.ex1_);
- assertTrue("pre-attach event is not emitted", ListTest.pre_);
- assertTrue("post-attach event is not emitted", ListTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 2, ListTest.counter_);
+ assertEquals("Total number of event is ", 3, ListTest.counter_);
+ listener.reset();
list = (ArrayList) cache_.find("a");
list.remove("test2");
list.add("test3");
assertNull("Exception should be null but " + ListTest.ex1_, ListTest.ex1_);
- assertTrue("pre-attach event is not emitted", ListTest.pre_);
- assertTrue("post-attach event is not emitted", ListTest.post_);
// If not a POJO just a String, we should not emit the event.
assertEquals("Total number of event is ", 2, ListTest.counter_);
@@ -117,8 +110,6 @@
cache_.addListener(listener);
cache_.attach("a", test);
assertNull("Exception should be null but " + ListTest.ex1_, ListTest.ex1_);
- assertTrue("pre-attach event is not emitted", ListTest.pre_);
- assertTrue("post-attach event is not emitted", ListTest.post_);
assertEquals("Total number of event is ", 4, ListTest.counter_);
cache_.removeListener(listener);
}
@@ -139,10 +130,8 @@
list.add(addr2);
cache_.attach("a", list);
assertNull("Exception should be null but " + ListTest.ex1_, ListTest.ex1_);
- assertTrue("pre-attach event is not emitted", ListTest.pre_);
- assertTrue("post-attach event is not emitted", ListTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 6, ListTest.counter_);
+ assertEquals("Total number of event is ", 3, ListTest.counter_);
listener.reset();
list = (ArrayList) cache_.find("a");
@@ -153,10 +142,8 @@
list.add(addr3);
assertNull("Exception should be null but " + ListTest.ex1_, ListTest.ex1_);
- assertTrue("pre-attach event is not emitted", ListTest.pre_);
- assertTrue("post-attach event is not emitted", ListTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 4, ListTest.counter_);
+ assertEquals("Total number of event is ", 2, ListTest.counter_);
cache_.removeListener(listener);
}
@@ -172,18 +159,14 @@
list.add("test2");
cache_.attach("a", list);
assertNull("Exception should be null but " + ListTest.ex1_, ListTest.ex1_);
- assertTrue("pre-attach event is not emitted", ListTest.pre_);
- assertTrue("post-attach event is not emitted", ListTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 2, ListTest.counter_);
+ assertEquals("Total number of event is ", 3, ListTest.counter_);
listener.reset();
cache_.detach("a");
assertNull("Exception should be null but " + ListTest.ex1_, ListTest.ex1_);
- assertTrue("pre-attach event is not emitted", ListTest.pre_);
- assertTrue("post-attach event is not emitted", ListTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 2, ListTest.counter_);
+ assertEquals("Total number of event is ", 3, ListTest.counter_);
cache_.removeListener(listener);
}
@@ -203,15 +186,11 @@
cache_.addListener(listener);
cache_.attach("a", test);
assertNull("Exception should be null but " + ListTest.ex1_, ListTest.ex1_);
- assertTrue("pre-attach event is not emitted", ListTest.pre_);
- assertTrue("post-attach event is not emitted", ListTest.post_);
assertEquals("Total number of event is ", 4, ListTest.counter_);
listener.reset();
cache_.detach("a");
assertNull("Exception should be null but " + ListTest.ex1_, ListTest.ex1_);
- assertTrue("pre-attach event is not emitted", ListTest.pre_);
- assertTrue("post-attach event is not emitted", ListTest.post_);
assertEquals("Total number of event is ", 4, ListTest.counter_);
cache_.removeListener(listener);
@@ -233,10 +212,8 @@
list.add(addr2);
cache_.attach("a", list);
assertNull("Exception should be null but " + ListTest.ex1_, ListTest.ex1_);
- assertTrue("pre-attach event is not emitted", ListTest.pre_);
- assertTrue("post-attach event is not emitted", ListTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 6, ListTest.counter_);
+ assertEquals("Total number of event is ", 3, ListTest.counter_);
listener.reset();
list = (ArrayList) cache_.find("a");
@@ -247,18 +224,14 @@
list.add(addr3);
assertNull("Exception should be null but " + ListTest.ex1_, ListTest.ex1_);
- assertTrue("pre-attach event is not emitted", ListTest.pre_);
- assertTrue("post-attach event is not emitted", ListTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 4, ListTest.counter_);
+ assertEquals("Total number of event is ", 2, ListTest.counter_);
listener.reset();
cache_.detach("a");
assertNull("Exception should be null but " + ListTest.ex1_, ListTest.ex1_);
- assertTrue("pre-attach event is not emitted", ListTest.pre_);
- assertTrue("post-attach event is not emitted", ListTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 6, ListTest.counter_);
+ assertEquals("Total number of event is ", 3, ListTest.counter_);
cache_.removeListener(listener);
}
@@ -283,38 +256,18 @@
public void reset()
{
- ListTest.pre_ = false;
- ListTest.post_ = false;
ListTest.counter_ = 0;
}
public void attach(AttachNotification attach)
{
- if (attach.getPhase() == Notification.Phase.PRE)
- {
- ListTest.pre_ = true;
ListTest.counter_++;
}
- else
- {
- ListTest.post_ = true;
- ListTest.counter_++;
- }
- }
public void detach(DetachNotification detach)
{
- if (detach.getPhase() == Notification.Phase.PRE)
- {
- ListTest.pre_ = true;
ListTest.counter_++;
}
- else
- {
- ListTest.post_ = true;
- ListTest.counter_++;
- }
- }
public void modify(FieldModifyNotification field)
{
1.5 +26 -59 JBossCache/tests/functional/org/jboss/cache/pojo/event/LocalTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LocalTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/event/LocalTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- LocalTest.java 23 May 2007 10:28:53 -0000 1.4
+++ LocalTest.java 30 May 2007 06:08:03 -0000 1.5
@@ -37,9 +37,8 @@
Log log_ = LogFactory.getLog(LocalTest.class);
PojoCache cache_;
static Throwable ex1_;
- static boolean pre_;
- static boolean post_;
static int counter_;
+ static int fieldCounter;
public LocalTest(String name)
{
@@ -61,8 +60,6 @@
private void reset()
{
ex1_ = null;
- pre_ = false;
- post_ = false;
counter_ = 0;
}
@@ -85,9 +82,7 @@
cache_.addListener(listener);
cache_.attach("/a", test);
assertNull("Exception should be null but " + ex1_, ex1_);
- assertTrue("pre-attach event is not emitted", pre_);
- assertTrue("post-attach event is not emitted", post_);
- assertEquals("Total number of event is ", 2, counter_);
+ assertEquals("Total number of event is ", 1, counter_);
cache_.removeListener(listener);
}
@@ -104,10 +99,8 @@
cache_.addListener(listener);
cache_.attach("/a", test);
assertNull("Exception should be null but " + ex1_, ex1_);
- assertTrue("pre-attach event is not emitted", pre_);
- assertTrue("post-attach event is not emitted", post_);
- assertEquals("Total number of event is ", 4, counter_);
+ assertEquals("Total number of event is ", 2, counter_);
cache_.removeListener(listener);
}
@@ -121,40 +114,32 @@
cache_.addListener(listener);
cache_.attach("/a", test);
assertNull("Exception should be null but " + ex1_, ex1_);
- assertTrue("pre-attach event is not emitted", pre_);
- assertTrue("post-attach event is not emitted", post_);
reset();
cache_.detach("/a");
assertNull("Exception should be null but " + ex1_, ex1_);
- assertTrue("pre-detach event is not emitted", pre_);
- assertTrue("post-detach event is not emitted", post_);
cache_.removeListener(listener);
}
-// public void testFieldNotification() throws Exception
-// {
-// log_.info("testAttachNotification() ....");
-// Person test = new Person();
-// test.setName("Ben");
-// test.setAge(10);
-// MyListener listener = new MyListener();
-// cache_.addListener(listener);
-// cache_.attach("/a", test);
-// assertNull("Exception should be null but " +ex1_, ex1_);
-// assertTrue("pre-attach event is not emitted", pre_);
-// assertTrue("post-attach event is not emitted", post_);
-//
-// reset();
-// // Field modification
-// test.setAge(20);
-// assertNull("Exception should be null but " +ex1_, ex1_);
-// assertTrue("pre-attach event is not emitted", pre_);
-// assertTrue("post-attach event is not emitted", post_);
-// assertEquals("Total number of event is ", 2, counter_);
-//
-// cache_.removeListener(listener);
-// }
+ public void testFieldNotification() throws Exception
+ {
+ log_.info("testAttachNotification() ....");
+ Person test = new Person();
+ test.setName("Ben");
+ test.setAge(10);
+ MyListener listener = new MyListener();
+ cache_.addListener(listener);
+ cache_.attach("/a", test);
+ assertNull("Exception should be null but " +ex1_, ex1_);
+
+ reset();
+ // Field modification
+ test.setAge(20);
+ assertNull("Exception should be null but " +ex1_, ex1_);
+ assertEquals("Total number of event is ", 1, fieldCounter);
+
+ cache_.removeListener(listener);
+ }
public static Test suite() throws Exception
{
@@ -175,41 +160,23 @@
public void reset()
{
- LocalTest.pre_ = false;
- LocalTest.post_ = false;
LocalTest.counter_ = 0;
+ LocalTest.fieldCounter = 0;
}
public void attach(AttachNotification attach)
{
- if (attach.getPhase() == Notification.Phase.PRE)
- {
- LocalTest.pre_ = true;
- LocalTest.counter_++;
- }
- else
- {
- LocalTest.post_ = true;
LocalTest.counter_++;
}
- }
public void detach(DetachNotification detach)
{
- if (detach.getPhase() == Notification.Phase.PRE)
- {
- LocalTest.pre_ = true;
- LocalTest.counter_++;
- }
- else
- {
- LocalTest.post_ = true;
LocalTest.counter_++;
}
- }
public void modify(FieldModifyNotification field)
{
+ LocalTest.fieldCounter++;
}
public void modify(SetModifyNotification set)
1.5 +11 -58 JBossCache/tests/functional/org/jboss/cache/pojo/event/MapTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MapTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/event/MapTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- MapTest.java 23 May 2007 10:28:53 -0000 1.4
+++ MapTest.java 30 May 2007 06:08:03 -0000 1.5
@@ -38,8 +38,6 @@
Log log_ = LogFactory.getLog(MapTest.class);
PojoCache cache_;
static Throwable ex1_;
- static boolean pre_;
- static boolean post_;
static int counter_;
public MapTest(String name)
@@ -62,8 +60,6 @@
private void reset()
{
MapTest.ex1_ = null;
- MapTest.pre_ = false;
- MapTest.post_ = false;
MapTest.counter_ = 0;
}
@@ -86,17 +82,14 @@
map.put("test2", "test2");
cache_.attach("a", map);
assertNull("Exception should be null but " + MapTest.ex1_, MapTest.ex1_);
- assertTrue("pre-attach event is not emitted", MapTest.pre_);
- assertTrue("post-attach event is not emitted", MapTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 2, MapTest.counter_);
+ assertEquals("Total number of event is ", 3, MapTest.counter_);
+ listener.reset();
map = (Map) cache_.find("a");
map.remove("test2");
map.put("test3", "test3");
assertNull("Exception should be null but " + MapTest.ex1_, MapTest.ex1_);
- assertTrue("pre-attach event is not emitted", MapTest.pre_);
- assertTrue("post-attach event is not emitted", MapTest.post_);
// If not a POJO just a String, we should not emit the event.
assertEquals("Total number of event is ", 2, MapTest.counter_);
@@ -118,8 +111,6 @@
cache_.addListener(listener);
cache_.attach("a", test);
assertNull("Exception should be null but " + MapTest.ex1_, MapTest.ex1_);
- assertTrue("pre-attach event is not emitted", MapTest.pre_);
- assertTrue("post-attach event is not emitted", MapTest.post_);
assertEquals("Total number of event is ", 4, MapTest.counter_);
cache_.removeListener(listener);
}
@@ -140,10 +131,8 @@
map.put("2", addr2);
cache_.attach("a", map);
assertNull("Exception should be null but " + SetTest.ex1_, SetTest.ex1_);
- assertTrue("pre-attach event is not emitted", MapTest.pre_);
- assertTrue("post-attach event is not emitted", MapTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 6, MapTest.counter_);
+ assertEquals("Total number of event is ", 3, MapTest.counter_);
listener.reset();
map = (Map) cache_.find("a");
@@ -154,10 +143,8 @@
map.put("3", addr3);
assertNull("Exception should be null but " + MapTest.ex1_, MapTest.ex1_);
- assertTrue("pre-attach event is not emitted", MapTest.pre_);
- assertTrue("post-attach event is not emitted", MapTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 4, MapTest.counter_);
+ assertEquals("Total number of event is ", 2, MapTest.counter_);
cache_.removeListener(listener);
}
@@ -172,18 +159,14 @@
map.put("test2", "test2");
cache_.attach("a", map);
assertNull("Exception should be null but " + MapTest.ex1_, MapTest.ex1_);
- assertTrue("pre-attach event is not emitted", MapTest.pre_);
- assertTrue("post-attach event is not emitted", MapTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 2, MapTest.counter_);
+ assertEquals("Total number of event is ", 3, MapTest.counter_);
listener.reset();
cache_.detach("a");
assertNull("Exception should be null but " + MapTest.ex1_, MapTest.ex1_);
- assertTrue("pre-attach event is not emitted", MapTest.pre_);
- assertTrue("post-attach event is not emitted", MapTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 2, MapTest.counter_);
+ assertEquals("Total number of event is ", 3, MapTest.counter_);
cache_.removeListener(listener);
}
@@ -203,15 +186,11 @@
cache_.addListener(listener);
cache_.attach("a", test);
assertNull("Exception should be null but " + MapTest.ex1_, MapTest.ex1_);
- assertTrue("pre-attach event is not emitted", MapTest.pre_);
- assertTrue("post-attach event is not emitted", MapTest.post_);
assertEquals("Total number of event is ", 4, MapTest.counter_);
listener.reset();
cache_.detach("a");
assertNull("Exception should be null but " + MapTest.ex1_, MapTest.ex1_);
- assertTrue("pre-attach event is not emitted", MapTest.pre_);
- assertTrue("post-attach event is not emitted", MapTest.post_);
assertEquals("Total number of event is ", 4, MapTest.counter_);
cache_.removeListener(listener);
@@ -233,10 +212,8 @@
map.put("2", addr2);
cache_.attach("a", map);
assertNull("Exception should be null but " + SetTest.ex1_, SetTest.ex1_);
- assertTrue("pre-attach event is not emitted", MapTest.pre_);
- assertTrue("post-attach event is not emitted", MapTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 6, MapTest.counter_);
+ assertEquals("Total number of event is ", 3, MapTest.counter_);
listener.reset();
map = (Map) cache_.find("a");
@@ -247,19 +224,15 @@
map.put("3", addr3);
assertNull("Exception should be null but " + MapTest.ex1_, MapTest.ex1_);
- assertTrue("pre-attach event is not emitted", MapTest.pre_);
- assertTrue("post-attach event is not emitted", MapTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 4, MapTest.counter_);
+ assertEquals("Total number of event is ", 2, MapTest.counter_);
listener.reset();
cache_.detach("a");
assertNull("Exception should be null but " + MapTest.ex1_, MapTest.ex1_);
- assertTrue("pre-attach event is not emitted", MapTest.pre_);
- assertTrue("post-attach event is not emitted", MapTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 6, MapTest.counter_);
+ assertEquals("Total number of event is ", 3, MapTest.counter_);
cache_.removeListener(listener);
}
@@ -283,38 +256,18 @@
public void reset()
{
- MapTest.pre_ = false;
- MapTest.post_ = false;
MapTest.counter_ = 0;
}
public void attach(AttachNotification attach)
{
- if (attach.getPhase() == Notification.Phase.PRE)
- {
- MapTest.pre_ = true;
MapTest.counter_++;
}
- else
- {
- MapTest.post_ = true;
- MapTest.counter_++;
- }
- }
public void detach(DetachNotification detach)
{
- if (detach.getPhase() == Notification.Phase.PRE)
- {
- MapTest.pre_ = true;
MapTest.counter_++;
}
- else
- {
- MapTest.post_ = true;
- MapTest.counter_++;
- }
- }
public void modify(FieldModifyNotification field)
{
1.5 +11 -58 JBossCache/tests/functional/org/jboss/cache/pojo/event/SetTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SetTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/event/SetTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- SetTest.java 23 May 2007 10:28:53 -0000 1.4
+++ SetTest.java 30 May 2007 06:08:03 -0000 1.5
@@ -38,8 +38,6 @@
Log log_ = LogFactory.getLog(SetTest.class);
PojoCache cache_;
static Throwable ex1_;
- static boolean pre_;
- static boolean post_;
static int counter_;
public SetTest(String name)
@@ -62,8 +60,6 @@
private void reset()
{
SetTest.ex1_ = null;
- SetTest.pre_ = false;
- SetTest.post_ = false;
SetTest.counter_ = 0;
}
@@ -86,17 +82,14 @@
set.add("test2");
cache_.attach("a", set);
assertNull("Exception should be null but " + SetTest.ex1_, SetTest.ex1_);
- assertTrue("pre-attach event is not emitted", SetTest.pre_);
- assertTrue("post-attach event is not emitted", SetTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 2, SetTest.counter_);
+ assertEquals("Total number of event is ", 3, SetTest.counter_);
+ listener.reset();
set = (Set) cache_.find("a");
set.remove("test2");
set.add("test3");
assertNull("Exception should be null but " + SetTest.ex1_, SetTest.ex1_);
- assertTrue("pre-attach event is not emitted", SetTest.pre_);
- assertTrue("post-attach event is not emitted", SetTest.post_);
// If not a POJO just a String, we should not emit the event.
assertEquals("Total number of event is ", 2, SetTest.counter_);
@@ -118,8 +111,6 @@
cache_.addListener(listener);
cache_.attach("a", test);
assertNull("Exception should be null but " + SetTest.ex1_, SetTest.ex1_);
- assertTrue("pre-attach event is not emitted", SetTest.pre_);
- assertTrue("post-attach event is not emitted", SetTest.post_);
assertEquals("Total number of event is ", 4, SetTest.counter_);
cache_.removeListener(listener);
}
@@ -140,10 +131,8 @@
set.add(addr2);
cache_.attach("a", set);
assertNull("Exception should be null but " + SetTest.ex1_, SetTest.ex1_);
- assertTrue("pre-attach event is not emitted", SetTest.pre_);
- assertTrue("post-attach event is not emitted", SetTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 6, SetTest.counter_);
+ assertEquals("Total number of event is ", 3, SetTest.counter_);
listener.reset();
set = (Set) cache_.find("a");
@@ -154,10 +143,8 @@
set.add(addr3);
assertNull("Exception should be null but " + SetTest.ex1_, SetTest.ex1_);
- assertTrue("pre-attach event is not emitted", SetTest.pre_);
- assertTrue("post-attach event is not emitted", SetTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 4, SetTest.counter_);
+ assertEquals("Total number of event is ", 2, SetTest.counter_);
cache_.removeListener(listener);
}
@@ -173,18 +160,14 @@
set.add("test2");
cache_.attach("a", set);
assertNull("Exception should be null but " + SetTest.ex1_, SetTest.ex1_);
- assertTrue("pre-attach event is not emitted", SetTest.pre_);
- assertTrue("post-attach event is not emitted", SetTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 2, SetTest.counter_);
+ assertEquals("Total number of event is ", 3, SetTest.counter_);
listener.reset();
cache_.detach("a");
assertNull("Exception should be null but " + SetTest.ex1_, SetTest.ex1_);
- assertTrue("pre-attach event is not emitted", SetTest.pre_);
- assertTrue("post-attach event is not emitted", SetTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 2, SetTest.counter_);
+ assertEquals("Total number of event is ", 3, SetTest.counter_);
cache_.removeListener(listener);
}
@@ -204,15 +187,11 @@
cache_.addListener(listener);
cache_.attach("a", test);
assertNull("Exception should be null but " + SetTest.ex1_, SetTest.ex1_);
- assertTrue("pre-attach event is not emitted", SetTest.pre_);
- assertTrue("post-attach event is not emitted", SetTest.post_);
assertEquals("Total number of event is ", 4, SetTest.counter_);
listener.reset();
cache_.detach("a");
assertNull("Exception should be null but " + SetTest.ex1_, SetTest.ex1_);
- assertTrue("pre-attach event is not emitted", SetTest.pre_);
- assertTrue("post-attach event is not emitted", SetTest.post_);
assertEquals("Total number of event is ", 4, SetTest.counter_);
cache_.removeListener(listener);
@@ -234,10 +213,8 @@
set.add(addr2);
cache_.attach("a", set);
assertNull("Exception should be null but " + SetTest.ex1_, SetTest.ex1_);
- assertTrue("pre-attach event is not emitted", SetTest.pre_);
- assertTrue("post-attach event is not emitted", SetTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 6, SetTest.counter_);
+ assertEquals("Total number of event is ", 3, SetTest.counter_);
listener.reset();
set = (Set) cache_.find("a");
@@ -248,19 +225,15 @@
set.add(addr3);
assertNull("Exception should be null but " + SetTest.ex1_, SetTest.ex1_);
- assertTrue("pre-attach event is not emitted", SetTest.pre_);
- assertTrue("post-attach event is not emitted", SetTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 4, SetTest.counter_);
+ assertEquals("Total number of event is ", 2, SetTest.counter_);
listener.reset();
cache_.detach("a");
assertNull("Exception should be null but " + SetTest.ex1_, SetTest.ex1_);
- assertTrue("pre-attach event is not emitted", SetTest.pre_);
- assertTrue("post-attach event is not emitted", SetTest.post_);
// If not a POJO just a String, we should not emit the event.
- assertEquals("Total number of event is ", 6, SetTest.counter_);
+ assertEquals("Total number of event is ", 3, SetTest.counter_);
cache_.removeListener(listener);
}
@@ -285,38 +258,18 @@
public void reset()
{
- SetTest.pre_ = false;
- SetTest.post_ = false;
SetTest.counter_ = 0;
}
public void attach(AttachNotification attach)
{
- if (attach.getPhase() == Notification.Phase.PRE)
- {
- SetTest.pre_ = true;
SetTest.counter_++;
}
- else
- {
- SetTest.post_ = true;
- SetTest.counter_++;
- }
- }
public void detach(DetachNotification detach)
{
- if (detach.getPhase() == Notification.Phase.PRE)
- {
- SetTest.pre_ = true;
SetTest.counter_++;
}
- else
- {
- SetTest.post_ = true;
- SetTest.counter_++;
- }
- }
public void modify(FieldModifyNotification field)
{
More information about the jboss-cvs-commits
mailing list