test/org/ohmage/validator/ImageValidatorsTest.java
@Test
	public void testValidateImageSize() {
		try {
			for(String emptyValue : ParameterSets.getEmptyValues()) {
				Assert.assertEquals(Image.ORIGINAL, ImageValidators.validateImageSize(emptyValue));
			}
			
			try {
				ImageValidators.validateImageSize("Invalid value.");
				fail("The image size was invalid.");
			}
			catch(ValidationException e) {
				// Passed.
			}

			Assert
				.assertEquals(
					Image.ORIGINAL,
					ImageValidators
						.validateImageSize(Image.ORIGINAL.getName()));
			Assert
				.assertEquals(
					Image.SMALL,
					ImageValidators
						.validateImageSize(Image.SMALL.getName()));
			Assert
				.assertEquals(
					Image.ICON,
					ImageValidators
						.validateImageSize(Image.ICON.getName()));
		}
		catch(ValidationException e) {
			fail("A validation exception was thrown: " + e.getMessage());
		}
	}
/**
	 * Tests the image size validator.
	 */
Tests the image size validator.
Tests the image size validator .
@Test
	public void testValidateImageSize() {
		try {
			for(String emptyValue : ParameterSets.getEmptyValues()) {
				Assert.assertEquals(Image.ORIGINAL, ImageValidators.validateImageSize(emptyValue));
			}
			try {
				ImageValidators.validateImageSize("Invalid value.");
				fail("The image size was invalid.");
			}
			catch(ValidationException e) {
			}
			Assert
				.assertEquals(
					Image.ORIGINAL,
					ImageValidators
						.validateImageSize(Image.ORIGINAL.getName()));
			Assert
				.assertEquals(
					Image.SMALL,
					ImageValidators
						.validateImageSize(Image.SMALL.getName()));
			Assert
				.assertEquals(
					Image.ICON,
					ImageValidators
						.validateImageSize(Image.ICON.getName()));
		}
		catch(ValidationException e) {
			fail("A validation exception was thrown: " + e.getMessage());
		}
	}
@ Test public void testValidateImageSize ( ) { try { for ( String emptyValue : ParameterSets . getEmptyValues ( ) ) { Assert . assertEquals ( Image . ORIGINAL , ImageValidators . validateImageSize ( emptyValue ) ) ; } try { ImageValidators . validateImageSize ( "Invalid value." ) ; fail ( "The image size was invalid." ) ; } catch ( ValidationException e ) { } Assert . assertEquals ( Image . ORIGINAL , ImageValidators . validateImageSize ( Image . ORIGINAL . getName ( ) ) ) ; Assert . assertEquals ( Image . SMALL , ImageValidators . validateImageSize ( Image . SMALL . getName ( ) ) ) ; Assert . assertEquals ( Image . ICON , ImageValidators . validateImageSize ( Image . ICON . getName ( ) ) ) ; } catch ( ValidationException e ) { fail ( "A validation exception was thrown: " + e . getMessage ( ) ) ; } }
Tests the image size validator.
Tests the image size validator .
// Passed.