1
2
3
4
5
6
7
8
9
10
11 package org.mule.module.xml.functional;
12
13 import javax.xml.parsers.DocumentBuilder;
14 import javax.xml.parsers.DocumentBuilderFactory;
15 import javax.xml.parsers.ParserConfigurationException;
16
17 import org.w3c.dom.Document;
18 import org.w3c.dom.Element;
19
20 public class W3CDomPropertyExtractorStaticTestCase extends AbstractXmlPropertyExtractorTestCase
21 {
22
23 public W3CDomPropertyExtractorStaticTestCase()
24 {
25 super(true);
26 }
27
28 protected String getConfigResources()
29 {
30 return "org/mule/module/xml/property-extractor-static-test.xml";
31 }
32
33 protected Object getMatchMessage() throws ParserConfigurationException
34 {
35 return documentFor("matchingEndpoint1");
36 }
37
38 protected Object getErrorMessage() throws ParserConfigurationException
39 {
40 return documentFor("missingEndpoint");
41 }
42
43 protected Document documentFor(String name) throws ParserConfigurationException
44 {
45 DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
46 Document doc = builder.newDocument();
47 Element endpoint = doc.createElement("endpoint");
48 endpoint.appendChild(doc.createTextNode(name));
49 doc.appendChild(endpoint);
50 return doc;
51 }
52
53 }