test/org/ohmage/validator/SurveyResponseValidatorsTest.java
@Test
	public void testValidateOutputFormat() {
		try {
			for(String emptyValue : ParameterSets.getEmptyValues()) {
				Assert.assertNull(SurveyResponseValidators.validateOutputFormat(emptyValue));
			}
			
			try {
				SurveyResponseValidators.validateOutputFormat("Invalid value.");
				fail("The survey response output format was invalid.");
			}
			catch(ValidationException e) {
				// Passed.
			}
			
			for(SurveyResponse.OutputFormat outputFormat : SurveyResponse.OutputFormat.values()) {
				Assert.assertEquals(outputFormat, SurveyResponseValidators.validateOutputFormat(outputFormat.toString()));
			}
		}
		catch(ValidationException e) {
			fail("A validation exception was thrown: " + e.getMessage());
		}
	}
/**
	 * Tests the output format validator.
	 */
Tests the output format validator.
Tests the output format validator .
@Test
	public void testValidateOutputFormat() {
		try {
			for(String emptyValue : ParameterSets.getEmptyValues()) {
				Assert.assertNull(SurveyResponseValidators.validateOutputFormat(emptyValue));
			}
			try {
				SurveyResponseValidators.validateOutputFormat("Invalid value.");
				fail("The survey response output format was invalid.");
			}
			catch(ValidationException e) {
			}
			for(SurveyResponse.OutputFormat outputFormat : SurveyResponse.OutputFormat.values()) {
				Assert.assertEquals(outputFormat, SurveyResponseValidators.validateOutputFormat(outputFormat.toString()));
			}
		}
		catch(ValidationException e) {
			fail("A validation exception was thrown: " + e.getMessage());
		}
	}
@ Test public void testValidateOutputFormat ( ) { try { for ( String emptyValue : ParameterSets . getEmptyValues ( ) ) { Assert . assertNull ( SurveyResponseValidators . validateOutputFormat ( emptyValue ) ) ; } try { SurveyResponseValidators . validateOutputFormat ( "Invalid value." ) ; fail ( "The survey response output format was invalid." ) ; } catch ( ValidationException e ) { } for ( SurveyResponse . OutputFormat outputFormat : SurveyResponse . OutputFormat . values ( ) ) { Assert . assertEquals ( outputFormat , SurveyResponseValidators . validateOutputFormat ( outputFormat . toString ( ) ) ) ; } } catch ( ValidationException e ) { fail ( "A validation exception was thrown: " + e . getMessage ( ) ) ; } }
Tests the output format validator.
Tests the output format validator .
// Passed.