View Javadoc

1   /*
2    * $Id: Dom4jPropertyExtractorTestCase.java 22414 2011-07-14 13:24:46Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.module.xml.functional;
12  
13  import java.util.Properties;
14  
15  import org.dom4j.Document;
16  import org.dom4j.DocumentHelper;
17  
18  public class Dom4jPropertyExtractorTestCase extends AbstractXmlPropertyExtractorTestCase
19  {
20  
21      public Dom4jPropertyExtractorTestCase(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", "xpath");
32  
33          return p;
34      }
35  
36      @Override
37      protected Object getMatchMessage()
38      {
39          Document document = DocumentHelper.createDocument();
40          document.addElement("endpoint").addText("matchingEndpoint1");
41          return document;
42      }
43  
44      @Override
45      protected Object getErrorMessage()
46      {
47          Document document = DocumentHelper.createDocument();
48          document.addElement("endpoint").addText("missingEndpoint");
49          return document;
50      }
51  
52  }