Connection.TRANSACTION_NONE,
Connection.TRANSACTION_READ_COMMITTED,
Connection.TRANSACTION_REPEATABLE_READ,
Connection.TRANSACTION_SERIALIZABLE
}) {
TransactionDefinition txDefinition = new TransactionDefinition() {
public boolean isReadOnly() {
return readOnly;
}
public int getTimeout() {
return timeout;
}
public int getPropagationBehavior() {
return propagationBehavior;
}
public String getName() {
return opStatus.name()
+ ";readOnly=" + readOnly
+ ";propagation=" + TransactionOperationFinalizer.propagationNames.get(propagationBehavior)
+ ";isolation=" + isolationLevel
+ ";timeout=" + timeout
;
}
public int getIsolationLevel() {
return isolationLevel;
}
@Override
public String toString() {
return getName();
}
};
TransactionStatus txStatus = manager.getTransaction(txDefinition);
switch (opStatus) {
case Committed:
manager.commit(txStatus);
break;
case RolledBack:
manager.rollback(txStatus);
break;
default:
fail("Unknown status action: " + opStatus);
}
assertTransactionOperation(txDefinition.getName(), opStatus, txDefinition);
Mockito.reset(spiedOperationCollector); // prepare for next iteration
}
}
}
}