use of org.olat.user.propertyhandlers.URLPropertyHandler in project OpenOLAT by OpenOLAT.
the class UserPropertiesTest method testURLPropertyHandlerValidation.
@Test
public void testURLPropertyHandlerValidation() {
URLPropertyHandler urlHandler = new URLPropertyHandler();
ValidationError error = new ValidationError();
// test for valid URL's
assertTrue(urlHandler.isValidValue(null, "http://www.openolat.org", error, null));
assertTrue(urlHandler.isValidValue(null, "https://www.openolat.org", error, null));
assertTrue(urlHandler.isValidValue(null, "http://test.ch", error, null));
assertTrue(urlHandler.isValidValue(null, "http://localhost", error, null));
// test for invalid URL's
assertFalse(urlHandler.isValidValue(null, "http:www.openolat.org", error, null));
assertFalse(urlHandler.isValidValue(null, "www.openolat.org", error, null));
}
use of org.olat.user.propertyhandlers.URLPropertyHandler in project openolat by klemens.
the class UserPropertiesTest method testURLPropertyHandlerValidation.
@Test
public void testURLPropertyHandlerValidation() {
URLPropertyHandler urlHandler = new URLPropertyHandler();
ValidationError error = new ValidationError();
// test for valid URL's
assertTrue(urlHandler.isValidValue(null, "http://www.openolat.org", error, null));
assertTrue(urlHandler.isValidValue(null, "https://www.openolat.org", error, null));
assertTrue(urlHandler.isValidValue(null, "http://test.ch", error, null));
assertTrue(urlHandler.isValidValue(null, "http://localhost", error, null));
// test for invalid URL's
assertFalse(urlHandler.isValidValue(null, "http:www.openolat.org", error, null));
assertFalse(urlHandler.isValidValue(null, "www.openolat.org", error, null));
}
Aggregations