View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.module.xml.functional;
8   
9   import java.util.Properties;
10  
11  import org.dom4j.Document;
12  import org.dom4j.DocumentHelper;
13  
14  public class Dom4jPropertyExtractorTestCase extends AbstractXmlPropertyExtractorTestCase
15  {
16  
17      public Dom4jPropertyExtractorTestCase()
18      {
19          super(true);
20      }
21  
22      @Override
23      protected Properties getStartUpProperties()
24      {
25          Properties p = new Properties();
26          p.setProperty("selector.expression", "/endpoint");
27          p.setProperty("selector.evaluator", "xpath");
28  
29          return p;
30      }
31  
32      @Override
33      protected Object getMatchMessage()
34      {
35          Document document = DocumentHelper.createDocument();
36          document.addElement("endpoint").addText("matchingEndpoint1");
37          return document;
38      }
39  
40      @Override
41      protected Object getErrorMessage()
42      {
43          Document document = DocumentHelper.createDocument();
44          document.addElement("endpoint").addText("missingEndpoint");
45          return document;
46      }
47  
48  }