View Javadoc

1   /*
2    * $Id: Dom4jPropertyExtractorMultipleEndpointsTestCase.java 20321 2010-11-24 15:21:24Z dfeist $
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  import org.dom4j.Element;
18  
19  public class Dom4jPropertyExtractorMultipleEndpointsTestCase extends AbstractXmlPropertyExtractorTestCase
20  {
21  
22      public Dom4jPropertyExtractorMultipleEndpointsTestCase()
23      {
24          super(false);
25      }
26  
27      protected Properties getStartUpProperties()
28      {
29          Properties p = new Properties();
30          p.setProperty("selector.expression", "/endpoints/endpoint");
31          p.setProperty("selector.evaluator", "xpath");
32  
33          return p;
34      }
35  
36      protected Object getMatchMessage()
37      {
38          Document document = DocumentHelper.createDocument();
39          Element e = document.addElement("endpoints");
40          e.addElement("endpoint").addText("matchingEndpoint1");
41          e.addElement("endpoint").addText("matchingEndpoint2");
42          return document;
43      }
44  
45      protected Object getErrorMessage()
46      {
47          Document document = DocumentHelper.createDocument();
48          document.addElement("endpoint").addText("missingEndpoint");
49          return document;
50      }
51  
52  }