commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/latka/src/java/org/apache/commons/latka AbstractReporter.java
Date Tue, 29 Jan 2002 00:38:37 GMT
dion        02/01/28 16:38:37

  Modified:    latka/src/java/org/apache/commons/latka
                        AbstractReporter.java
  Log:
  Formatting changes
  
  Revision  Changes    Path
  1.11      +141 -141  jakarta-commons/latka/src/java/org/apache/commons/latka/AbstractReporter.java
  
  Index: AbstractReporter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/AbstractReporter.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- AbstractReporter.java	29 Jan 2002 00:33:41 -0000	1.10
  +++ AbstractReporter.java	29 Jan 2002 00:38:37 -0000	1.11
  @@ -79,148 +79,148 @@
    *
    * @author Rodney Waldhoff
    * @author Morgan Delagrange
  - * @version $Revision: 1.10 $
  + * @version $Revision: 1.11 $
    */
   public abstract class AbstractReporter implements LatkaEventInfo {
   
  -  /**
  -   * maps the request to it's success or failure as a Boolean
  -   */
  -  protected Map _requestSucceeded = new HashMap();
  -  /**
  -   * maps the session to it's success or failure as a Boolean
  -   */
  -  protected Map _sessionSucceeded = new HashMap();
  -
  -  /**
  -   * Holds whether or not the entire suite has succeeded
  -   * This is set to false when <strong>any</strong> request fails.
  -   */
  -  protected boolean _suiteSucceeded = true;
  -
  -  /**
  -   * Holds the failed responses received by this object.
  -   * @see #requestFailed(RequestEvent)
  -   */
  -  protected List _failedResponses = new LinkedList();
  -
  -  /**
  -   * The log4J category used for processing log requests.
  -   */
  -  protected static final Category _log = 
  -  Category.getInstance(AbstractReporter.class);
  -
  -  /**
  -   * Invoked if the request succeeds.
  -   * Records the success
  -   *
  -   * @param event  a successful request event
  -   */
  -  public void requestSucceeded(RequestEvent event) {
  -    recordSuccess(event, true);
  -  }
  -
  -  /**
  -   * Invoked if the request failed.
  -   * Records the failure and adds the request's response to the list of
  -   * failed responses
  -   *
  -   * @param event  a "failed" request event.
  -   */
  -  public void requestFailed(RequestEvent event) {
  -    recordSuccess(event, false);
  -    _failedResponses.add(event.getResponse());
  -  }
  -
  -  /**
  -   * A skipped request.
  -   * Records the skip as a failure
  -   *
  -   * @param event  a "skipped" request.
  -   */
  -  public void requestSkipped(RequestEvent event) {
  -    recordSuccess(event, false);
  -  }
  -
  -  /**
  -   * Invoked if a request error occurs.
  -   * Records the error as a failure
  -   *
  -   * @param event  a request "error" event.
  -   */
  -  public void requestError(RequestEvent event) {
  -    recordSuccess(event, false);
  -  }
  -
  -  /**
  -   * Record the "success status" of a request event.
  -   * On a failed request, the current suite, request and session are
  -   * marked as failed
  -   *
  -   * param event  a request event.
  -   * param bool   the success (<code>true</code>) or failure
  -   * (<code>false</code>) of the request.
  -   */
  -  protected void recordSuccess (RequestEvent event, boolean bool) {
  -    if (bool == false) {
  -      _suiteSucceeded = false;
  -      _requestSucceeded.put(event.getRequest(),new Boolean(bool));
  -      _sessionSucceeded.put(event.getSession(),new Boolean(bool));
  -      _log.info("request failed");
  -    }
  -
  -  }
  -
  -  /**
  -   * Check to see if a particular Request succeeded or failed.
  -   *
  -   * @param request the request to check for success or
  -   * failure
  -   * @return true if request succeeded
  -   */
  -  public boolean didRequestSucceed(Request request) {
  -    Boolean bool = (Boolean) _requestSucceeded.get(request);
  -
  -    if (bool == null || bool.booleanValue() == true) {
  -      return true;
  -    } else {
  -      return false;
  -    }
  -
  -  }
  -
  -  /**
  -   * Check to see if a particular Session succeeded or failed.
  -   * Once a request inside a session fails, the session itself
  -   * is marked as a failure.
  -   *
  -   * @param session the session to check for success or
  -   * failure
  -   * @return true if all requests in the session succeeded
  -   */
  -  public boolean didSessionSucceed(Session session) {
  -    Boolean bool = (Boolean) _sessionSucceeded.get(session);
  -
  -    if (bool == null || bool.booleanValue() == true) {
  -      return true;
  -    } else {
  -      return false;
  -    }
  -  }
  -
  -  /**
  -   * Returns true if all Requests in the suite succeed.
  -   *
  -   * @return true if all Requests have succeeded
  -   */
  -  public boolean didSuiteSucceed() {
  -    return _suiteSucceeded;
  -  }
  -
  -  /**
  -   * @return a list of all responses of failed requests
  -   */
  -  public List getFailedResponses() {
  -    return _failedResponses;
  -  }
  +    /**
  +     * maps the request to it's success or failure as a Boolean
  +     */
  +    protected Map _requestSucceeded = new HashMap();
  +  
  +    /**
  +     * maps the session to it's success or failure as a Boolean
  +     */
  +    protected Map _sessionSucceeded = new HashMap();
  +
  +    /**
  +     * Holds whether or not the entire suite has succeeded
  +     * This is set to false when <strong>any</strong> request fails.
  +     */
  +    protected boolean _suiteSucceeded = true;
  +
  +    /**
  +     * Holds the failed responses received by this object.
  +     * @see #requestFailed(RequestEvent)
  +     */
  +    protected List _failedResponses = new LinkedList();
  +
  +    /**
  +     * The log4J category used for processing log requests.
  +     */
  +    protected static final Category _log = 
  +                                Category.getInstance(AbstractReporter.class);
  +
  +    /**
  +     * Invoked if the request succeeds.
  +     * Records the success
  +     *
  +     * @param event  a successful request event
  +     */
  +    public void requestSucceeded(RequestEvent event) {
  +        recordSuccess(event, true);
  +    }
  +
  +    /**
  +     * Invoked if the request failed.
  +     * Records the failure and adds the request's response to the list of
  +     * failed responses
  +     *
  +     * @param event  a "failed" request event.
  +     */
  +    public void requestFailed(RequestEvent event) {
  +        recordSuccess(event, false);
  +        _failedResponses.add(event.getResponse());
  +    }
  +
  +    /**
  +     * A skipped request.
  +     * Records the skip as a failure
  +     *
  +     * @param event  a "skipped" request.
  +     */
  +    public void requestSkipped(RequestEvent event) {
  +        recordSuccess(event, false);
  +    }
  +
  +    /**
  +     * Invoked if a request error occurs.
  +     * Records the error as a failure
  +     *
  +     * @param event  a request "error" event.
  +     */
  +    public void requestError(RequestEvent event) {
  +        recordSuccess(event, false);
  +    }
  +
  +    /**
  +     * Record the "success status" of a request event.
  +     * On a failed request, the current suite, request and session are
  +     * marked as failed
  +     *
  +     * param event  a request event.
  +     * param bool   the success (<code>true</code>) or failure
  +     * (<code>false</code>) of the request.
  +     */
  +    protected void recordSuccess (RequestEvent event, boolean bool) {
  +        if (bool == false) {
  +            _suiteSucceeded = false;
  +            _requestSucceeded.put(event.getRequest(),new Boolean(bool));
  +            _sessionSucceeded.put(event.getSession(),new Boolean(bool));
  +            _log.info("request failed");
  +        }
  +    }
  +
  +    /**
  +     * Check to see if a particular Request succeeded or failed.
  +     *
  +     * @param request the request to check for success or
  +     * failure
  +     * @return true if request succeeded
  +     */
  +    public boolean didRequestSucceed(Request request) {
  +        Boolean bool = (Boolean) _requestSucceeded.get(request);
  +
  +        if (bool == null || bool.booleanValue() == true) {
  +            return true;
  +        } else {
  +            return false;
  +        }
  +
  +    }
  +
  +    /**
  +     * Check to see if a particular Session succeeded or failed.
  +     * Once a request inside a session fails, the session itself
  +     * is marked as a failure.
  +     *
  +     * @param session the session to check for success or
  +     * failure
  +     * @return true if all requests in the session succeeded
  +     */
  +    public boolean didSessionSucceed(Session session) {
  +        Boolean bool = (Boolean) _sessionSucceeded.get(session);
  +
  +        if (bool == null || bool.booleanValue() == true) {
  +            return true;
  +        } else {
  +            return false;
  +        }
  +    }
  +
  +    /**
  +     * Returns true if all Requests in the suite succeed.
  +     *
  +     * @return true if all Requests have succeeded
  +     */
  +    public boolean didSuiteSucceed() {
  +        return _suiteSucceeded;
  +    }
  +
  +    /**
  +     * @return a list of all responses of failed requests
  +     */
  +    public List getFailedResponses() {
  +        return _failedResponses;
  +    }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message