1 package com.tonbeller.wcf.component; 2 3 import java.net.URL ; 4 5 import junit.framework.TestCase; 6 7 import org.jaxen.dom.DOMXPath; 8 import org.w3c.dom.Document ; 9 10 import com.tonbeller.wcf.utils.XmlUtils; 11 12 public class RendererTagTest extends TestCase { 13 14 public RendererTagTest(String name) { 15 super(name); 16 } 17 18 public void testSetXmlParameters() throws Exception { 19 URL url = getClass().getResource("paramtest.xml"); 20 Document 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 |