@Test public void testReadAll() throws InterruptedException, JSONException { loadBulkData(); List<Data> allData = new ArrayList<Data>(store.readAll()); Collections.sort(allData); Assert.assertEquals(6, allData.size()); Assert.assertEquals("name", allData.get(0).getName()); Assert.assertEquals("name2", allData.get(5).getName()); }
@Test public void testSaveListOfBoringData() throws InterruptedException { SQLStore<ListWithId> longStore = new SQLStore<ListWithId>(ListWithId.class, context); open(longStore); ListWithId<Long> longList = new ListWithId<Long>(100); longList.setId(1); for (long i = 0; i < 100; i++) { longList.data.add(i); } longStore.save(longList); Assert.assertEquals(100, longStore.readAll().iterator().next().data.size()); }