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
17 public class JXPathExpressionTestCase extends AbstractXmlPropertyExtractorTestCase
18 {
19
20 public static final String MESSAGE = "<endpoint>{0}</endpoint>";
21
22 public JXPathExpressionTestCase()
23 {
24 super(true);
25 }
26
27 protected Properties getStartUpProperties()
28 {
29 Properties p = new Properties();
30 p.setProperty("selector.expression", "/endpoint");
31 p.setProperty("selector.evaluator", "jxpath");
32
33 return p;
34 }
35
36 protected Object getMatchMessage() throws Exception
37 {
38 return documentFor("matchingEndpoint1");
39 }
40
41 protected Object getErrorMessage() throws Exception
42 {
43 return documentFor("missingEndpoint");
44 }
45
46 protected String documentFor(String name) throws Exception
47 {
48 return MessageFormat.format(MESSAGE, name);
49 }
50
51 }