crash(target);
}
else if (target instanceof ConnectionAdvised && "sendTransaction".equals(methodName))
{
TransactionRequest request = (TransactionRequest)mi.getArguments()[0];
if (request.getRequestType() == TransactionRequest.TWO_PHASE_COMMIT_REQUEST
&& type == TYPE_2PC_COMMIT)
{
//Crash before 2pc commit (after prepare)- used in message bridge tests
log.info("##### Crashing on 2PC commit!!");
crash(target);
}
else if (request.getRequestType() == TransactionRequest.ONE_PHASE_COMMIT_REQUEST &&
type == FAIL_AFTER_SENDTRANSACTION)
{
invocation.invokeNext();
log.info("#### Crash after sendTransaction");
crash(target);
}
else if (request.getRequestType() == TransactionRequest.ONE_PHASE_COMMIT_REQUEST &&
type == FAIL_BEFORE_SENDTRANSACTION)
{
log.info("#### Crash before sendTransaction");
crash(target);
}