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 JXPathExpressionTestCase extends AbstractXmlPropertyExtractorTestCase
17 {
18
19 public static final String MESSAGE = "<endpoint>{0}</endpoint>";
20
21 public JXPathExpressionTestCase(ConfigVariant variant, String configResources)
22 {
23 super(variant, configResources, true);
24 }
25
26 @Override
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 @Override
37 protected Object getMatchMessage() throws Exception
38 {
39 return documentFor("matchingEndpoint1");
40 }
41
42 @Override
43 protected Object getErrorMessage() throws Exception
44 {
45 return documentFor("missingEndpoint");
46 }
47
48 protected String documentFor(String name) throws Exception
49 {
50 return MessageFormat.format(MESSAGE, name);
51 }
52
53 }