@Test public void testIsolated() { store.remove(Filter.INCLUDE); ExecutionStatus status = new ExecutionStatus(new NameImpl("test"), "abcde", false); store.save(status); List<ExecutionStatus> statuses = store.list(Query.ALL); assertEquals(1, statuses.size()); assertEquals("incorrect status", status, statuses.get(0)); assertNotSame(status, statuses.get(0)); }
@Test public void testDelete() throws CQLException { assertEquals(1, store.remove(CQL.toFilter("processName = 'test1'"))); checkContains(store.list(Query.ALL), s2, s3, s4); assertEquals(2, store.remove(CQL.toFilter("progress > 30"))); checkContains(store.list(Query.ALL), s2); assertEquals(1, store.remove(CQL.toFilter("phase = 'FAILED'"))); checkContains(store.list(Query.ALL)); }
/** Puts all the test statuses in the store */ protected void fillStore() { store.save(s1); store.save(s2); store.save(s3); store.save(s4); }
protected void checkFiltered(ProcessStatusStore store, Query query, ExecutionStatus... statuses) { List<ExecutionStatus> filtered = store.list(query); checkContains(filtered, statuses); }