test/org/ohmage/validator/VisualizationValidatorsTest.java
@Test
	public void testValidateEndDate() {
		try {
			for(String emptyValue : ParameterSets.getEmptyValues()) {
				Assert.assertNull(VisualizationValidators.validateEndDate(emptyValue));
			}
			
			try {
				VisualizationValidators.validateEndDate("Invalid value.");
				fail("The start date was an invalid value.");
			}
			catch(ValidationException e) { 
				// Passed.
			}

			Map<DateTime, String> dateToString = ParameterSets.getDateToString();
			for(DateTime date : dateToString.keySet()) {
				Assert.assertEquals(date, VisualizationValidators.validateEndDate(dateToString.get(date)));
			}
			
			/*
			Map<DateTime, String> dateTimeToString = ParameterSets.getDateTimeToString();
			for(String dateString : dateTimeToString.values()) {
				try {
					VisualizationValidators.validateEndDate(dateString);
					fail("A date-time passed validation when only dates are allowed: " + dateString);
				}
				catch(ValidationException e) {
					// Passed.
				}
			}
			*/
		}
		catch(ValidationException e) {
			fail("A validation exception was thrown: " + e.getMessage());
		}
	}
/**
	 * Tests the end date validator.
	 */
Tests the end date validator.
Tests the end date validator .
@Test
	public void testValidateEndDate() {
		try {
			for(String emptyValue : ParameterSets.getEmptyValues()) {
				Assert.assertNull(VisualizationValidators.validateEndDate(emptyValue));
			}
			try {
				VisualizationValidators.validateEndDate("Invalid value.");
				fail("The start date was an invalid value.");
			}
			catch(ValidationException e) { 
			}
			Map<DateTime, String> dateToString = ParameterSets.getDateToString();
			for(DateTime date : dateToString.keySet()) {
				Assert.assertEquals(date, VisualizationValidators.validateEndDate(dateToString.get(date)));
			}
			/*
			Map<DateTime, String> dateTimeToString = ParameterSets.getDateTimeToString();
			for(String dateString : dateTimeToString.values()) {
				try {
					VisualizationValidators.validateEndDate(dateString);
					fail("A date-time passed validation when only dates are allowed: " + dateString);
				}
				catch(ValidationException e) {
				}
			}
			*/
		}
		catch(ValidationException e) {
			fail("A validation exception was thrown: " + e.getMessage());
		}
	}
@ Test public void testValidateEndDate ( ) { try { for ( String emptyValue : ParameterSets . getEmptyValues ( ) ) { Assert . assertNull ( VisualizationValidators . validateEndDate ( emptyValue ) ) ; } try { VisualizationValidators . validateEndDate ( "Invalid value." ) ; fail ( "The start date was an invalid value." ) ; } catch ( ValidationException e ) { } Map < DateTime , String > dateToString = ParameterSets . getDateToString ( ) ; for ( DateTime date : dateToString . keySet ( ) ) { Assert . assertEquals ( date , VisualizationValidators . validateEndDate ( dateToString . get ( date ) ) ) ; } /*
			Map<DateTime, String> dateTimeToString = ParameterSets.getDateTimeToString();
			for(String dateString : dateTimeToString.values()) {
				try {
					VisualizationValidators.validateEndDate(dateString);
					fail("A date-time passed validation when only dates are allowed: " + dateString);
				}
				catch(ValidationException e) {
					// Passed.
				}
			}
			*/ } catch ( ValidationException e ) { fail ( "A validation exception was thrown: " + e . getMessage ( ) ) ; } }
Tests the end date validator.
Tests the end date validator .
// Passed.