@@ -156,7 +156,7 @@ public void testEvents()
156
156
{
157
157
// put data items into inner cache to generate events
158
158
NamedCache <String , Integer > testCache = getAndPopulateNamedCache ("dist-test" );
159
- TestCQCListener listener = new TestCQCListener (SOME_DATA );
159
+ TestCQCListener listener = new TestCQCListener (SOME_DATA + 20 );
160
160
ContinuousQueryCache <String , Integer , Integer > theCQC = setCQC (new ContinuousQueryCache <>(
161
161
testCache ,
162
162
AlwaysFilter .INSTANCE ,
@@ -185,6 +185,17 @@ public void testEvents()
185
185
// check that the listener received the correct number of events after restart
186
186
Eventually .assertThat (invoking (theCQC ).getState (), is (ContinuousQueryCache .STATE_SYNCHRONIZED ));
187
187
Eventually .assertThat (invoking (listener ).getActualTotal (), is (SOME_DATA ));
188
+
189
+ // test remove from backing store generates CQC delete mapevent
190
+ for (int i = 0 ; i < 20 ; i ++)
191
+ {
192
+ testCache .remove ("TestKey" + String .format ("%02d" , i ));
193
+ }
194
+ Eventually .assertThat (invoking (listener ).getActualDeletes (), is (20 ));
195
+ Eventually .assertThat (invoking (listener ).getActualTotal (), is (SOME_DATA + 20 ));
196
+ Eventually .assertThat (invoking (listener ).isFinished (), is (true ));
197
+ Eventually .assertThat (invoking (theCQC ).size (), is (SOME_DATA - 20 ));
198
+ Eventually .assertThat (invoking (testCache ).size (), is (SOME_DATA - 20 ));
188
199
}
189
200
190
201
@ Test
0 commit comments