test/org/ohmage/validator/DocumentValidatorsTest.java
@Test
	public void testValidatePersonalDocuments() {
		try {
			for(String emptyValue : ParameterSets.getEmptyValues()) {
				Assert.assertNull(DocumentValidators.validatePersonalDocuments(emptyValue));
			}
			
			try {
				DocumentValidators.validatePersonalDocuments("Invalid value.");
				fail("The campaign ID was invalid.");
			}
			catch(ValidationException e) {
				// Passed.
			}
			
			Assert.assertEquals(true, DocumentValidators.validatePersonalDocuments("true"));
			Assert.assertEquals(false, DocumentValidators.validatePersonalDocuments("false"));
		}
		catch(ValidationException e) {
			fail("A validation exception was thrown: " + e.getMessage());
		}
	}
/**
	 * Tests the personal documents validator.
	 */
Tests the personal documents validator.
Tests the personal documents validator .
@Test
	public void testValidatePersonalDocuments() {
		try {
			for(String emptyValue : ParameterSets.getEmptyValues()) {
				Assert.assertNull(DocumentValidators.validatePersonalDocuments(emptyValue));
			}
			try {
				DocumentValidators.validatePersonalDocuments("Invalid value.");
				fail("The campaign ID was invalid.");
			}
			catch(ValidationException e) {
			}
			Assert.assertEquals(true, DocumentValidators.validatePersonalDocuments("true"));
			Assert.assertEquals(false, DocumentValidators.validatePersonalDocuments("false"));
		}
		catch(ValidationException e) {
			fail("A validation exception was thrown: " + e.getMessage());
		}
	}
@ Test public void testValidatePersonalDocuments ( ) { try { for ( String emptyValue : ParameterSets . getEmptyValues ( ) ) { Assert . assertNull ( DocumentValidators . validatePersonalDocuments ( emptyValue ) ) ; } try { DocumentValidators . validatePersonalDocuments ( "Invalid value." ) ; fail ( "The campaign ID was invalid." ) ; } catch ( ValidationException e ) { } Assert . assertEquals ( true , DocumentValidators . validatePersonalDocuments ( "true" ) ) ; Assert . assertEquals ( false , DocumentValidators . validatePersonalDocuments ( "false" ) ) ; } catch ( ValidationException e ) { fail ( "A validation exception was thrown: " + e . getMessage ( ) ) ; } }
Tests the personal documents validator.
Tests the personal documents validator .
// Passed.