1
2
3
4
5
6
7
8
9
10
11 package org.mule.module.xml.functional;
12
13 import java.text.MessageFormat;
14 import java.util.Properties;
15
16 public class JXPathExpressionWithNamespaceTestCase extends AbstractXmlPropertyExtractorTestCase
17 {
18
19 public static final String MESSAGE = "<foo:endpoint xmlns:foo=\"http://foo.com\">{0}</foo:endpoint>";
20
21 public JXPathExpressionWithNamespaceTestCase()
22 {
23 super(true);
24 }
25
26 protected Properties getStartUpProperties()
27 {
28 Properties p = new Properties();
29 p.setProperty("selector.expression", "/foo:endpoint");
30 p.setProperty("selector.evaluator", "jxpath");
31
32 return p;
33 }
34
35 protected Object getMatchMessage() throws Exception
36 {
37 return documentFor("matchingEndpoint1");
38 }
39
40 protected Object getErrorMessage() throws Exception
41 {
42 return documentFor("missingEndpoint");
43 }
44
45 protected String documentFor(String name) throws Exception
46 {
47 return MessageFormat.format(MESSAGE, name);
48 }
49
50 }