/** * Standard Bootstrapper validation method. Throws an exception if any of the required properties * are not set. */ public void validate() throws CruiseControlException { ValidationHelper.assertIsSet(username, "username", this.getClass()); ValidationHelper.assertIsSet(password, "password", this.getClass()); ValidationHelper.assertIsSet(broker, "broker", this.getClass()); ValidationHelper.assertIsSet(state, "state", this.getClass()); ValidationHelper.assertIsSet(project, "project", this.getClass()); }
/** * Validates the fields of this object. * * @throws CruiseControlException if something breaks */ public void validate() throws CruiseControlException { ValidationHelper.assertIsSet(name, "name", "the <session> child element"); ValidationHelper.assertIsSet(db, "db", "the <session> child element"); ValidationHelper.assertIsSet(role, "role", "the <session> child element"); ValidationHelper.assertIsSet(user, "user", "the <session> child element"); ValidationHelper.assertIsSet(password, "password", "the <session> child element"); }
@Override public void validate() throws CruiseControlException { // Must be set ValidationHelper.assertEncoding(this.encoding, getClass()); ValidationHelper.assertIsSet(this.file, "file", getClass()); // Invalid combination ValidationHelper.assertFalse(!this.overwrite && this.append, "action not set properly"); // Set the file this.file = joinPath(this.file); ValidationHelper.assertIsNotDirectory(this.file, "file", getClass()); if (!this.overwrite) { // When overwrite is disabled, the file must not exist try { ValidationHelper.assertNotExists(this.file, "file", getClass()); } catch (CruiseControlException e) { ValidationHelper.fail("Trying to overwrite file without permition."); } } for (Content c : this.messages) { c.validate(); } }
@Override public void validate() throws CruiseControlException { // Validate ValidationHelper.assertEncoding(this.encoding, getClass()); ValidationHelper.assertIsSet(this.file, "file", getClass()); // // // Check if exists, ... // ValidationHelper.assertExists(this.file, "file", getClass()); // ValidationHelper.assertIsReadable(this.file, "file", getClass()); // ValidationHelper.assertIsNotDirectory(this.file, "file", getClass()); }
/** Handle required plugin attributes. */ public static void assertIsSet( final Object attribute, final String attributeName, final Class plugin) throws CruiseControlException { assertIsSet(attribute, attributeName, getShortClassName(plugin)); }