@Test
public final void test_isValidEnums_failures() {

	// null elements in enum def list are a failure
	List<RangerEnumDef> input = _utils.createEnumDefs(enums_good);
	input.add(null);
	assertFalse(_validator.isValidEnums(input, _failures));
	_utils.checkFailureForMissingValue(_failures, "enum def");
	
	// enum names should be valid
	input = _utils.createEnumDefs(enums_bad_enumName_null);
	_failures.clear(); assertFalse(_validator.isValidEnums(input, _failures));
	_utils.checkFailureForMissingValue(_failures, "enum def name");
	input = _utils.createEnumDefs(enums_bad_enumName_blank);
	_failures.clear(); assertFalse(_validator.isValidEnums(input, _failures));
	_utils.checkFailureForMissingValue(_failures, "enum def name");
	_utils.checkFailureForSemanticError(_failures, "enum def itemId", "1");
	
	// enum elements collection should not be null or empty
	input = _utils.createEnumDefs(enums_good);
	RangerEnumDef anEnumDef = mock(RangerEnumDef.class);
	when(anEnumDef.getName()).thenReturn("anEnum");
	when(anEnumDef.getElements()).thenReturn(null);
	input.add(anEnumDef);
	_failures.clear(); assertFalse(_validator.isValidEnums(input, _failures));
	_utils.checkFailureForMissingValue(_failures, "enum values", "anEnum");
	input = _utils.createEnumDefs(enums_bad_Elements_empty);
	_failures.clear(); assertFalse(_validator.isValidEnums(input, _failures));
	_utils.checkFailureForMissingValue(_failures, "enum values", "anEnum");
	_utils.checkFailureForMissingValue(_failures, "enum def itemId");

	// enum names should be distinct -- exact match
	input = _utils.createEnumDefs(enums_good);
	// add an element with same name as the first element
	String name = input.iterator().next().getName();
	when(anEnumDef.getName()).thenReturn(name);
	List<RangerEnumElementDef> elementDefs = _utils.createEnumElementDefs(new String[] {"val1", "val2"});
	when(anEnumDef.getElements()).thenReturn(elementDefs);
	input.add(anEnumDef);
	_failures.clear(); assertFalse(_validator.isValidEnums(input, _failures));
	_utils.checkFailureForSemanticError(_failures, "enum def name", name);
	// enum names should be distinct -- case insensitive
	input = _utils.createEnumDefs(enums_bad_enumName_duplicate_differentCase);
	_failures.clear(); assertFalse(_validator.isValidEnums(input, _failures));
	_utils.checkFailureForSemanticError(_failures, "enum def name", "Authentication-Type");

	// enum default index should be right
	input = _utils.createEnumDefs(enums_good);
	// set the index of 1st on to be less than 0
	when(input.iterator().next().getDefaultIndex()).thenReturn(-1);
	_failures.clear(); assertFalse(_validator.isValidEnums(input, _failures));
	_utils.checkFailureForSemanticError(_failures, "enum default index", "authentication-type");
	// set the index to be more than number of elements
	when(input.iterator().next().getDefaultIndex()).thenReturn(2);
	_failures.clear(); assertFalse(_validator.isValidEnums(input, _failures));
	_utils.checkFailureForSemanticError(_failures, "enum default index", "authentication-type");
}