test/org/ohmage/validator/SurveyResponseValidatorsTest.java
@Test
	public void testValidateCollapse() {
		try {
			for(String emptyValue : ParameterSets.getEmptyValues()) {
				Assert.assertNull(SurveyResponseValidators.validateCollapse(emptyValue));
			}
			
			try {
				SurveyResponseValidators.validateCollapse("Invalid value.");
				fail("The collapse value was invalid.");
			}
			catch(ValidationException e) {
				// Passed.
			}
			
			Assert.assertEquals(true, SurveyResponseValidators.validateCollapse("true"));
			Assert.assertEquals(false, SurveyResponseValidators.validateCollapse("false"));
		}
		catch(ValidationException e) {
			fail("A validation exception was thrown: " + e.getMessage());
		}
	}
/**
	 * Tests the collapse value validator.
	 */
Tests the collapse value validator.
Tests the collapse value validator .
@Test
	public void testValidateCollapse() {
		try {
			for(String emptyValue : ParameterSets.getEmptyValues()) {
				Assert.assertNull(SurveyResponseValidators.validateCollapse(emptyValue));
			}
			try {
				SurveyResponseValidators.validateCollapse("Invalid value.");
				fail("The collapse value was invalid.");
			}
			catch(ValidationException e) {
			}
			Assert.assertEquals(true, SurveyResponseValidators.validateCollapse("true"));
			Assert.assertEquals(false, SurveyResponseValidators.validateCollapse("false"));
		}
		catch(ValidationException e) {
			fail("A validation exception was thrown: " + e.getMessage());
		}
	}
@ Test public void testValidateCollapse ( ) { try { for ( String emptyValue : ParameterSets . getEmptyValues ( ) ) { Assert . assertNull ( SurveyResponseValidators . validateCollapse ( emptyValue ) ) ; } try { SurveyResponseValidators . validateCollapse ( "Invalid value." ) ; fail ( "The collapse value was invalid." ) ; } catch ( ValidationException e ) { } Assert . assertEquals ( true , SurveyResponseValidators . validateCollapse ( "true" ) ) ; Assert . assertEquals ( false , SurveyResponseValidators . validateCollapse ( "false" ) ) ; } catch ( ValidationException e ) { fail ( "A validation exception was thrown: " + e . getMessage ( ) ) ; } }
Tests the collapse value validator.
Tests the collapse value validator .
// Passed.