test/org/ohmage/validator/AuditValidatorsTest.java
@Test
	public void testValidateResponseType() {
		try {
			for(String emptyValue : ParameterSets.getEmptyValues()) {
				Assert.assertNull(AuditValidators.validateResponseType(emptyValue));
			}
			
			try {
				AuditValidators.validateResponseType("Invalid value.");
				fail("The response type was an invalid value.");
			}
			catch(ValidationException e) { 
				// Passed.
			}
			
			ResponseType[] responseTypes = AuditValidators.ResponseType.values();
			for(int i = 0; i < responseTypes.length; i++) {
				Assert.assertEquals(
						responseTypes[i], 
						AuditValidators.validateResponseType(
								responseTypes[i].toString()
							)
					);
			}
		}
		catch(ValidationException e) {
			fail("A validation exception was thrown: " + e.getMessage());
		}
	}
/**
	 * Tests the response type validator.
	 */
Tests the response type validator.
Tests the response type validator .
@Test
	public void testValidateResponseType() {
		try {
			for(String emptyValue : ParameterSets.getEmptyValues()) {
				Assert.assertNull(AuditValidators.validateResponseType(emptyValue));
			}
			try {
				AuditValidators.validateResponseType("Invalid value.");
				fail("The response type was an invalid value.");
			}
			catch(ValidationException e) { 
			}
			ResponseType[] responseTypes = AuditValidators.ResponseType.values();
			for(int i = 0; i < responseTypes.length; i++) {
				Assert.assertEquals(
						responseTypes[i], 
						AuditValidators.validateResponseType(
								responseTypes[i].toString()
							)
					);
			}
		}
		catch(ValidationException e) {
			fail("A validation exception was thrown: " + e.getMessage());
		}
	}
@ Test public void testValidateResponseType ( ) { try { for ( String emptyValue : ParameterSets . getEmptyValues ( ) ) { Assert . assertNull ( AuditValidators . validateResponseType ( emptyValue ) ) ; } try { AuditValidators . validateResponseType ( "Invalid value." ) ; fail ( "The response type was an invalid value." ) ; } catch ( ValidationException e ) { } ResponseType [ ] responseTypes = AuditValidators . ResponseType . values ( ) ; for ( int i = 0 ; i < responseTypes . length ; i ++ ) { Assert . assertEquals ( responseTypes [ i ] , AuditValidators . validateResponseType ( responseTypes [ i ] . toString ( ) ) ) ; } } catch ( ValidationException e ) { fail ( "A validation exception was thrown: " + e . getMessage ( ) ) ; } }
Tests the response type validator.
Tests the response type validator .
// Passed.