01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.cocoon.transformation;
19:
20: import org.apache.avalon.framework.parameters.Parameters;
21: import org.apache.cocoon.SitemapComponentTestCase;
22:
23: import org.w3c.dom.Document;
24:
25: /**
26: *
27: *
28: * @author <a href="mailto:stephan@apache.org">Stephan Michels </a>
29: * @version CVS $Id: TraxTransformerTestCase.java 433543 2006-08-22 06:22:54Z crossley $
30: */
31: public class TraxTransformerTestCase extends SitemapComponentTestCase {
32:
33: public void testFunctionForXalan() throws Exception {
34:
35: String src = "resource://org/apache/cocoon/transformation/traxtest-style.xsl";
36: Parameters parameters = new Parameters();
37: String input = "resource://org/apache/cocoon/transformation/traxtest-input.xml";
38: String result = "resource://org/apache/cocoon/transformation/traxtest-result.xml";
39:
40: assertEqual(load(result), transform("xalan", src, parameters,
41: load(input)));
42: }
43:
44: public void testStressForXalan() throws Exception {
45:
46: String src = "resource://org/apache/cocoon/transformation/traxtest-style.xsl";
47: Parameters parameters = new Parameters();
48: String input = "resource://org/apache/cocoon/transformation/traxtest-input.xml";
49: Document document = load(input);
50:
51: for (int i = 0; i < 100; i++)
52: transform("xalan", src, parameters, document);
53: }
54:
55: /*
56: FIXME: test doesn't run within a gump build, see
57: http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=105082989401703&w=2
58:
59: public void testFunctionForXSLTC() throws Exception {
60:
61: String src = "resource://org/apache/cocoon/transformation/traxtest-style.xsl";
62: Parameters parameters = new Parameters();
63: String input = "resource://org/apache/cocoon/transformation/traxtest-input.xml";
64: String result = "resource://org/apache/cocoon/transformation/traxtest-result.xml";
65:
66: assertEqual(load(result), transform("xsltc", src, parameters, load(input)));
67: }
68:
69: public void testStressForXSLTC() throws Exception {
70:
71: String src = "resource://org/apache/cocoon/transformation/traxtest-style.xsl";
72: Parameters parameters = new Parameters();
73: String input = "resource://org/apache/cocoon/transformation/traxtest-input.xml";
74: Document document = load(input);
75:
76: for(int i=0; i<100; i++)
77: transform("xsltc", src, parameters, document);
78: }*/
79: }
|