KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > wcf > component > RendererTagTest


1 package com.tonbeller.wcf.component;
2
3 import java.net.URL JavaDoc;
4
5 import junit.framework.TestCase;
6
7 import org.jaxen.dom.DOMXPath;
8 import org.w3c.dom.Document JavaDoc;
9
10 import com.tonbeller.wcf.utils.XmlUtils;
11
12 public class RendererTagTest extends TestCase {
13
14   public RendererTagTest(String JavaDoc name) {
15     super(name);
16   }
17
18   public void testSetXmlParameters() throws Exception JavaDoc {
19     URL JavaDoc url = getClass().getResource("paramtest.xml");
20     Document JavaDoc doc = XmlUtils.parse(url);
21     RendererTag rt = new RendererTag();
22     rt.parameters.put("param1", "value1");
23     rt.setXmlParameters( doc);
24     DOMXPath dx = new DOMXPath("/xform/node[@attr1='value1']");
25     assertEquals("param not set", 1, dx.selectNodes(doc).size());
26     
27   }
28
29 }
30
Popular Tags