test/org/ohmage/validator/ClassValidatorsTest.java
@Test
	public void testValidateClassRole() {
		try {
			for(String emptyValue : ParameterSets.getEmptyValues()) {
				Assert.assertNull(ClassValidators.validateClassRole(emptyValue));
			}
			
			try {
				ClassValidators.validateClassRole("Invalid value.");
				fail("The class role was invalid.");
			}
			catch(ValidationException e) {
				// Passed.
			}
			
			for(Clazz.Role role : Clazz.Role.values()) {
				Assert.assertEquals(role, ClassValidators.validateClassRole(role.toString()));
			}
		}
		catch(ValidationException e) {
			fail("A validation exception was thrown: " + e.getMessage());
		}
	}
/**
	 * Tests the class role validator.
	 */
Tests the class role validator.
Tests the class role validator .
@Test
	public void testValidateClassRole() {
		try {
			for(String emptyValue : ParameterSets.getEmptyValues()) {
				Assert.assertNull(ClassValidators.validateClassRole(emptyValue));
			}
			try {
				ClassValidators.validateClassRole("Invalid value.");
				fail("The class role was invalid.");
			}
			catch(ValidationException e) {
			}
			for(Clazz.Role role : Clazz.Role.values()) {
				Assert.assertEquals(role, ClassValidators.validateClassRole(role.toString()));
			}
		}
		catch(ValidationException e) {
			fail("A validation exception was thrown: " + e.getMessage());
		}
	}
@ Test public void testValidateClassRole ( ) { try { for ( String emptyValue : ParameterSets . getEmptyValues ( ) ) { Assert . assertNull ( ClassValidators . validateClassRole ( emptyValue ) ) ; } try { ClassValidators . validateClassRole ( "Invalid value." ) ; fail ( "The class role was invalid." ) ; } catch ( ValidationException e ) { } for ( Clazz . Role role : Clazz . Role . values ( ) ) { Assert . assertEquals ( role , ClassValidators . validateClassRole ( role . toString ( ) ) ) ; } } catch ( ValidationException e ) { fail ( "A validation exception was thrown: " + e . getMessage ( ) ) ; } }
Tests the class role validator.
Tests the class role validator .
// Passed.