sm.getSession().save(correlator);
new CorrelatorDaoImpl(sm, correlator).dequeueMessage(new CorrelationKeySet("@2[12~a~b]"));
}
public void testCleanup() throws Exception {
SessionManager sm = ((BpelDAOConnectionImpl) daoConn)._sm;
ProcessDAO p = daoConn.createProcess(QName.valueOf("abc"), QName.valueOf("abc"), "abc", 1);
CorrelatorDAO correlator = p.addCorrelator("abc");
ProcessInstanceDAO instance = p.createInstance(correlator);
MessageExchangeDAO mex = daoConn.createMessageExchange('M');
mex.setProperty("abc", "def");
mex.setInstance(instance);
txm.commit();
txm.begin();
assertEquals(1, sm.getSession().createSQLQuery("select count(*) from BPEL_MEX_PROPS").list().get(0));
Set<CLEANUP_CATEGORY> cleanupCategories = EnumSet.allOf(CLEANUP_CATEGORY.class);
instance.delete(cleanupCategories);
txm.commit();
txm.begin();
assertEquals(0, sm.getSession().createSQLQuery("select count(*) from BPEL_MEX_PROPS").list().get(0));
}