KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > transformation > TraxTransformerTestCase


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.cocoon.transformation;
18
19 import org.apache.avalon.framework.parameters.Parameters;
20 import org.apache.cocoon.SitemapComponentTestCase;
21
22 import org.w3c.dom.Document JavaDoc;
23
24 /**
25  *
26  *
27  * @author <a HREF="mailto:stephan@apache.org">Stephan Michels </a>
28  * @version CVS $Id: TraxTransformerTestCase.java 55454 2004-10-24 18:02:39Z cziegeler $
29  */

30 public class TraxTransformerTestCase extends SitemapComponentTestCase {
31
32     public void testFunctionForXalan() throws Exception JavaDoc {
33
34         String JavaDoc src = "resource://org/apache/cocoon/transformation/traxtest-style.xsl";
35         Parameters parameters = new Parameters();
36         String JavaDoc input = "resource://org/apache/cocoon/transformation/traxtest-input.xml";
37         String JavaDoc result = "resource://org/apache/cocoon/transformation/traxtest-result.xml";
38
39         assertEqual(load(result), transform("xalan", src, parameters, load(input)));
40     }
41
42     public void testStressForXalan() throws Exception JavaDoc {
43
44         String JavaDoc src = "resource://org/apache/cocoon/transformation/traxtest-style.xsl";
45         Parameters parameters = new Parameters();
46         String JavaDoc input = "resource://org/apache/cocoon/transformation/traxtest-input.xml";
47         Document JavaDoc document = load(input);
48
49         for(int i=0; i<100; i++)
50           transform("xalan", src, parameters, document);
51     }
52
53     /*
54      FIXME: test doesn't run within a gump build, see
55             http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=105082989401703&w=2
56
57     public void testFunctionForXSLTC() throws Exception {
58
59         String src = "resource://org/apache/cocoon/transformation/traxtest-style.xsl";
60         Parameters parameters = new Parameters();
61         String input = "resource://org/apache/cocoon/transformation/traxtest-input.xml";
62         String result = "resource://org/apache/cocoon/transformation/traxtest-result.xml";
63
64         assertEqual(load(result), transform("xsltc", src, parameters, load(input)));
65     }
66
67     public void testStressForXSLTC() throws Exception {
68
69         String src = "resource://org/apache/cocoon/transformation/traxtest-style.xsl";
70         Parameters parameters = new Parameters();
71         String input = "resource://org/apache/cocoon/transformation/traxtest-input.xml";
72         Document document = load(input);
73
74         for(int i=0; i<100; i++)
75           transform("xsltc", src, parameters, document);
76     }*/

77 }
78
Popular Tags