@Test public void normalizeIsolation() { for (Map.Entry<Integer, String> ie : TransactionOperationFinalizer.isolationLevels.entrySet()) { Integer value = ie.getKey(); String expected = ie.getValue(), actual = TransactionOperationFinalizer.normalizeIsolation(new Operation().put("isolation", value.intValue())); assertEquals("Mismatched values for value=" + value, expected, actual); } }
static String normalizeIsolation(Operation operation) { int isolation = operation.getInt("isolation", (-1)); if (isolation < 0) { return DEFAULT_ISOLATION_LEVEL; } String level = isolationLevels.get(Integer.valueOf(isolation)); if (StringUtil.isEmpty(level)) { return DEFAULT_ISOLATION_LEVEL; } else { return level; } }
TransactionOperationFinalizer implements OperationFinalizer { static String normalizeIsolation(Operation operation) { int isolation = operation.getInt("isolation", (-1)); if (isolation < 0) { return DEFAULT_ISOLATION_LEVEL; } String level = isolationLevels.get(Integer.valueOf(isolation)); if (StringUtil.isEmpty(level)) { return DEFAULT_ISOLATION_LEVEL; } else { return level; } } }
TransactionOperationFinalizer implements OperationFinalizer { static String normalizeIsolation(Operation operation) { int isolation = operation.getInt("isolation", (-1)); if (isolation < 0) { return DEFAULT_ISOLATION_LEVEL; } String level = isolationLevels.get(Integer.valueOf(isolation)); if (StringUtil.isEmpty(level)) { return DEFAULT_ISOLATION_LEVEL; } else { return level; } }  }
TransactionOperationFinalizer implements OperationFinalizer { static String normalizeIsolation(Operation operation) { int isolation = operation.getInt("isolation", (-1)); if (isolation < 0) { return DEFAULT_ISOLATION_LEVEL; } String level = isolationLevels.get(Integer.valueOf(isolation)); if (StringUtil.isEmpty(level)) { return DEFAULT_ISOLATION_LEVEL; } else { return level; } }  static void register(Operation operation); void finalize(Operation operation, Map<String, Object> richObjects); }
TransactionOperationFinalizer implements OperationFinalizer { static String normalizeIsolation(Operation operation) { int isolation = operation.getInt("isolation", (-1)); if (isolation < 0) { return DEFAULT_ISOLATION_LEVEL; } String level = isolationLevels.get(Integer.valueOf(isolation)); if (StringUtil.isEmpty(level)) { return DEFAULT_ISOLATION_LEVEL; } else { return level; } }  static void register(Operation operation); void finalize(Operation operation, Map<String, Object> richObjects);  }