commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morg...@apache.org
Subject cvs commit: jakarta-commons/latka/src/java/org/apache/commons/latka/junit JUnitEventReporter.java JUnitTestAdapter.java
Date Fri, 11 Oct 2002 18:38:10 GMT
morgand     2002/10/11 11:38:10

  Modified:    latka/src/java/org/apache/commons/latka
                        AbstractReporter.java Latka.java XMLReporter.java
               latka/src/java/org/apache/commons/latka/jelly
                        JellyUtils.java SuiteTag.java
               latka/src/java/org/apache/commons/latka/junit
                        JUnitEventReporter.java JUnitTestAdapter.java
  Added:       latka/src/java/org/apache/commons/latka
                        DefaultLatkaEventInfo.java
  Log:
  minor event model refactor, AbstractReporter now only implements
  LatkaEventListener, created DefaultLatkaEventInfo(LatkaEventListener)
  
  Revision  Changes    Path
  1.21      +3 -146    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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- AbstractReporter.java	29 Jun 2002 09:34:10 -0000	1.20
  +++ AbstractReporter.java	11 Oct 2002 18:38:10 -0000	1.21
  @@ -60,15 +60,7 @@
    */
   package org.apache.commons.latka;
   
  -import org.apache.commons.latka.event.LatkaEventInfo;
  -import org.apache.commons.latka.event.RequestEvent;
  -import org.apache.commons.latka.http.Request;
  -import org.apache.commons.latka.http.Session;
  -
  -import java.util.HashMap;
  -import java.util.LinkedList;
  -import java.util.List;
  -import java.util.Map;
  +import org.apache.commons.latka.event.LatkaEventListener;
   
   import org.apache.log4j.Category;
   
  @@ -82,29 +74,7 @@
    * @author Morgan Delagrange
    * @version $Revision$
    */
  -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();
  +public abstract class AbstractReporter implements LatkaEventListener {
   
       /**
        * The log4J category used for processing log requests.
  @@ -112,117 +82,4 @@
       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;
  -    }
  -
  -    /**
  -     * List failed responses
  -     * @return a list of all responses of failed requests
  -     */
  -    public List getFailedResponses() {
  -        return _failedResponses;
  -    }
   }
  
  
  
  1.38      +4 -3      jakarta-commons/latka/src/java/org/apache/commons/latka/Latka.java
  
  Index: Latka.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/Latka.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- Latka.java	14 Jul 2002 16:40:50 -0000	1.37
  +++ Latka.java	11 Oct 2002 18:38:10 -0000	1.38
  @@ -319,6 +319,7 @@
   
           String xml = null;
           XMLReporter listener = new XMLReporter();
  +        LatkaEventInfo info = new DefaultLatkaEventInfo(listener);
   
           try {
   
  @@ -326,7 +327,7 @@
               Suite suite = new Suite(url);
   
   
  -            runTests(suite, listener);
  +            runTests(suite, info);
   
               xml = listener.getDocumentAsString();
               logXML(xml);
  @@ -336,7 +337,7 @@
   
           System.out.println(transformXML(xml));
   
  -        if (listener.didSuiteSucceed() == false) {
  +        if (info.didSuiteSucceed() == false) {
               // throw an exception, so the process will
               // return as a failure
               throw new LatkaException("SUITE FAILED");
  
  
  
  1.21      +16 -16    jakarta-commons/latka/src/java/org/apache/commons/latka/XMLReporter.java
  
  Index: XMLReporter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/XMLReporter.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- XMLReporter.java	29 Jun 2002 12:18:10 -0000	1.20
  +++ XMLReporter.java	11 Oct 2002 18:38:10 -0000	1.21
  @@ -66,12 +66,13 @@
   import java.io.PrintWriter;
   import java.io.StringWriter;
   // latka imports
  -import org.apache.commons.latka.http.Request;
  +import org.apache.commons.latka.event.LatkaEventListener;
   import org.apache.commons.latka.event.ReportMessageEvent;
   import org.apache.commons.latka.event.RequestErrorEvent;
   import org.apache.commons.latka.event.RequestEvent;
   import org.apache.commons.latka.event.RequestFailedEvent;
   import org.apache.commons.latka.event.SuiteEvent;
  +import org.apache.commons.latka.http.Request;
   // jdom imports
   import org.jdom.Document;
   import org.jdom.Element;
  @@ -90,7 +91,7 @@
    * @author dIon Gillard
    * @version $Id$
    */
  -public class XMLReporter extends AbstractReporter {
  +public class XMLReporter extends AbstractReporter implements LatkaEventListener {
       /** JDOM document produced as output */
       protected Document _doc         = null;
       /** top level element of JDOM document, a &lt;report&gt; element*/
  @@ -98,6 +99,8 @@
       /** used for output as tests run */                   
       protected PrintWriter _printWriter = new PrintWriter(System.out);
   
  +    protected boolean _didSuiteSucceed = true;
  +
       /**
        * Create an XML Reporter, initialising document property, as a new empty
        * report with an unsuccessful suite
  @@ -143,9 +146,10 @@
        * @param event the event detailing the request in error
        */
       public void requestError(RequestEvent event) {
  +        _didSuiteSucceed = false;
  +
           _printWriter.print("E");
           _printWriter.flush();
  -        super.requestError(event);
   
           RequestErrorEvent errorEvent = (RequestErrorEvent) event;
           // <root><request><requestError><label>errortext</label>
  @@ -167,8 +171,6 @@
           _printWriter.print(".");
           _printWriter.flush();
       
  -        super.requestSucceeded(event);
  -
           _rootElement.addContent(createRequestElement(event)
                                   .addContent(new Element("requestSuccess"))
                                  );
  @@ -179,12 +181,11 @@
        * @param event the event detailing the request that failed
        */
       public void requestFailed(RequestEvent event) {
  -    
  +        _didSuiteSucceed = false;
  +
           _printWriter.print("F");
           _printWriter.flush();
       
  -        super.requestFailed(event);
  -
           RequestFailedEvent failedEvent = (RequestFailedEvent) event;
   
           // <root><request><requestFailure responseId="xxx"><label>XXX</label>
  @@ -208,12 +209,11 @@
        * @param event the event detailing the request that was skipped
        */
       public void requestSkipped(RequestEvent event) {
  -        
  +        _didSuiteSucceed = false;
  +
           _printWriter.print("S");
           _printWriter.flush();
       
  -        super.requestSkipped(event);
  -
           Request request = event.getRequest();
           // <root><request><requestSkipped/></request></root>
           _rootElement.addContent(createRequestElement(event)
  @@ -239,7 +239,7 @@
        */
       public void suiteCompleted(SuiteEvent event) {
           _rootElement.getAttribute("suiteSuccess").setValue(
  -            String.valueOf(didSuiteSucceed()));
  +            String.valueOf(_didSuiteSucceed));
       }
   
       /**
  
  
  
  1.1                  jakarta-commons/latka/src/java/org/apache/commons/latka/DefaultLatkaEventInfo.java
  
  Index: DefaultLatkaEventInfo.java
  ===================================================================
  /*
   *
   *
   *
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  package org.apache.commons.latka;
  
  import org.apache.commons.latka.event.LatkaEventInfo;
  import org.apache.commons.latka.event.LatkaEventListener;
  import org.apache.commons.latka.event.ReportMessageEvent;
  import org.apache.commons.latka.event.RequestEvent;
  import org.apache.commons.latka.event.SuiteEvent;
  import org.apache.commons.latka.http.Request;
  import org.apache.commons.latka.http.Session;
  
  import java.util.HashMap;
  import java.util.LinkedList;
  import java.util.List;
  import java.util.Map;
  
  import org.apache.log4j.Category;
  
  /**
   * The base class for several 'reporters'.
   *
   * A reporter is a class that will store or record information about events that
   * occur during Latka processing
   *
   * @author Rodney Waldhoff
   * @author Morgan Delagrange
   * @version $Revision: 1.1 $
   */
  public class DefaultLatkaEventInfo 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();
  
      protected LatkaEventListener _listener = null;
  
      /**
       * The log4J category used for processing log requests.
       */
      protected static final Category _log =
                                  Category.getInstance(DefaultLatkaEventInfo.class);
  
      public DefaultLatkaEventInfo(LatkaEventListener listener) {
          _listener = listener;
      }
  
      /**
       * Invoked if the request succeeds.
       * Records the success
       *
       * @param event  a successful request event
       */
      public void requestSucceeded(RequestEvent event) {
          recordSuccess(event, true);
          _listener.requestSucceeded(event);
      }
  
      /**
       * 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());
          _listener.requestFailed(event);
      }
  
      /**
       * A skipped request.
       * Records the skip as a failure
       *
       * @param event  a "skipped" request.
       */
      public void requestSkipped(RequestEvent event) {
          recordSuccess(event, false);
          _listener.requestSkipped(event);
      }
  
      /**
       * 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);
          _listener.requestError(event);
      }
  
      /**
       * Invoked if a Latka suite wants to send a message to the 
       * report generated for the test.  Some implementations
       * of the LatkaEventListener may not generate reports.
       * 
       * @param event  Event containing the report message
       */
      public void reportMessage(ReportMessageEvent event) {
          _listener.reportMessage(event);
      }
  
      /**
       * Invoke when all requests completed.
       *
       * @param event suite event
       */
      public void suiteCompleted(SuiteEvent event) {
          _listener.suiteCompleted(event);
      }
  
      /**
       * 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;
      }
  
      /**
       * List failed responses
       * @return a list of all responses of failed requests
       */
      public List getFailedResponses() {
          return _failedResponses;
      }
  }
  
  
  
  1.4       +40 -5     jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/JellyUtils.java
  
  Index: JellyUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/JellyUtils.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JellyUtils.java	8 Oct 2002 19:29:01 -0000	1.3
  +++ JellyUtils.java	11 Oct 2002 18:38:10 -0000	1.4
  @@ -64,6 +64,7 @@
   import org.apache.commons.jelly.JellyContext;
   
   import org.apache.commons.latka.event.LatkaEventInfo;
  +import org.apache.commons.latka.event.LatkaEventListener;
   
   /**
    *
  @@ -73,6 +74,8 @@
           
       protected static final String EVENT_INFO_VAR =
           "latkaEventInfo";
  +    protected static final String EVENT_LISTENER_VAR =
  +        "latkaEventListener";
   
       protected static JellyUtils _utils = new JellyUtils();
   
  @@ -99,11 +102,43 @@
       /**
        * Provide a LatkaEventInfo object.
        * 
  -     * @param context LatkaEventInfo object
  -     * @param info
  +     * @param context 
  +     * @param listener LatkaEventInfo object
        */
       public void setLatkaEventInfo(JellyContext context, LatkaEventInfo info) {
           context.setVariable(EVENT_INFO_VAR,info);
  +    }
  +
  +
  +    /**
  +     * Remove a LatkaEventInfo object.
  +     * 
  +     * @param context 
  +     */
  +    public void removeLatkaEventInfo(JellyContext context) {
  +        context.removeVariable(EVENT_INFO_VAR);
  +    }
  +
  +    /**
  +     * Return the LatkaEventListener for the context,
  +     * or null if none has been set
  +     * 
  +     * @param context Context for the current Jelly script
  +     * @return LatkaEventListener for the context,
  +     *         or null if none has been set
  +     */
  +    public LatkaEventListener getLatkaEventListener(JellyContext context) {
  +        return (LatkaEventListener) context.getVariable(EVENT_LISTENER_VAR);
  +    }
  +
  +    /**
  +     * Provide a LatkaEventListener object.
  +     * 
  +     * @param context 
  +     * @param listener LatkaEventListener object
  +     */
  +    public void setLatkaEventListener(JellyContext context, LatkaEventListener listener)
{
  +        context.setVariable(EVENT_LISTENER_VAR,listener);
       }
   
   }
  
  
  
  1.18      +25 -14    jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/SuiteTag.java
  
  Index: SuiteTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/SuiteTag.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- SuiteTag.java	10 Oct 2002 19:18:36 -0000	1.17
  +++ SuiteTag.java	11 Oct 2002 18:38:10 -0000	1.18
  @@ -67,10 +67,12 @@
   import org.apache.commons.jelly.TagSupport;
   import org.apache.commons.jelly.XMLOutput;
   
  +import org.apache.commons.latka.DefaultLatkaEventInfo;
   import org.apache.commons.latka.Latka;
   import org.apache.commons.latka.LatkaException;
   import org.apache.commons.latka.XMLReporter;
   import org.apache.commons.latka.event.LatkaEventInfo;
  +import org.apache.commons.latka.event.LatkaEventListener;
   import org.apache.commons.latka.event.SuiteCompletedEvent;
   
   /**
  @@ -99,27 +101,36 @@
        * @throws Exception when any error occurs
        */
       public void doTag(XMLOutput xmlOutput) throws Exception {
  -        LatkaEventInfo reporter = 
  -            JellyUtils.getInstance().getLatkaEventInfo(getContext());
  -        // if an enclosing tag does not specify a reporter, provide a default
  -        boolean defaultReporter = false;
  -        if (reporter == null) {
  -            reporter = new XMLReporter();
  -            JellyUtils.getInstance().setLatkaEventInfo(getContext(),reporter);
  -            defaultReporter = true;
  +        // if an enclosing tag does not specify a listener, provide a default
  +        boolean defaultListener = false;
  +        LatkaEventListener listener = null;
  +        LatkaEventInfo eventInfo = null;
  +        {
  +            listener = 
  +                JellyUtils.getInstance().getLatkaEventListener(getContext());
  +            if (listener == null) {
  +                listener = new XMLReporter();
  +                defaultListener = true;
  +            }
  +
  +            eventInfo = new DefaultLatkaEventInfo(listener);
  +            JellyUtils.getInstance().setLatkaEventInfo(getContext(), eventInfo);
           }
   
  +
           _settings = 
               new SuiteSettings(_defaultHost, _defaultPort, _defaultProxyHost, 
                                 _defaultProxyPort);
           invokeBody(xmlOutput);
   
  -        reporter.suiteCompleted(new SuiteCompletedEvent());
  +        eventInfo.suiteCompleted(new SuiteCompletedEvent());
  +        JellyUtils.getInstance().removeLatkaEventInfo(getContext());
   
  -        if (reporter.didSuiteSucceed() == false && defaultReporter == true) {
  +        if (eventInfo.didSuiteSucceed() == false && defaultListener == true) {
               Latka latka = new Latka();
               String transformedReport = 
  -                latka.transformXML(((XMLReporter) reporter).getDocumentAsString());
  +                latka.transformXML(((XMLReporter) listener).getDocumentAsString());
  +
   
               throw new LatkaException("SUITE FAILED: \n" + transformedReport);
           }
  
  
  
  1.10      +4 -8      jakarta-commons/latka/src/java/org/apache/commons/latka/junit/JUnitEventReporter.java
  
  Index: JUnitEventReporter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/junit/JUnitEventReporter.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JUnitEventReporter.java	14 Jul 2002 16:51:34 -0000	1.9
  +++ JUnitEventReporter.java	11 Oct 2002 18:38:10 -0000	1.10
  @@ -178,7 +178,6 @@
        */
       public void requestError(RequestEvent event) {
           _log.debug("Received latka RequestErrorEvent");
  -        super.requestError(event);
           Throwable error = ((RequestErrorEvent) event).getError();
           Test test = new EventTestAdapter(error);
           test.run(_testResult);
  @@ -190,7 +189,6 @@
        */   
       public  void requestFailed(RequestEvent event) {
           _log.debug("Received latka RequestFailedEvent");
  -        super.requestFailed(event);
           RequestFailedEvent fe = (RequestFailedEvent) event;
           ValidationException ve = (ValidationException) 
               fe.getValidationException();
  @@ -209,7 +207,6 @@
        */   
       public void requestSkipped(RequestEvent event) {
           _log.debug("Received latka RequestSkippedEvent");
  -        super.requestSkipped(event);
           AssertionFailedError failure = new AssertionFailedError(
                                           "Skipped due to earlier error");
           Test test = new EventTestAdapter(failure);
  @@ -222,7 +219,6 @@
        */   
       public void requestSucceeded(RequestEvent event) {
           _log.debug("Received latka RequestSucceededEvent");
  -        super.requestSucceeded(event);
           Test test = new EventTestAdapter();
           test.run(_testResult);
       }
  
  
  
  1.15      +7 -6      jakarta-commons/latka/src/java/org/apache/commons/latka/junit/JUnitTestAdapter.java
  
  Index: JUnitTestAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/junit/JUnitTestAdapter.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- JUnitTestAdapter.java	14 Jul 2002 16:51:34 -0000	1.14
  +++ JUnitTestAdapter.java	11 Oct 2002 18:38:10 -0000	1.15
  @@ -72,6 +72,7 @@
   import javax.xml.parsers.SAXParser;
   import javax.xml.parsers.SAXParserFactory;
   // latka imports
  +import org.apache.commons.latka.DefaultLatkaEventInfo;
   import org.apache.commons.latka.Latka;
   import org.apache.commons.latka.LatkaException;
   import org.apache.commons.latka.Suite;
  @@ -291,7 +292,7 @@
           _log.debug("Attempting to perform latka tests");
           Latka latka = new Latka();
           try {
  -            latka.runTests(_latkaSuite, new JUnitEventReporter(r));
  +            latka.runTests(_latkaSuite, new DefaultLatkaEventInfo(new JUnitEventReporter(r)));
           } catch (LatkaException e) {
               _log.error("Unable to execute latka tests", e);
           }
  
  
  

--
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