test/org/ohmage/validator/UserValidatorsTest.java
@Test
	public void testValidatePlaintextPassword() {
		try {
			for(String emptyValue : ParameterSets.getEmptyValues()) {
				Assert.assertNull(UserValidators.validatePlaintextPassword(emptyValue));
			}
			
//			try {
//				UserValidators.validatePlaintextPassword("Invalid value.");
//				fail("The plaintext password was invalid.");
//			}
//			catch(ValidationException e) {
//				// Passed.
//			}
			
			for(String validPassword : ParameterSets.getValidPlainTextPasswords()) {
				try {
					UserValidators.validatePlaintextPassword(validPassword);
				}
				catch(ValidationException e) {
					fail("A valid password '" + validPassword + "' failed validation: " + e.getMessage());
				}
			}
			
//			for(String invalidPassword : ParameterSets.getInvalidPlainTextPasswords()) {
//				try {
//					UserValidators.validatePlaintextPassword(invalidPassword);
//					fail("An invalid password '" + invalidPassword + "' passed validation.");
//				}
//				catch(ValidationException e) {
//					// Passed.
//				}
//			}
		}
		catch(ValidationException e) {
			fail("A validation exception was thrown: " + e.getMessage());
		}
	}
/**
	 * Test the plain text password validator.
	 */
Test the plain text password validator.
Test the plain text password validator .
@Test
	public void testValidatePlaintextPassword() {
		try {
			for(String emptyValue : ParameterSets.getEmptyValues()) {
				Assert.assertNull(UserValidators.validatePlaintextPassword(emptyValue));
			}
			for(String validPassword : ParameterSets.getValidPlainTextPasswords()) {
				try {
					UserValidators.validatePlaintextPassword(validPassword);
				}
				catch(ValidationException e) {
					fail("A valid password '" + validPassword + "' failed validation: " + e.getMessage());
				}
			}
		}
		catch(ValidationException e) {
			fail("A validation exception was thrown: " + e.getMessage());
		}
	}
@ Test public void testValidatePlaintextPassword ( ) { try { for ( String emptyValue : ParameterSets . getEmptyValues ( ) ) { Assert . assertNull ( UserValidators . validatePlaintextPassword ( emptyValue ) ) ; } for ( String validPassword : ParameterSets . getValidPlainTextPasswords ( ) ) { try { UserValidators . validatePlaintextPassword ( validPassword ) ; } catch ( ValidationException e ) { fail ( "A valid password '" + validPassword + "' failed validation: " + e . getMessage ( ) ) ; } } } catch ( ValidationException e ) { fail ( "A validation exception was thrown: " + e . getMessage ( ) ) ; } }
Test the plain text password validator.
Test the plain text password validator .
//			try { //				UserValidators.validatePlaintextPassword("Invalid value."); //				fail("The plaintext password was invalid."); //			} //			catch(ValidationException e) { //				// Passed. //			} //			for(String invalidPassword : ParameterSets.getInvalidPlainTextPasswords()) { //				try { //					UserValidators.validatePlaintextPassword(invalidPassword); //					fail("An invalid password '" + invalidPassword + "' passed validation."); //				} //				catch(ValidationException e) { //					// Passed. //				} //			}