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() {
51
51
Query <TestEntity > query = box .query ().in (simpleInt , valuesInt ).build ();
52
52
assertEquals (0 , query .count ());
53
53
54
+ // Initial data on subscription.
54
55
query .subscribe ().observer (this );
55
56
assertLatchCountedDown (latch , 5 );
56
57
assertEquals (1 , receivedChanges .size ());
57
58
assertEquals (0 , receivedChanges .get (0 ).size ());
58
59
60
+ // On put.
59
61
receivedChanges .clear ();
60
62
latch = new CountDownLatch (1 );
61
63
putTestEntitiesScalars ();
62
64
assertLatchCountedDown (latch , 5 );
63
-
64
65
assertEquals (1 , receivedChanges .size ());
65
66
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 ());
66
75
}
67
76
68
77
@ Test
You can’t perform that action at this time.
0 commit comments