new InsertObjectTest().createStuff(factory);
_txm.commit();
_txm.begin();
BpelDAOConnection conn = factory.getConnection();
// Assert the ProcessDAO
ProcessDAO p = conn.getProcess(new QName(TEST_NS,"testPID1"));
assertNotNull( p );
Collection<ProcessInstanceDAO> insts = p.findInstance(key1);
assertNotNull( insts );
assertTrue( insts.size() > 0 );
assertNotNull(p.getType());
assertNotNull(p.getProcessId());
assertEquals( p.getVersion() , 1 );
// Assert the CorrelatorDAO
CorrelatorDAO corr = p.getCorrelator(CORRELATOR_ID1);
assertNotNull( corr );
assertEquals(corr.getCorrelatorId(),CORRELATOR_ID1);
// Assert the MessageRouteDAO
List<MessageRouteDAO> routes = corr.findRoute(new CorrelationKeySet().add(key1));
MessageRouteDAO route = null;
if (routes != null && routes.size() > 0) {
route = routes.get(0);
}
assertNotNull( route );
assertEquals(route.getGroupId(),"testRoute" );
assertEquals(route.getIndex() , 1 );
assertNotNull(route.getTargetInstance() );
// Assert the ProcessInstanceDAO
for ( ProcessInstanceDAO inst : insts ) {
Long id = inst.getInstanceId();
assertNotNull( id );
ProcessInstanceDAO inst2 = conn.getInstance(id);
assertSame(inst2,inst);
ProcessInstanceDAO inst3 = p.getInstance(id);
assertSame( inst3 , inst );