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/jelly SuiteTag.java
Date Tue, 08 Oct 2002 20:48:38 GMT
morgand     2002/10/08 13:48:38

  Modified:    latka/src/java/org/apache/commons/latka/jelly SuiteTag.java
  Log:
  added contents of Latka report to exception (possibly temporary)
  
  Revision  Changes    Path
  1.16      +12 -5     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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- SuiteTag.java	8 Oct 2002 20:36:33 -0000	1.15
  +++ SuiteTag.java	8 Oct 2002 20:48:38 -0000	1.16
  @@ -64,6 +64,7 @@
   import org.apache.commons.jelly.TagSupport;
   import org.apache.commons.jelly.XMLOutput;
   
  +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;
  @@ -97,9 +98,11 @@
           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;
           }
   
           _settings = 
  @@ -109,8 +112,12 @@
   
           reporter.suiteCompleted(new SuiteCompletedEvent());
   
  -        if (reporter.didSuiteSucceed() == false) {
  -            throw new LatkaException("SUITE FAILED");
  +        if (reporter.didSuiteSucceed() == false && defaultReporter == true) {
  +            Latka latka = new Latka();
  +            String transformedReport = 
  +                latka.transformXML(((XMLReporter) reporter).getDocumentAsString());
  +
  +            throw new LatkaException("SUITE FAILED: \n" + transformedReport);
           }
   
       }
  
  
  

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