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
MessageRouteDAO route = corr.findRoute(key1);
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 );
Long mon = inst.genMonotonic();
assertEquals(inst.getActivityFailureCount() , 2);
assertNotNull(inst.getActivityFailureDateTime() );
assertNotNull(inst.getCreateTime() );
assertTrue(inst.getExecutionState().length > 0 );
assertNotNull(inst.getLastActiveTime() );
assertSame(inst.getProcess() , p );
assertEquals(inst.getPreviousState() , 0);
assertEquals(inst.getState() , 1);
// Assert the Root ScopeDAO
ScopeDAO rs = inst.getRootScope();
assertNotNull( rs );
assertNotNull(rs.getChildScopes());
ScopeDAO child1 = null;
for ( ScopeDAO childItr : rs.getChildScopes()){
child1 = childItr;
break;
}
assertNotNull(child1);
assertNotNull(rs.getCorrelationSets());
assertEquals(rs.getCorrelationSets().size() , 0 );
assertEquals(rs.getModelId(),1);
assertEquals(rs.getName(),"Root");
assertTrue(rs.getParentScope() == null);
assertNotNull(rs.getPartnerLinks());
assertEquals(rs.getPartnerLinks().size() ,0);
assertSame(rs.getProcessInstance(),inst);
assertNotNull(rs.getScopeInstanceId());
assertEquals(rs.getState(),ScopeStateEnum.ACTIVE);
assertNotNull(rs.getVariables());
assertEquals(rs.getVariables().size(),0);
// Assert the ActivityRecoveryDAO
assertNotNull(inst.getActivityRecoveries());
ActivityRecoveryDAO rec1 = null;
for (ActivityRecoveryDAO recItr : inst.getActivityRecoveries()) {
if (recItr.getActivityId() == 3) {
rec1 = recItr;break;
}
}
assertNotNull(rec1);
String tmpAct = rec1.getActions();
// assertEquals(rec1.getActionsList(),actions);
assertEquals(rec1.getActivityId(),3);
assertEquals(rec1.getChannel(),"testChannel1");
assertNotNull(rec1.getDateTime());
// assertNotNull(rec1.getDetails());
assertEquals(rec1.getReason(),"testReason1");
assertEquals(rec1.getRetries(),2);
// Assert the CorrelationSetDAO
//assertNotNull(inst.getCorrelationSets());
//CorrelationSetDAO cs1 = null;
//for ( CorrelationSetDAO csItr : inst.getCorrelationSets() ) {
// cs1 = csItr;
// break;
//}
//assertNotNull(cs1);
// Assert the FaultDAO
FaultDAO fault = inst.getFault();
assertNotNull(fault);
assertEquals(fault.getActivityId(),1);
assertNotNull(fault.getData());
assertEquals(fault.getExplanation(),"testExplanation");
assertEquals(fault.getLineNo(),1);
assertEquals(fault.getName(),new QName(TEST_NS,"testFault"));
// Assert MessageExchangeDAO
CorrelatorDAO ic = inst.getInstantiatingCorrelator();
assertNotNull(ic);
assertEquals(ic.getCorrelatorId(),CORRELATOR_ID1);
// The message is dequeued but not persisted
MessageExchangeDAO me = ic.dequeueMessage(key1);
assertNotNull(me);
assertEquals(me.getCallee(),new QName(TEST_NS,"testCallee"));
assertEquals(me.getPropagateTransactionFlag(),false);
assertEquals(me.getChannel(),"testChannel");
assertEquals(me.getCorrelationId(),"testCorrelationId");