File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
tests/objectbox-java-test/src/test/java/io/objectbox/query Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -51,18 +51,27 @@ public void testObserver() {
5151 Query <TestEntity > query = box .query ().in (simpleInt , valuesInt ).build ();
5252 assertEquals (0 , query .count ());
5353
54+ // Initial data on subscription.
5455 query .subscribe ().observer (this );
5556 assertLatchCountedDown (latch , 5 );
5657 assertEquals (1 , receivedChanges .size ());
5758 assertEquals (0 , receivedChanges .get (0 ).size ());
5859
60+ // On put.
5961 receivedChanges .clear ();
6062 latch = new CountDownLatch (1 );
6163 putTestEntitiesScalars ();
6264 assertLatchCountedDown (latch , 5 );
63-
6465 assertEquals (1 , receivedChanges .size ());
6566 assertEquals (3 , receivedChanges .get (0 ).size ());
67+
68+ // On remove all.
69+ receivedChanges .clear ();
70+ latch = new CountDownLatch (1 );
71+ box .removeAll ();
72+ assertLatchCountedDown (latch , 5 );
73+ assertEquals (1 , receivedChanges .size ());
74+ assertEquals (0 , receivedChanges .get (0 ).size ());
6675 }
6776
6877 @ Test
You can’t perform that action at this time.
0 commit comments