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
13 public class JXPathExpressionTestCase extends AbstractXmlPropertyExtractorTestCase
14 {
15
16 public static final String MESSAGE = "<endpoint>{0}</endpoint>";
17
18 public JXPathExpressionTestCase()
19 {
20 super(true);
21 }
22
23 @Override
24 protected Properties getStartUpProperties()
25 {
26 Properties p = new Properties();
27 p.setProperty("selector.expression", "/endpoint");
28 p.setProperty("selector.evaluator", "jxpath");
29
30 return p;
31 }
32
33 @Override
34 protected Object getMatchMessage() throws Exception
35 {
36 return documentFor("matchingEndpoint1");
37 }
38
39 @Override
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 }