cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.2/tools/lib excalibur-testcase-1.0.jar excalibur-fortress-tools-1.0.jar
Date Fri, 05 Mar 2004 07:51:44 GMT
cziegeler    2004/03/04 23:51:44

  Modified:    src/test/org/apache/cocoon/serialization
                        AbstractSerializerTestCase.java
  Removed:     tools/lib excalibur-testcase-1.0.jar
                        excalibur-fortress-tools-1.0.jar
  Log:
  Updating test to fortress
  Remove obsolete libs
  
  Revision  Changes    Path
  1.2       +21 -26    cocoon-2.2/src/test/org/apache/cocoon/serialization/AbstractSerializerTestCase.java
  
  Index: AbstractSerializerTestCase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/test/org/apache/cocoon/serialization/AbstractSerializerTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractSerializerTestCase.java	11 Aug 2003 08:31:24 -0000	1.1
  +++ AbstractSerializerTestCase.java	5 Mar 2004 07:51:44 -0000	1.2
  @@ -56,11 +56,10 @@
   import java.util.HashMap;
   import java.util.Map;
   
  -import org.apache.avalon.excalibur.testcase.ExcaliburTestCase;
  -import org.apache.avalon.framework.component.Component;
  -import org.apache.avalon.framework.component.ComponentException;
  -import org.apache.avalon.framework.component.ComponentSelector;
  +import org.apache.avalon.fortress.testcase.FortressTestCase;
   import org.apache.avalon.framework.parameters.Parameters;
  +import org.apache.avalon.framework.service.ServiceException;
  +import org.apache.avalon.framework.service.ServiceSelector;
   import org.apache.cocoon.xml.WhitespaceFilter;
   import org.apache.cocoon.xml.dom.DOMBuilder;
   import org.apache.cocoon.xml.dom.DOMStreamer;
  @@ -78,7 +77,7 @@
    * @author <a href="mailto:mark.leicester@energyintellect.com">Mark Leicester</a>
    * @version CVS $Id$
    */
  -public abstract class AbstractSerializerTestCase extends ExcaliburTestCase {
  +public abstract class AbstractSerializerTestCase extends FortressTestCase {
       private HashMap objectmodel = new HashMap();
   
       /**
  @@ -111,21 +110,19 @@
       public final byte[] serialize(String type, Parameters parameters,
                                     Document input) {
   
  -        ComponentSelector selector = null;
  +        ServiceSelector selector = null;
           Serializer serializer = null;
           SourceResolver resolver = null;
           Source inputsource = null;
   
  -        assertNotNull("Test for component manager", this.manager);
  -
           ByteArrayOutputStream document = null;
   
           try {
  -            selector = (ComponentSelector) this.manager.lookup(Serializer.ROLE+
  +            selector = (ServiceSelector) lookup(Serializer.ROLE+
                   "Selector");
               assertNotNull("Test lookup of serializer selector", selector);
   
  -            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
  +            resolver = (SourceResolver) lookup(SourceResolver.ROLE);
               assertNotNull("Test lookup of source resolver", resolver);
   
               assertNotNull("Test if serializer name is not null", type);
  @@ -139,7 +136,7 @@
               DOMStreamer streamer = new DOMStreamer(serializer);
   
               streamer.stream(input);
  -        } catch (ComponentException ce) {
  +        } catch (ServiceException ce) {
               getLogger().error("Could not retrieve serializer", ce);
               ce.printStackTrace();
               fail("Could not retrieve serializer:"+ce.toString());
  @@ -155,7 +152,7 @@
               }
   
               if (selector!=null) {
  -                this.manager.release(selector);
  +                release(selector);
               }
   
               if (inputsource!=null) {
  @@ -163,7 +160,7 @@
               }
   
               if (resolver!=null) {
  -                this.manager.release(resolver);
  +                release(resolver);
               }
           }
   
  @@ -186,10 +183,10 @@
           Document assertiondocument = null;
   
           try {
  -            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
  +            resolver = (SourceResolver) lookup(SourceResolver.ROLE);
               assertNotNull("Test lookup of source resolver", resolver);
   
  -            parser = (SAXParser) this.manager.lookup(SAXParser.ROLE);
  +            parser = (SAXParser) lookup(SAXParser.ROLE);
               assertNotNull("Test lookup of parser", parser);
   
               assertNotNull("Test if assertion document is not null", source);
  @@ -208,7 +205,7 @@
               assertNotNull("Test if assertion document exists",
                             assertiondocument);
   
  -        } catch (ComponentException ce) {
  +        } catch (ServiceException ce) {
               getLogger().error("Could not retrieve generator", ce);
               fail("Could not retrieve generator: "+ce.toString());
           } catch (Exception e) {
  @@ -218,8 +215,8 @@
               if (resolver!=null) {
                   resolver.release(assertionsource);
               }
  -            this.manager.release(resolver);
  -            this.manager.release((Component) parser);
  +            release(resolver);
  +            release(parser);
           }
   
           return assertiondocument;
  @@ -238,15 +235,13 @@
           SAXParser parser = null;
           Source assertionsource = null;
   
  -        assertNotNull("Test for component manager", this.manager);
  -
           byte[] assertiondocument = null;
   
           try {
  -            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
  +            resolver = (SourceResolver) lookup(SourceResolver.ROLE);
               assertNotNull("Test lookup of source resolver", resolver);
   
  -            parser = (SAXParser) this.manager.lookup(SAXParser.ROLE);
  +            parser = (SAXParser) lookup(SAXParser.ROLE);
               assertNotNull("Test lookup of parser", parser);
   
               assertNotNull("Test if assertion document is not null", source);
  @@ -269,7 +264,7 @@
                   i++;
               }
   
  -        } catch (ComponentException ce) {
  +        } catch (ServiceException ce) {
               getLogger().error("Could not retrieve generator", ce);
               fail("Could not retrieve generator: "+ce.toString());
           } catch (Exception e) {
  @@ -279,8 +274,8 @@
               if (resolver!=null) {
                   resolver.release(assertionsource);
               }
  -            this.manager.release(resolver);
  -            this.manager.release((Component) parser);
  +            release(resolver);
  +            release(parser);
           }
   
           return assertiondocument;
  
  
  

Mime
View raw message