/** * 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 { // 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()); }
/** * Called after the configuration is read to make sure that all the mandatory parameters were * specified.. * * @throws CruiseControlException if there was a configuration error. */ public void validate() throws CruiseControlException { if (name == null && file == null && environment == null) { ValidationHelper.fail("At least one of name, file or environment must be set."); } if ((name != null && (file != null || environment != null) || (file != null && (environment != null)))) { ValidationHelper.fail("At most one of name, file or environment can be set."); } if (file != null && file.trim().length() > 0) { // TODO FIXME add exists check. } if (name != null && value == null) { ValidationHelper.fail("name and value must be set simultaneoulsy."); } }
@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(); } }
/* * (non-Javadoc) * * @see net.sourceforge.cruisecontrol.Listener#validate() */ public void validate() throws CruiseControlException { // We must have at least one session to monitor ValidationHelper.assertTrue( sessions.size() > 0, "You must provide at least one nested <session> element."); // Validate the details of each provided session for (final CMSynergySession session : sessions) { session.validate(); } // If no session file was provided, use the default if (sessionFile == null) { sessionFile = new File(CMSynergy.CCM_SESSION_FILE); } }