KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tools > ant > taskdefs > optional > XalanLiaisonTest


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

19
20 import org.apache.tools.ant.taskdefs.XSLTLiaison;
21
22 import java.io.File JavaDoc;
23
24 /**
25  * Xalan Liaison testcase
26  */

27 public class XalanLiaisonTest extends AbstractXSLTLiaisonTest {
28     public XalanLiaisonTest(String JavaDoc name){
29         super(name);
30     }
31
32     public void tearDown() {
33         File JavaDoc f = new File JavaDoc("xalan1-redirect-out.tmp");
34         if (f.exists()) {
35             f.delete();
36         }
37     }
38
39     protected XSLTLiaison createLiaison() throws Exception JavaDoc {
40         return new XalanLiaison();
41     }
42
43     public void testXalan1Redirect() throws Exception JavaDoc {
44         File JavaDoc xsl = getFile("/taskdefs/optional/xalan-redirect-in.xsl");
45         liaison.setStylesheet(xsl);
46         File JavaDoc out = new File JavaDoc("xalan1-redirect-out-dummy.tmp");
47         File JavaDoc in = getFile("/taskdefs/optional/xsltliaison-in.xsl");
48         try {
49             liaison.addParam("xalan-version", "1");
50             liaison.transform(in, out);
51         } finally {
52             out.delete();
53         }
54     }
55 }
56
57
Popular Tags