private static HiveOperationType getHiveOperationType(HiveOperation op) { return HiveOperationType.valueOf(op.name()); }
/** * test that all enums in {@link HiveOperationType} match one map entry in * Operation2Privilege */ @Test public void checkHiveOperationTypeMatch() { Set<HiveOperationType> operationMapKeys = Operation2Privilege.getOperationTypes(); for (HiveOperationType operationType : HiveOperationType.values()) { if (!operationMapKeys.contains(operationType)) { fail("Unable to find corresponding entry in Operation2Privilege map for HiveOperationType " + operationType); } } assertEquals("Check if Operation2Privilege, HiveOperationType have same number of instances", operationMapKeys.size(), HiveOperationType.values().length); }
private static HiveOperationType getHiveOperationType(HiveOperation op) { return HiveOperationType.valueOf(op.name()); }
/** * test that all enums in {@link HiveOperation} match one in @{link HiveOperationType} */ @Test public void checkHiveOperationTypeMatch(){ for (HiveOperation op : HiveOperation.values()) { try { HiveOperationType.valueOf(op.name()); } catch(IllegalArgumentException ex) { // if value is null or not found, exception would get thrown fail("Unable to find corresponding type in HiveOperationType for " + op + " : " + ex ); } } }
private static HiveOperationType getHiveOperationType(HiveOperation op) { return HiveOperationType.valueOf(op.name()); }