cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From step...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation LexicalTransformerTestCase.java LexicalTransformerTestCase.xtest ParserTransformerTestCase.java ParserTransformerTestCase.xtest PatternTransformerTestCase.java PatternTransformerTestCase.xtest lexertest-input1.xml lexertest-input2.xml lexertest-lexicon1.xml lexertest-lexicon2.xml lexertest-result1.xml lexertest-result2.xml parsertest-grammar1.xml parsertest-input1.xml parsertest-input2.xml parsertest-input3.xml parsertest-result1.xml parsertest-result2.xml parsertest-result3.xml patterntest-input1.xml patterntest-lexicon1.xml patterntest-result1.xml
Date Wed, 09 Apr 2003 12:24:36 GMT
stephan     2003/04/09 05:24:36

  Added:       src/blocks/chaperon/test/org/apache/cocoon/generation
                        TextGeneratorTestCase.java
                        TextGeneratorTestCase.xtest texttest-input1.txt
                        texttest-input2.txt texttest-result1.xml
                        texttest-result2.xml
               src/blocks/chaperon/test/org/apache/cocoon/transformation
                        LexicalTransformerTestCase.java
                        LexicalTransformerTestCase.xtest
                        ParserTransformerTestCase.java
                        ParserTransformerTestCase.xtest
                        PatternTransformerTestCase.java
                        PatternTransformerTestCase.xtest
                        lexertest-input1.xml lexertest-input2.xml
                        lexertest-lexicon1.xml lexertest-lexicon2.xml
                        lexertest-result1.xml lexertest-result2.xml
                        parsertest-grammar1.xml parsertest-input1.xml
                        parsertest-input2.xml parsertest-input3.xml
                        parsertest-result1.xml parsertest-result2.xml
                        parsertest-result3.xml patterntest-input1.xml
                        patterntest-lexicon1.xml patterntest-result1.xml
  Log:
  Adding testcases for the chaperon components.
  
  Revision  Changes    Path
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/generation/TextGeneratorTestCase.java
  
  Index: TextGeneratorTestCase.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, 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  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" 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 name,  without prior written permission  of the
      Apache Software Foundation.
  
   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 (INCLU-
   DING, 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 and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.generation;
  
  import java.io.InputStream;
  import java.io.IOException;
  import java.util.HashMap;
  
  import org.apache.avalon.framework.parameters.Parameters;
  
  /**
   *
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels </a>
   * @version CVS $Id: TextGeneratorTestCase.java,v 1.1 2003/04/09 12:24:34 stephan Exp $
   */
  public class TextGeneratorTestCase extends AbstractGeneratorTestCase {
  
      public TextGeneratorTestCase(String name) {
          super(name);
  
          String generator = "text";
          HashMap objectmodel = new HashMap();
          String src = "resource://org/apache/cocoon/generation/texttest-input1.txt";
          Parameters parameters = new Parameters();
          String result = "resource://org/apache/cocoon/generation/texttest-result1.xml";
  
          addTestStep(generator, objectmodel, src, parameters, result, EQUAL);
  
          src = "resource://org/apache/cocoon/generation/texttest-input2.txt";
          result = "resource://org/apache/cocoon/generation/texttest-result2.xml";
  
          addTestStep(generator, objectmodel, src, parameters, result, EQUAL);
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/generation/TextGeneratorTestCase.xtest
  
  Index: TextGeneratorTestCase.xtest
  ===================================================================
  <?xml version="1.0" ?>
  <testcase>
   <annotation>
    Test Cases: TextGenerator
   </annotation>
  
   <logkit>
    <factories>
     <factory type="stream" class="org.apache.avalon.excalibur.logger.factory.StreamTargetFactory"/>
    </factories>
    <targets>
     <stream id="root">
      <stream>System.out</stream>
      <format type="extended">
       %7.7{priority} %5.5{time}   [%9.9{category}] (%{context}): %{message}\n%{throwable}
      </format>
     </stream>
    </targets>
    <categories>
     <category name="test" log-level="WARN">
      <log-target id-ref="root"/>
     </category>
    </categories>
   </logkit>
  
   <context/>
  
   <roles>
    <role name="org.apache.excalibur.xml.sax.SAXParser"
          shorthand="xml-parser"
          default-class="org.apache.excalibur.xml.impl.JaxpParser"/>
  
    <role name="org.apache.excalibur.source.SourceFactorySelector"
          shorthand="source-factories"
          default-class="org.apache.avalon.excalibur.component.ExcaliburComponentSelector"/>
  
    <role name="org.apache.excalibur.source.SourceResolver"
          shorthand="source-resolver"
          default-class="org.apache.excalibur.source.impl.SourceResolverImpl"/>
  
    <role name="org.apache.cocoon.generation.GeneratorSelector"
          shorthand="generators"
          default-class="org.apache.cocoon.sitemap.DefaultSitemapComponentSelector"/>
   </roles>
  
   <components>
    <xml-parser class="org.apache.excalibur.xml.impl.JaxpParser">
     <parameter name="validate" value="false"/>
     <parameter name="namespace-prefixes" value="false"/>
     <parameter name="stop-on-warning" value="true"/>
     <parameter name="stop-on-recoverable-error" value="true"/>
     <parameter name="reuse-parsers" value="false"/>
    </xml-parser>
  
    <source-factories>
     <component-instance class="org.apache.excalibur.source.impl.ResourceSourceFactory"
name="resource"/>
     <component-instance class="org.apache.excalibur.source.impl.URLSourceFactory" name="*"/>
    </source-factories>
  
    <source-resolver class="org.apache.excalibur.source.impl.SourceResolverImpl"/>
  
    <generators>
     <component-instance class="org.apache.cocoon.generation.TextGenerator" name="text"/>
    </generators>
   </components>
  
  </testcase>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/generation/texttest-input1.txt
  
  Index: texttest-input1.txt
  ===================================================================
  1.Row Text is a text is a text.
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/generation/texttest-input2.txt
  
  Index: texttest-input2.txt
  ===================================================================
  1.Row Text is a text is a text.
  2.Row Test is a test is a test.
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/generation/texttest-result1.xml
  
  Index: texttest-result1.xml
  ===================================================================
  <?xml version="1.0"?>
  <text xmlns="http://chaperon.sourceforge.net/schema/text/1.0">1.Row Text is a text
is a text.</text>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/generation/texttest-result2.xml
  
  Index: texttest-result2.xml
  ===================================================================
  <?xml version="1.0"?>
  <text xmlns="http://chaperon.sourceforge.net/schema/text/1.0">1.Row Text is a text
is a text.
  2.Row Test is a test is a test.</text>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/LexicalTransformerTestCase.java
  
  Index: LexicalTransformerTestCase.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, 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  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" 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 name,  without prior written permission  of the
      Apache Software Foundation.
  
   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 (INCLU-
   DING, 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 and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.transformation;
  
  import java.util.HashMap;
  
  import org.apache.avalon.framework.parameters.Parameters;
  
  /**
   *
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels </a>
   * @version CVS $Id: LexicalTransformerTestCase.java,v 1.1 2003/04/09 12:24:35 stephan Exp
$
   */
  public class LexicalTransformerTestCase extends AbstractTransformerTestCase {
  
      public LexicalTransformerTestCase(String name) {
          super(name);
  
          String transformer = "lexer";
          HashMap objectmodel = new HashMap();
          String src = "resource://org/apache/cocoon/transformation/lexertest-lexicon1.xml";
          Parameters parameters = new Parameters();
          String input = "resource://org/apache/cocoon/transformation/lexertest-input1.xml";
          String result = "resource://org/apache/cocoon/transformation/lexertest-result1.xml";
  
          addTestStep(transformer, objectmodel, src, parameters, input, result,
                      EQUAL);
  
          src = "resource://org/apache/cocoon/transformation/lexertest-lexicon2.xml";
          input = "resource://org/apache/cocoon/transformation/lexertest-input2.xml";
          result = "resource://org/apache/cocoon/transformation/lexertest-result2.xml";
  
          addTestStep(transformer, objectmodel, src, parameters, input, result,
                      EQUAL);
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/LexicalTransformerTestCase.xtest
  
  Index: LexicalTransformerTestCase.xtest
  ===================================================================
  <?xml version="1.0" ?>
  <testcase>
   <annotation>
    Test Cases: LexicalTransformer
   </annotation>
  
   <logkit>
    <factories>
     <factory type="stream" class="org.apache.avalon.excalibur.logger.factory.StreamTargetFactory"/>
    </factories>
    <targets>
     <stream id="root">
      <stream>System.out</stream>
      <format type="extended">
       %7.7{priority} %5.5{time}   [%9.9{category}] (%{context}): %{message}\n%{throwable}
      </format>
     </stream>
    </targets>
    <categories>
     <category name="test" log-level="WARN">
      <log-target id-ref="root"/>
     </category>
    </categories>
   </logkit>
  
   <context/>
  
   <roles>
    <role name="org.apache.excalibur.xml.sax.SAXParser"
          shorthand="xml-parser"
          default-class="org.apache.excalibur.xml.impl.JaxpParser"/>
  
    <role name="org.apache.excalibur.xmlizer.XMLizer"
          shorthand="xmlizer"
          default-class="org.apache.excalibur.xmlizer.DefaultXMLizer"/>
  
    <role name="org.apache.excalibur.source.SourceFactorySelector"
          shorthand="source-factories"
          default-class="org.apache.avalon.excalibur.component.ExcaliburComponentSelector"/>
  
    <role name="org.apache.excalibur.source.SourceResolver"
          shorthand="source-resolver"
          default-class="org.apache.excalibur.source.impl.SourceResolverImpl"/>
  
    <role name="org.apache.cocoon.transformation.TransformerSelector"
          shorthand="transformers"
          default-class="org.apache.cocoon.sitemap.DefaultSitemapComponentSelector"/>
  
    <role name="org.apache.excalibur.store.Store/TransientStore"
          shorthand="transient-store"
          default-class="org.apache.excalibur.store.impl.MemoryStore"/>
  
    <role name="org.apache.excalibur.store.Store"
         shorthand="persistent-store"
         default-class="org.apache.excalibur.store.impl.MemoryStore"/>
   </roles>
  
   <components>
    <xml-parser class="org.apache.excalibur.xml.impl.JaxpParser">
     <parameter name="validate" value="false"/>
     <parameter name="namespace-prefixes" value="false"/>
     <parameter name="stop-on-warning" value="true"/>
     <parameter name="stop-on-recoverable-error" value="true"/>
     <parameter name="reuse-parsers" value="false"/>
    </xml-parser>
  
    <xmlizer/>
  
    <transient-store/>
  
    <persistent-store/>
  
    <source-factories>
     <component-instance class="org.apache.excalibur.source.impl.ResourceSourceFactory"
name="resource"/>
     <component-instance class="org.apache.excalibur.source.impl.URLSourceFactory" name="*"/>
    </source-factories>
  
    <source-resolver class="org.apache.excalibur.source.impl.SourceResolverImpl"/>
  
    <transformers>
     <component-instance class="org.apache.cocoon.transformation.LexicalTransformer" name="lexer"/>
    </transformers>
   </components>
  
  </testcase>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/ParserTransformerTestCase.java
  
  Index: ParserTransformerTestCase.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, 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  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" 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 name,  without prior written permission  of the
      Apache Software Foundation.
  
   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 (INCLU-
   DING, 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 and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.transformation;
  
  import java.util.HashMap;
  
  import org.apache.avalon.framework.parameters.Parameters;
  
  /**
   *
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels </a>
   * @version CVS $Id: ParserTransformerTestCase.java,v 1.1 2003/04/09 12:24:35 stephan Exp
$
   */
  public class ParserTransformerTestCase extends AbstractTransformerTestCase {
  
      public ParserTransformerTestCase(String name) {
          super(name);
  
          String transformer = "parser";
          HashMap objectmodel = new HashMap();
          String src = "resource://org/apache/cocoon/transformation/parsertest-grammar1.xml";
          Parameters parameters = new Parameters();
          String input = "resource://org/apache/cocoon/transformation/parsertest-input1.xml";
          String result = "resource://org/apache/cocoon/transformation/parsertest-result1.xml";
  
          addTestStep(transformer, objectmodel, src, parameters, input, result,
                      EQUAL);
  
          transformer = "recovery-parser";
          src = "resource://org/apache/cocoon/transformation/parsertest-grammar1.xml";
          input = "resource://org/apache/cocoon/transformation/parsertest-input2.xml";
          result = "resource://org/apache/cocoon/transformation/parsertest-result2.xml";
  
          addTestStep(transformer, objectmodel, src, parameters, input, result,
                      EQUAL);
  
          src = "resource://org/apache/cocoon/transformation/parsertest-grammar1.xml";
          input = "resource://org/apache/cocoon/transformation/parsertest-input3.xml";
          result = "resource://org/apache/cocoon/transformation/parsertest-result3.xml";
  
          // addTestStep(transformer, objectmodel, src, parameters, input, result, EQUAL);
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/ParserTransformerTestCase.xtest
  
  Index: ParserTransformerTestCase.xtest
  ===================================================================
  <?xml version="1.0" ?>
  <testcase>
   <annotation>
    Test Cases: ParserTransformer
   </annotation>
  
   <logkit>
    <factories>
     <factory type="stream" class="org.apache.avalon.excalibur.logger.factory.StreamTargetFactory"/>
    </factories>
    <targets>
     <stream id="root">
      <stream>System.out</stream>
      <format type="extended">
       %7.7{priority} %5.5{time}   [%9.9{category}] (%{context}): %{message}\n%{throwable}
      </format>
     </stream>
    </targets>
    <categories>
     <category name="test" log-level="WARN">
      <log-target id-ref="root"/>
     </category>
    </categories>
   </logkit>
  
   <context/>
  
   <roles>
    <role name="org.apache.excalibur.xml.sax.SAXParser"
          shorthand="xml-parser"
          default-class="org.apache.excalibur.xml.impl.JaxpParser"/>
  
    <role name="org.apache.excalibur.xmlizer.XMLizer"
          shorthand="xmlizer"
          default-class="org.apache.excalibur.xmlizer.DefaultXMLizer"/>
  
    <role name="org.apache.excalibur.source.SourceFactorySelector"
          shorthand="source-factories"
          default-class="org.apache.avalon.excalibur.component.ExcaliburComponentSelector"/>
  
    <role name="org.apache.excalibur.source.SourceResolver"
          shorthand="source-resolver"
          default-class="org.apache.excalibur.source.impl.SourceResolverImpl"/>
  
    <role name="org.apache.cocoon.transformation.TransformerSelector"
          shorthand="transformers"
          default-class="org.apache.cocoon.sitemap.DefaultSitemapComponentSelector"/>
  
    <role name="org.apache.excalibur.store.Store/TransientStore"
          shorthand="transient-store"
          default-class="org.apache.excalibur.store.impl.MemoryStore"/>
  
    <role name="org.apache.excalibur.store.Store"
         shorthand="persistent-store"
         default-class="org.apache.excalibur.store.impl.MemoryStore"/>
   </roles>
  
   <components>
    <xml-parser class="org.apache.excalibur.xml.impl.JaxpParser">
     <parameter name="validate" value="false"/>
     <parameter name="namespace-prefixes" value="false"/>
     <parameter name="stop-on-warning" value="true"/>
     <parameter name="stop-on-recoverable-error" value="true"/>
     <parameter name="reuse-parsers" value="false"/>
    </xml-parser>
  
    <xmlizer/>
  
    <transient-store/>
  
    <persistent-store/>
  
    <source-factories>
     <component-instance class="org.apache.excalibur.source.impl.ResourceSourceFactory"
name="resource"/>
     <component-instance class="org.apache.excalibur.source.impl.URLSourceFactory" name="*"/>
    </source-factories>
  
    <source-resolver class="org.apache.excalibur.source.impl.SourceResolverImpl"/>
  
    <transformers logger="test">
     <component-instance class="org.apache.cocoon.transformation.ParserTransformer" 
                         name="parser"/>
     <component-instance class="org.apache.cocoon.transformation.ParserTransformer" 
                         name="recovery-parser">
      <parameter name="recovery" value="true"/>
     </component-instance>
    </transformers>
   </components>
  
  </testcase>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/PatternTransformerTestCase.java
  
  Index: PatternTransformerTestCase.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, 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  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" 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 name,  without prior written permission  of the
      Apache Software Foundation.
  
   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 (INCLU-
   DING, 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 and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  
  package org.apache.cocoon.transformation;
  
  import java.util.HashMap;
  
  import org.apache.avalon.framework.parameters.Parameters;
  
  /**
   *
   *
   * @author <a href="mailto:stephan@apache.org">Stephan Michels </a>
   * @version CVS $Id: PatternTransformerTestCase.java,v 1.1 2003/04/09 12:24:35 stephan Exp
$
   */
  public class PatternTransformerTestCase extends AbstractTransformerTestCase {
  
      public PatternTransformerTestCase(String name) {
          super(name);
  
          String transformer = "pattern";
          HashMap objectmodel = new HashMap();
          String src = "resource://org/apache/cocoon/transformation/patterntest-lexicon1.xml";
          Parameters parameters = new Parameters();
          String input = "resource://org/apache/cocoon/transformation/patterntest-input1.xml";
          String result = "resource://org/apache/cocoon/transformation/patterntest-result1.xml";
  
          addTestStep(transformer, objectmodel, src, parameters, input, result,
                      EQUAL);
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/PatternTransformerTestCase.xtest
  
  Index: PatternTransformerTestCase.xtest
  ===================================================================
  <?xml version="1.0" ?>
  <testcase>
   <annotation>
    Test Cases: PatternTransformer
   </annotation>
  
   <logkit>
    <factories>
     <factory type="stream" class="org.apache.avalon.excalibur.logger.factory.StreamTargetFactory"/>
    </factories>
    <targets>
     <stream id="root">
      <stream>System.out</stream>
      <format type="extended">
       %7.7{priority} %5.5{time}   [%9.9{category}] (%{context}): %{message}\n%{throwable}
      </format>
     </stream>
    </targets>
    <categories>
     <category name="test" log-level="WARN">
      <log-target id-ref="root"/>
     </category>
    </categories>
   </logkit>
  
   <context/>
  
   <roles>
    <role name="org.apache.excalibur.xml.sax.SAXParser"
          shorthand="xml-parser"
          default-class="org.apache.excalibur.xml.impl.JaxpParser"/>
  
    <role name="org.apache.excalibur.xmlizer.XMLizer"
          shorthand="xmlizer"
          default-class="org.apache.excalibur.xmlizer.DefaultXMLizer"/>
  
    <role name="org.apache.excalibur.source.SourceFactorySelector"
          shorthand="source-factories"
          default-class="org.apache.avalon.excalibur.component.ExcaliburComponentSelector"/>
  
    <role name="org.apache.excalibur.source.SourceResolver"
          shorthand="source-resolver"
          default-class="org.apache.excalibur.source.impl.SourceResolverImpl"/>
  
    <role name="org.apache.cocoon.transformation.TransformerSelector"
          shorthand="transformers"
          default-class="org.apache.cocoon.sitemap.DefaultSitemapComponentSelector"/>
  
    <role name="org.apache.excalibur.store.Store/TransientStore"
          shorthand="transient-store"
          default-class="org.apache.excalibur.store.impl.MemoryStore"/>
  
    <role name="org.apache.excalibur.store.Store"
         shorthand="persistent-store"
         default-class="org.apache.excalibur.store.impl.MemoryStore"/>
   </roles>
  
   <components>
    <xml-parser class="org.apache.excalibur.xml.impl.JaxpParser">
     <parameter name="validate" value="false"/>
     <parameter name="namespace-prefixes" value="false"/>
     <parameter name="stop-on-warning" value="true"/>
     <parameter name="stop-on-recoverable-error" value="true"/>
     <parameter name="reuse-parsers" value="false"/>
    </xml-parser>
  
    <xmlizer/>
  
    <transient-store/>
  
    <persistent-store/>
  
    <source-factories>
     <component-instance class="org.apache.excalibur.source.impl.ResourceSourceFactory"
name="resource"/>
     <component-instance class="org.apache.excalibur.source.impl.URLSourceFactory" name="*"/>
    </source-factories>
  
    <source-resolver class="org.apache.excalibur.source.impl.SourceResolverImpl"/>
  
    <transformers>
     <component-instance class="org.apache.cocoon.transformation.PatternTransformer" name="pattern"/>
    </transformers>
   </components>
  
  </testcase>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/lexertest-input1.xml
  
  Index: lexertest-input1.xml
  ===================================================================
  <?xml version="1.0"?>
  <text xmlns="http://chaperon.sourceforge.net/schema/text/1.0">
   1+ 5*67 / (7 -2) *
   pH +5
  </text>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/lexertest-input2.xml
  
  Index: lexertest-input2.xml
  ===================================================================
  <?xml version="1.0"?>
  <text xmlns="http://chaperon.sourceforge.net/schema/text/1.0">35.5 667.344 23.23 98.
 .1 88.88</text>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/lexertest-lexicon1.xml
  
  Index: lexertest-lexicon1.xml
  ===================================================================
  <?xml version="1.0"?>
  <lexicon>
   <lexeme symbol="id">
    <cclass minOccurs="1" maxOccurs="*">
     <cinterval min="A" max="Z"/>
     <cinterval min="a" max="z"/>
    </cclass>
   </lexeme>
  
   <lexeme symbol="number">
    <cclass minOccurs="1" maxOccurs="*">
     <cinterval min="0" max="9"/>
    </cclass>
   </lexeme>
  
   <lexeme symbol="mult">
    <cstring content="*"/>
   </lexeme>
  
   <lexeme symbol="div">
    <cstring content="/"/>
   </lexeme>
  
   <lexeme symbol="plus">
    <cstring content="+"/>
   </lexeme>
     
   <lexeme symbol="minus">
    <cstring content="-"/>
   </lexeme>
  
   <lexeme symbol="pleft">
    <cstring content="("/>
   </lexeme>
  
   <lexeme symbol="pright">
    <cstring content=")"/>
   </lexeme>
  
   <lexeme>
    <cclass minOccurs="1" maxOccurs="*">
     <cset content="&#13;&#10;&#9; "/>
    </cclass>
   </lexeme>
  
  </lexicon>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/lexertest-lexicon2.xml
  
  Index: lexertest-lexicon2.xml
  ===================================================================
  <?xml version="1.0"?>
  <lexicon>
   <lexeme symbol="num">
    <alt>
     <concat>
      <cclass minOccurs="1" maxOccurs="*"><cinterval min="0" max="9"/></cclass>
      <cstring content="."/>
      <cclass minOccurs="0" maxOccurs="*"><cinterval min="0" max="9"/></cclass>
     </concat>
     <concat>
      <cclass minOccurs="0" maxOccurs="*"><cinterval min="0" max="9"/></cclass>
      <cstring content="."/>
      <cclass minOccurs="1" maxOccurs="*"><cinterval min="0" max="9"/></cclass>
     </concat>
    </alt>
   </lexeme>
  
   <lexeme><cstring content=" " minOccurs="1" maxOccurs="*"/></lexeme>
  </lexicon>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/lexertest-result1.xml
  
  Index: lexertest-result1.xml
  ===================================================================
  <?xml version="1.0"?>
  <lexemes xmlns="http://chaperon.sourceforge.net/schema/lexemes/1.0">
   <lexeme symbol="number" text="1"/>
   <lexeme symbol="plus" text="+"/>
   <lexeme symbol="number" text="5"/>
   <lexeme symbol="mult" text="*"/>
   <lexeme symbol="number" text="67"/>
   <lexeme symbol="div" text="/"/>
   <lexeme symbol="pleft" text="("/>
   <lexeme symbol="number" text="7"/>
   <lexeme symbol="minus" text="-"/>
   <lexeme symbol="number" text="2"/>
   <lexeme symbol="pright" text=")"/>
   <lexeme symbol="mult" text="*"/>
   <lexeme symbol="id" text="pH"/>
   <lexeme symbol="plus" text="+"/>
   <lexeme symbol="number" text="5"/>
  </lexemes>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/lexertest-result2.xml
  
  Index: lexertest-result2.xml
  ===================================================================
  <?xml version="1.0"?>
  <lexemes xmlns="http://chaperon.sourceforge.net/schema/lexemes/1.0">
   <lexeme symbol="num" text="35.5"/>
   <lexeme symbol="num" text="667.344"/>
   <lexeme symbol="num" text="23.23"/>
   <lexeme symbol="num" text="98."/>
   <lexeme symbol="num" text=".1"/>
   <lexeme symbol="num" text="88.88"/>
  </lexemes>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/parsertest-grammar1.xml
  
  Index: parsertest-grammar1.xml
  ===================================================================
  <?xml version="1.0"?>
  <grammar>
   <priority>
    <terminal symbol="mult"/>
    <terminal symbol="div"/>
    <terminal symbol="plus"/>
    <terminal symbol="minus"/>
   </priority>
  
   <associativity symbol="mult"  type="right"/>
   <associativity symbol="div"   type="right"/>
   <associativity symbol="plus"  type="right"/>
   <associativity symbol="minus" type="right"/>
  
  
   <production symbol="exp">
    <nonterminal symbol="exp"/><terminal symbol="plus"/><nonterminal symbol="exp"/>
   </production>
  
   <production symbol="exp">
    <nonterminal symbol="exp"/><terminal symbol="minus"/><nonterminal symbol="exp"/>
   </production>
  
   <production symbol="exp">
    <nonterminal symbol="exp"/><terminal symbol="mult"/><nonterminal symbol="exp"/>
   </production>
  
   <production symbol="exp">
    <nonterminal symbol="exp"/><terminal symbol="div"/><nonterminal symbol="exp"/>
   </production>
  
   <production symbol="exp">
    <terminal symbol="pleft"/><nonterminal symbol="exp"/><terminal symbol="pright"/>
   </production>
  
   <production symbol="exp">
    <terminal symbol="id"/>
   </production>
  
   <production symbol="exp">
    <terminal symbol="number"/>
   </production>
  
   <start symbol="exp"/>
  </grammar>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/parsertest-input1.xml
  
  Index: parsertest-input1.xml
  ===================================================================
  <?xml version="1.0"?>
  <lexemes xmlns="http://chaperon.sourceforge.net/schema/lexemes/1.0">
   <lexeme symbol="number" text="1"/>
   <lexeme symbol="plus" text="+"/>
   <lexeme symbol="number" text="5"/>
   <lexeme symbol="mult" text="*"/>
   <lexeme symbol="number" text="67"/>
   <lexeme symbol="div" text="/"/>
   <lexeme symbol="pleft" text="("/>
   <lexeme symbol="number" text="7"/>
   <lexeme symbol="minus" text="-"/>
   <lexeme symbol="number" text="2"/>
   <lexeme symbol="pright" text=")"/>
   <lexeme symbol="mult" text="*"/>
   <lexeme symbol="id" text="pH"/>
   <lexeme symbol="plus" text="+"/>
   <lexeme symbol="number" text="5"/>
  </lexemes>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/parsertest-input2.xml
  
  Index: parsertest-input2.xml
  ===================================================================
  <?xml version="1.0"?>
  <lexemes xmlns="http://chaperon.sourceforge.net/schema/lexemes/1.0">
   <lexeme symbol="number" text="1"/>
   <lexeme symbol="plus" text="+"/>
   <lexeme symbol="minus" text="-"/>
   <lexeme symbol="number" text="5"/>
  </lexemes>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/parsertest-input3.xml
  
  Index: parsertest-input3.xml
  ===================================================================
  <?xml version="1.0"?>
  <lexemes xmlns="http://chaperon.sourceforge.net/schema/lexemes/1.0">
   <lexeme symbol="number" text="1"/>
   <lexeme symbol="plus" text="+"/>
   <lexeme symbol="number" text="5"/>
   <lexeme symbol="minus" text="-"/>
  </lexemes>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/parsertest-result1.xml
  
  Index: parsertest-result1.xml
  ===================================================================
  <?xml version="1.0"?>
  <exp xmlns="http://chaperon.sourceforge.net/schema/syntaxtree/1.0">
   <exp>
    <number>1</number>
   </exp>
   <plus>+</plus>
   <exp>
    <exp>
     <exp>
      <exp>
       <number>5</number>
      </exp>
      <mult>*</mult>
      <exp>
       <number>67</number>
      </exp>
     </exp>
     <div>/</div>
     <exp>
      <exp>
       <pleft>(</pleft>
       <exp>
        <exp>
         <number>7</number>
        </exp>
        <minus>-</minus>
        <exp>
         <number>2</number>
        </exp>
       </exp>
       <pright>)</pright>
      </exp>
      <mult>*</mult>
      <exp>
       <id>pH</id>
      </exp>
     </exp>
    </exp>
    <plus>+</plus>
    <exp>
     <number>5</number>
    </exp>
   </exp>
  </exp>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/parsertest-result2.xml
  
  Index: parsertest-result2.xml
  ===================================================================
  <?xml version="1.0"?>
  <exp xmlns="http://chaperon.sourceforge.net/schema/syntaxtree/1.0">
   <exp><number>1</number></exp>
   <plus>+</plus>
   <exp><number>5</number></exp>
  </exp>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/parsertest-result3.xml
  
  Index: parsertest-result3.xml
  ===================================================================
  <?xml version="1.0"?>
  <exp xmlns="http://chaperon.sourceforge.net/schema/syntaxtree/1.0">
   <exp><number>1</number></exp>
   <plus>+</plus>
   <exp><number>5</number></exp>
  </exp>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/patterntest-input1.xml
  
  Index: patterntest-input1.xml
  ===================================================================
  <section>
   The Chaperon parser is not a part of the Apache project,
   but parts can be used in the Apache <strong>Cocoon</strong>
   project.
  </section>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/patterntest-lexicon1.xml
  
  Index: patterntest-lexicon1.xml
  ===================================================================
  <?xml version="1.0"?>
  <lexicon>
   <lexeme symbol="cocoon">
    <alt>
     <cstring content="Apache Cocoon"/>
     <cstring content="Cocoon"/>
    </alt>
   </lexeme>
  
   <lexeme symbol="apache">
    <cstring content="Apache"/>
   </lexeme>
  
   <lexeme symbol="chaperon">
    <cstring content="Chaperon"/>
   </lexeme>
  </lexicon>
  
  
  
  1.1                  cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/patterntest-result1.xml
  
  Index: patterntest-result1.xml
  ===================================================================
  <section xmlns:lex="http://chaperon.sourceforge.net/schema/lexemes/1.0">
   The <lex:lexeme symbol="chaperon" text="Chaperon"/> parser is not a part of the <lex:lexeme
symbol="apache" text="Apache"/> project,
   but parts can be used in the <lex:lexeme symbol="apache" text="Apache"/> <strong><lex:lexeme
symbol="cocoon" text="Cocoon"/></strong>
   project.
  </section>
  
  
  

Mime
View raw message