Skip to content

Commit 4928195

Browse files
Also test getAll2, log before operation.
#626
1 parent 3ca864a commit 4928195

File tree

1 file changed

+28
-0
lines changed
  • tests/objectbox-java-test/src/test/java/io/objectbox

1 file changed

+28
-0
lines changed

tests/objectbox-java-test/src/test/java/io/objectbox/BoxTest.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,20 +142,48 @@ public void testGetAllAfterGetAndRemove() {
142142
assertEquals(0, box.count());
143143
assertEquals(0, box.getAll().size());
144144

145+
System.out.println("PUT");
145146
List<TestEntity> entities = putTestEntities(10);
146147

147148
// explicitly get an entity (any will do)
149+
System.out.println("GET");
148150
TestEntity entity = box.get(entities.get(1).getId());
149151
assertNotNull(entity);
150152

153+
System.out.println("REMOVE_ALL");
151154
box.removeAll();
152155

156+
System.out.println("COUNT");
153157
assertEquals(0, box.count());
158+
System.out.println("GET_ALL");
154159
List<TestEntity> all = box.getAll();
155160
// note only 1 entity is returned by getAll, it is the one we explicitly get (last) above
156161
assertEquals(0, all.size());
157162
}
158163

164+
// same as above, but using getAll2
165+
@Test
166+
public void testGetAll2AfterGetAndRemove() {
167+
assertEquals(0, box.count());
168+
assertEquals(0, box.getAll2().size());
169+
170+
System.out.println("PUT");
171+
List<TestEntity> entities = putTestEntities(10);
172+
173+
System.out.println("GET");
174+
TestEntity entity = box.get(entities.get(1).getId());
175+
assertNotNull(entity);
176+
177+
System.out.println("REMOVE_ALL");
178+
box.removeAll();
179+
180+
System.out.println("COUNT");
181+
assertEquals(0, box.count());
182+
System.out.println("GET_ALL2");
183+
List<TestEntity> all = box.getAll2();
184+
assertEquals(0, all.size());
185+
}
186+
159187
@Test
160188
public void testPanicModeRemoveAllObjects() {
161189
assertEquals(0, box.panicModeRemoveAll());

0 commit comments

Comments
 (0)