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