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/test/org/apache/cocoon/transformation FilterTransformerTestCase.java TraxTransformerTestCase.java
Date Mon, 02 Feb 2004 12:35:04 GMT
stephan     2004/02/02 04:35:04

  Modified:    src/blocks/chaperon/test/org/apache/cocoon/generation
                        TextGeneratorTestCase.java
               src/blocks/chaperon/test/org/apache/cocoon/transformation
                        LexicalTransformerTestCase.java
                        ParserTransformerTestCase.java
                        PatternTransformerTestCase.java
               src/blocks/xmlform/test/org/apache/cocoon/components/xmlform
                        XMLFormTestCase.java
               src/test/org/apache/cocoon SitemapComponentTestCase.java
               src/test/org/apache/cocoon/acting
                        RequestParamActionTestCase.java
                        ResourceExistsActionTestCase.java
               src/test/org/apache/cocoon/generation
                        FileGeneratorTestCase.java
               src/test/org/apache/cocoon/matching
                        WildcardURIMatcherTestCase.java
               src/test/org/apache/cocoon/transformation
                        FilterTransformerTestCase.java
                        TraxTransformerTestCase.java
  Log:
  Catch only the ComponentExceptions.
  
  Revision  Changes    Path
  1.4       +3 -3      cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/generation/TextGeneratorTestCase.java
  
  Index: TextGeneratorTestCase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/generation/TextGeneratorTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TextGeneratorTestCase.java	26 Nov 2003 16:27:22 -0000	1.3
  +++ TextGeneratorTestCase.java	2 Feb 2004 12:35:04 -0000	1.4
  @@ -70,7 +70,7 @@
           super(name);
       }
   
  -    public void testTextGenerator1() {
  +    public void testTextGenerator1() throws Exception {
           String src = "resource://org/apache/cocoon/generation/texttest-input1.txt";
           Parameters parameters = new Parameters();
           String result = "resource://org/apache/cocoon/generation/texttest-result1.xml";
  @@ -78,7 +78,7 @@
           assertEqual(load(result), generate("text", src, parameters));
       }
   
  -    public void testTextGenerator2() {
  +    public void testTextGenerator2() throws Exception {
   
           String src = "resource://org/apache/cocoon/generation/texttest-input2.txt";
           Parameters parameters = new Parameters();
  
  
  
  1.5       +3 -3      cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/LexicalTransformerTestCase.java
  
  Index: LexicalTransformerTestCase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/LexicalTransformerTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LexicalTransformerTestCase.java	26 Nov 2003 16:27:23 -0000	1.4
  +++ LexicalTransformerTestCase.java	2 Feb 2004 12:35:04 -0000	1.5
  @@ -68,7 +68,7 @@
           super(name);
       }
   
  -    public void testLexicalTransformer1() {
  +    public void testLexicalTransformer1() throws Exception {
           String src = "resource://org/apache/cocoon/transformation/lexertest-lexicon1.xml";
           Parameters parameters = new Parameters();
           String input = "resource://org/apache/cocoon/transformation/lexertest-input1.xml";
  @@ -77,7 +77,7 @@
           assertEqual(load(result), transform("lexer", src, parameters, load(input)));
       }
   
  -    public void testLexicalTransformer2() {
  +    public void testLexicalTransformer2() throws Exception {
   
           String src = "resource://org/apache/cocoon/transformation/lexertest-lexicon2.xml";
           Parameters parameters = new Parameters();
  
  
  
  1.5       +4 -4      cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/ParserTransformerTestCase.java
  
  Index: ParserTransformerTestCase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/ParserTransformerTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ParserTransformerTestCase.java	26 Nov 2003 16:27:23 -0000	1.4
  +++ ParserTransformerTestCase.java	2 Feb 2004 12:35:04 -0000	1.5
  @@ -68,7 +68,7 @@
           super(name);
       }
   
  -    public void testParserTransformer1() {
  +    public void testParserTransformer1() throws Exception {
   
           String src = "resource://org/apache/cocoon/transformation/parsertest-grammar1.xml";
           Parameters parameters = new Parameters();
  @@ -78,7 +78,7 @@
           assertEqual(load(result), transform("parser", src, parameters, load(input)));
       }
   
  -    public void testParserTransformer2() {
  +    public void testParserTransformer2() throws Exception {
   
           String src = "resource://org/apache/cocoon/transformation/parsertest-grammar1.xml";
           Parameters parameters = new Parameters();
  @@ -88,7 +88,7 @@
           assertEqual(load(result), transform("recovery-parser", src, parameters, load(input)));
       }
   
  -    /*public void testParserTransformer3() {
  +    /*public void testParserTransformer3() throws Exception {
           String src = "resource://org/apache/cocoon/transformation/parsertest-grammar1.xml";
           Parameters parameters = new Parameters();
           String input = "resource://org/apache/cocoon/transformation/parsertest-input3.xml";
  
  
  
  1.4       +2 -2      cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/PatternTransformerTestCase.java
  
  Index: PatternTransformerTestCase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/chaperon/test/org/apache/cocoon/transformation/PatternTransformerTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PatternTransformerTestCase.java	26 Nov 2003 16:27:23 -0000	1.3
  +++ PatternTransformerTestCase.java	2 Feb 2004 12:35:04 -0000	1.4
  @@ -68,7 +68,7 @@
           super(name);
       }
   
  -    public void testPatternTransformer() {
  +    public void testPatternTransformer() throws Exception {
   
           String src = "resource://org/apache/cocoon/transformation/patterntest-lexicon1.xml";
           Parameters parameters = new Parameters();
  
  
  
  1.3       +2 -2      cocoon-2.1/src/blocks/xmlform/test/org/apache/cocoon/components/xmlform/XMLFormTestCase.java
  
  Index: XMLFormTestCase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/xmlform/test/org/apache/cocoon/components/xmlform/XMLFormTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLFormTestCase.java	26 Apr 2003 12:09:44 -0000	1.2
  +++ XMLFormTestCase.java	2 Feb 2004 12:35:04 -0000	1.3
  @@ -69,7 +69,7 @@
           super(name);
       }
   
  -    public void testXMLForm() {
  +    public void testXMLForm() throws Exception {
   
           getRequest().addParameter("cocoon-action-start", "true");
   
  
  
  
  1.4       +13 -36    cocoon-2.1/src/test/org/apache/cocoon/SitemapComponentTestCase.java
  
  Index: SitemapComponentTestCase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/test/org/apache/cocoon/SitemapComponentTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SitemapComponentTestCase.java	2 Feb 2004 11:25:57 -0000	1.3
  +++ SitemapComponentTestCase.java	2 Feb 2004 12:35:04 -0000	1.4
  @@ -78,6 +78,7 @@
   import org.apache.cocoon.matching.Matcher;
   import org.apache.cocoon.transformation.Transformer;
   import org.apache.cocoon.serialization.Serializer;
  +import org.apache.cocoon.sitemap.PatternException;
   import org.apache.cocoon.xml.WhitespaceFilter;
   import org.apache.cocoon.xml.dom.DOMBuilder;
   import org.apache.cocoon.xml.dom.DOMStreamer;
  @@ -157,7 +158,7 @@
        * @param pattern Pattern for the matcher.
        * @param parameters Matcher parameters.
        */
  -    public final Map match(String type, String pattern, Parameters parameters) {
  +    public final Map match(String type, String pattern, Parameters parameters) throws PatternException
{
   
           ComponentSelector selector = null;
           Matcher matcher = null;
  @@ -179,11 +180,8 @@
               result = matcher.match(pattern, objectmodel, parameters);
   
           } catch (ComponentException ce) {
  -            getLogger().error("Could not retrieve generator", ce);
  -            fail("Could not retrieve generator: " + ce.toString());
  -        } catch (Exception e) {
  -            getLogger().error("Could not execute test", e);
  -            fail("Could not execute test: " + e);
  +            getLogger().error("Could not retrieve matcher", ce);
  +            fail("Could not retrieve matcher: " + ce.toString());
           } finally {
               if (matcher != null) {
                   selector.release(matcher);
  @@ -201,7 +199,7 @@
        * @param source Source for the action.
        * @param parameters Action parameters.
        */
  -    public final Map act(String type, String source, Parameters parameters) {
  +    public final Map act(String type, String source, Parameters parameters) throws Exception
{
   
           ComponentSelector selector = null;
           Action action = null;
  @@ -224,11 +222,8 @@
                                   objectmodel, source, parameters);
   
           } catch (ComponentException ce) {
  -            getLogger().error("Could not retrieve generator", ce);
  -            fail("Could not retrieve generator: " + ce.toString());
  -        } catch (Exception e) {
  -            getLogger().error("Could not execute test", e);
  -            fail("Could not execute test: " + e);
  +            getLogger().error("Could not retrieve action", ce);
  +            fail("Could not retrieve action: " + ce.toString());
           } finally {
               if (action != null) {
                   selector.release(action);
  @@ -246,7 +241,8 @@
        * @param source Source for the generator.
        * @param parameters Generator parameters.
        */
  -    public final Document generate(String type, String source, Parameters parameters) {
  +    public final Document generate(String type, String source, Parameters parameters) 
  +        throws IOException, SAXException, ProcessingException {
   
           ComponentSelector selector = null;
           Generator generator = null;
  @@ -285,9 +281,6 @@
           } catch (ComponentException ce) {
               getLogger().error("Could not retrieve generator", ce);
               fail("Could not retrieve generator: " + ce.toString());
  -        } catch (Exception e) {
  -            getLogger().error("Could not execute test", e);
  -            fail("Could not execute test: " + e);
           } finally {
               if (generator != null) {
                   selector.release(generator);
  @@ -308,7 +301,8 @@
        * @param parameters Generator parameters.
        * @param input Input document.
        */ 
  -    public final Document transform(String type, String source, Parameters parameters,
Document input) {
  +    public final Document transform(String type, String source, Parameters parameters,
Document input) 
  +        throws SAXException, ProcessingException, IOException {
   
           ComponentSelector selector = null;
           Transformer transformer = null;
  @@ -352,16 +346,6 @@
               getLogger().error("Could not retrieve transformer", ce);
               ce.printStackTrace();
               fail("Could not retrieve transformer:"+ce.toString());
  -        } catch (SAXException saxe) {
  -            getLogger().error("Could not execute test", saxe);
  -            fail("Could not execute test:"+saxe.toString());
  -        } catch (IOException ioe) {
  -            getLogger().error("Could not execute test", ioe);
  -            fail("Could not execute test:"+ioe.toString());
  -        } catch (ProcessingException pe) {
  -            getLogger().error("Could not execute test", pe);
  -            pe.printStackTrace();
  -            fail("Could not execute test:"+pe.toString());
           } finally {
               if (transformer!=null)
                   selector.release(transformer);
  @@ -392,7 +376,7 @@
        * @return Serialized data.
        */
       public final byte[] serialize(String type, Parameters parameters,
  -                                  Document input) {
  +                                  Document input) throws SAXException, IOException{
   
           ComponentSelector selector = null;
           Serializer serializer = null;
  @@ -424,14 +408,7 @@
               streamer.stream(input);
           } catch (ComponentException ce) {
               getLogger().error("Could not retrieve serializer", ce);
  -            ce.printStackTrace();
               fail("Could not retrieve serializer:"+ce.toString());
  -        } catch (SAXException saxe) {
  -            getLogger().error("Could not execute test", saxe);
  -            fail("Could not execute test:"+saxe.toString());
  -        } catch (IOException ioe) {
  -            getLogger().error("Could not execute test", ioe);
  -            fail("Could not execute test:"+ioe.toString());
           } finally {
               if (serializer!=null) {
                   selector.release(serializer);
  
  
  
  1.4       +2 -2      cocoon-2.1/src/test/org/apache/cocoon/acting/RequestParamActionTestCase.java
  
  Index: RequestParamActionTestCase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/test/org/apache/cocoon/acting/RequestParamActionTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RequestParamActionTestCase.java	26 Nov 2003 16:27:22 -0000	1.3
  +++ RequestParamActionTestCase.java	2 Feb 2004 12:35:04 -0000	1.4
  @@ -68,7 +68,7 @@
           super(name);
       }
   
  -    public void testRequestAction() {
  +    public void testRequestAction() throws Exception {
   
           getRequest().setRequestURI("test.xml?abc=def&ghi=jkl");
           getRequest().setQueryString("abc=def&ghi=jkl");
  
  
  
  1.3       +2 -2      cocoon-2.1/src/test/org/apache/cocoon/acting/ResourceExistsActionTestCase.java
  
  Index: ResourceExistsActionTestCase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/test/org/apache/cocoon/acting/ResourceExistsActionTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ResourceExistsActionTestCase.java	26 Nov 2003 16:27:22 -0000	1.2
  +++ ResourceExistsActionTestCase.java	2 Feb 2004 12:35:04 -0000	1.3
  @@ -68,7 +68,7 @@
           super(name);
       }
   
  -    public void testExistAction() {
  +    public void testExistAction() throws Exception {
   
           String src = "resource://org/apache/cocoon/acting/ResourceExistsActionTestCase.xtest";
           Parameters parameters = new Parameters();
  
  
  
  1.7       +2 -2      cocoon-2.1/src/test/org/apache/cocoon/generation/FileGeneratorTestCase.java
  
  Index: FileGeneratorTestCase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/test/org/apache/cocoon/generation/FileGeneratorTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FileGeneratorTestCase.java	26 Nov 2003 16:27:22 -0000	1.6
  +++ FileGeneratorTestCase.java	2 Feb 2004 12:35:04 -0000	1.7
  @@ -64,7 +64,7 @@
           super(name);
       }
   
  -    public void testFileGenerator() {
  +    public void testFileGenerator() throws Exception {
   
           System.out.println("testFileGenerator()");
   
  
  
  
  1.2       +1 -1      cocoon-2.1/src/test/org/apache/cocoon/matching/WildcardURIMatcherTestCase.java
  
  Index: WildcardURIMatcherTestCase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/test/org/apache/cocoon/matching/WildcardURIMatcherTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WildcardURIMatcherTestCase.java	2 Feb 2004 11:25:57 -0000	1.1
  +++ WildcardURIMatcherTestCase.java	2 Feb 2004 12:35:04 -0000	1.2
  @@ -11,7 +11,7 @@
           super(name);
       }
   
  -    public void testWildcardURIMatch() {
  +    public void testWildcardURIMatch() throws Exception {
           getRequest().setRequestURI("/test/foo/bla/end");
   
           Parameters parameters = new Parameters();
  
  
  
  1.2       +4 -4      cocoon-2.1/src/test/org/apache/cocoon/transformation/FilterTransformerTestCase.java
  
  Index: FilterTransformerTestCase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/test/org/apache/cocoon/transformation/FilterTransformerTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FilterTransformerTestCase.java	10 Dec 2003 18:52:39 -0000	1.1
  +++ FilterTransformerTestCase.java	2 Feb 2004 12:35:04 -0000	1.2
  @@ -90,7 +90,7 @@
       /**
        * Testcase for count=1, blocknr=1
        */
  -    public void testFilter_1_1() {
  +    public void testFilter_1_1() throws Exception {
           getLogger().debug("testFilter_1_1");
   
           Parameters parameters = new Parameters();
  @@ -108,7 +108,7 @@
       /**
        * Testcase for count=3, blocknr=1
        */
  -    public void testFilter_3_1() {
  +    public void testFilter_3_1() throws Exception {
           getLogger().debug("testFilter_3_1");
           
           Parameters parameters = new Parameters();
  @@ -126,7 +126,7 @@
       /**
        * Testcase for count=1, blocknr=3
        */
  -    public void testFilter_1_3() {
  +    public void testFilter_1_3() throws Exception {
           getLogger().debug("testFilter_1_3");
           
           Parameters parameters = new Parameters();
  
  
  
  1.5       +5 -5      cocoon-2.1/src/test/org/apache/cocoon/transformation/TraxTransformerTestCase.java
  
  Index: TraxTransformerTestCase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/test/org/apache/cocoon/transformation/TraxTransformerTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TraxTransformerTestCase.java	26 Nov 2003 16:27:22 -0000	1.4
  +++ TraxTransformerTestCase.java	2 Feb 2004 12:35:04 -0000	1.5
  @@ -68,7 +68,7 @@
           super(name);
       }
   
  -    public void testFunctionForXalan() {
  +    public void testFunctionForXalan() throws Exception {
   
           String src = "resource://org/apache/cocoon/transformation/traxtest-style.xsl";
           Parameters parameters = new Parameters();
  @@ -78,7 +78,7 @@
           assertEqual(load(result), transform("xalan", src, parameters, load(input)));
       }
   
  -    public void testStressForXalan() {
  +    public void testStressForXalan() throws Exception {
   
           String src = "resource://org/apache/cocoon/transformation/traxtest-style.xsl";
           Parameters parameters = new Parameters();
  @@ -93,7 +93,7 @@
        FIXME: test doesn't run within a gump build, see
               http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=105082989401703&w=2
   
  -    public void testFunctionForXSLTC() {
  +    public void testFunctionForXSLTC() throws Exception {
   
           String src = "resource://org/apache/cocoon/transformation/traxtest-style.xsl";
           Parameters parameters = new Parameters();
  @@ -103,7 +103,7 @@
           assertEqual(load(result), transform("xsltc", src, parameters, load(input)));
       }
   
  -    public void testStressForXSLTC() {
  +    public void testStressForXSLTC() throws Exception {
   
           String src = "resource://org/apache/cocoon/transformation/traxtest-style.xsl";
           Parameters parameters = new Parameters();
  
  
  

Mime
View raw message