Tabnine Logo
HasXPath
Code IndexAdd Tabnine to your IDE (free)

How to use
HasXPath
in
org.hamcrest.xml

Best Java code snippets using org.hamcrest.xml.HasXPath (Showing top 20 results out of 315)

origin: org.hamcrest/hamcrest-all

/**
 * Creates a matcher of {@link org.w3c.dom.Node}s that matches when the examined node contains a node
 * at the specified <code>xPath</code>, with any content.
 * <p/>
 * For example:
 * <pre>assertThat(xml, hasXPath("/root/something[2]/cheese"))</pre>
 * 
 * @param xPath
 *     the target xpath
 */
public static org.hamcrest.Matcher<org.w3c.dom.Node> hasXPath(java.lang.String xPath) {
 return org.hamcrest.xml.HasXPath.hasXPath(xPath);
}
origin: hamcrest/JavaHamcrest

  /**
   * Creates a matcher of {@link org.w3c.dom.Node}s that matches when the examined node contains a node
   * at the specified <code>xPath</code> within the specified namespace context, with any content.
   * For example:
   * <pre>assertThat(xml, hasXPath("/root/something[2]/cheese", myNs))</pre>
   * 
   * @param xPath
   *     the target xpath
   * @param namespaceContext
   *     the namespace for matching nodes
   */
  public static Matcher<Node> hasXPath(String xPath, NamespaceContext namespaceContext) {
    return new HasXPath(xPath, namespaceContext, WITH_ANY_CONTENT, XPathConstants.NODE);
  }
}
origin: org.hamcrest/hamcrest-all

private HasXPath(String xPathExpression, NamespaceContext namespaceContext, Matcher<String> valueMatcher, QName mode) {
  this.compiledXPath = compiledXPath(xPathExpression, namespaceContext);
  this.xpathString = xPathExpression;
  this.valueMatcher = valueMatcher;
  this.evaluationMode = mode;
}
origin: org.hamcrest/hamcrest-all

@Override
public boolean matchesSafely(Node item, Description mismatch) {
  return evaluated(item, mismatch)
      .and(NODE_EXISTS)
      .matching(valueMatcher);
}
origin: hamcrest/JavaHamcrest

@Override
public boolean matchesSafely(Node item, Description mismatch) {
  return evaluated(item, mismatch)
      .and(NODE_EXISTS)
      .matching(valueMatcher);
}
origin: org.hamcrest/hamcrest-all

/**
 * Creates a matcher of {@link org.w3c.dom.Node}s that matches when the examined node contains a node
 * at the specified <code>xPath</code> within the specified namespace context, with any content.
 * <p/>
 * For example:
 * <pre>assertThat(xml, hasXPath("/root/something[2]/cheese", myNs))</pre>
 * 
 * @param xPath
 *     the target xpath
 * @param namespaceContext
 *     the namespace for matching nodes
 */
public static org.hamcrest.Matcher<org.w3c.dom.Node> hasXPath(java.lang.String xPath, javax.xml.namespace.NamespaceContext namespaceContext) {
 return org.hamcrest.xml.HasXPath.hasXPath(xPath, namespaceContext);
}
origin: hamcrest/JavaHamcrest

/**
 * Creates a matcher of {@link org.w3c.dom.Node}s that matches when the examined node has a value at the
 * specified <code>xPath</code>, within the specified <code>namespaceContext</code>, that satisfies
 * the specified <code>valueMatcher</code>.
 * For example:
 * <pre>assertThat(xml, hasXPath("/root/something[2]/cheese", myNs, equalTo("Cheddar")))</pre>
 * 
 * @param xPath
 *     the target xpath
 * @param namespaceContext
 *     the namespace for matching nodes
 * @param valueMatcher
 *     matcher for the value at the specified xpath
 */
public static Matcher<Node> hasXPath(String xPath, NamespaceContext namespaceContext, Matcher<String> valueMatcher) {
  return new HasXPath(xPath, namespaceContext, valueMatcher, STRING);
}
origin: org.hamcrest/java-hamcrest

@Override
public boolean matchesSafely(Node item, Description mismatch) {
  return evaluated(item, mismatch)
      .and(NODE_EXISTS)
      .matching(valueMatcher);
}
origin: hamcrest/JavaHamcrest

private HasXPath(String xPathExpression, NamespaceContext namespaceContext, Matcher<String> valueMatcher, QName mode) {
  this.compiledXPath = compiledXPath(xPathExpression, namespaceContext);
  this.xpathString = xPathExpression;
  this.valueMatcher = valueMatcher;
  this.evaluationMode = mode;
}
origin: org.hamcrest/hamcrest-all

/**
 * Creates a matcher of {@link org.w3c.dom.Node}s that matches when the examined node has a value at the
 * specified <code>xPath</code> that satisfies the specified <code>valueMatcher</code>.
 * <p/>
 * For example:
 * <pre>assertThat(xml, hasXPath("/root/something[2]/cheese", equalTo("Cheddar")))</pre>
 * 
 * @param xPath
 *     the target xpath
 * @param valueMatcher
 *     matcher for the value at the specified xpath
 */
public static org.hamcrest.Matcher<org.w3c.dom.Node> hasXPath(java.lang.String xPath, org.hamcrest.Matcher<java.lang.String> valueMatcher) {
 return org.hamcrest.xml.HasXPath.hasXPath(xPath, valueMatcher);
}
origin: org.hamcrest/hamcrest-all

  /**
   * Creates a matcher of {@link org.w3c.dom.Node}s that matches when the examined node contains a node
   * at the specified <code>xPath</code> within the specified namespace context, with any content.
   * <p/>
   * For example:
   * <pre>assertThat(xml, hasXPath("/root/something[2]/cheese", myNs))</pre>
   * 
   * @param xPath
   *     the target xpath
   * @param namespaceContext
   *     the namespace for matching nodes
   */
  @Factory
  public static Matcher<Node> hasXPath(String xPath, NamespaceContext namespaceContext) {
    return new HasXPath(xPath, namespaceContext, WITH_ANY_CONTENT, XPathConstants.NODE);
  }
}
origin: org.hamcrest/hamcrest

@Override
public boolean matchesSafely(Node item, Description mismatch) {
  return evaluated(item, mismatch)
      .and(NODE_EXISTS)
      .matching(valueMatcher);
}
origin: org.hamcrest/java-hamcrest

private HasXPath(String xPathExpression, NamespaceContext namespaceContext, Matcher<String> valueMatcher, QName mode) {
  this.compiledXPath = compiledXPath(xPathExpression, namespaceContext);
  this.xpathString = xPathExpression;
  this.valueMatcher = valueMatcher;
  this.evaluationMode = mode;
}
origin: hamcrest/JavaHamcrest

/**
 * Creates a matcher of {@link org.w3c.dom.Node}s that matches when the examined node contains a node
 * at the specified <code>xPath</code>, with any content.
 * For example:
 * <pre>assertThat(xml, hasXPath("/root/something[2]/cheese"))</pre>
 * 
 * @param xPath
 *     the target xpath
 */
public static org.hamcrest.Matcher<org.w3c.dom.Node> hasXPath(java.lang.String xPath) {
 return org.hamcrest.xml.HasXPath.hasXPath(xPath);
}
origin: org.hamcrest/hamcrest-all

/**
 * Creates a matcher of {@link org.w3c.dom.Node}s that matches when the examined node has a value at the
 * specified <code>xPath</code>, within the specified <code>namespaceContext</code>, that satisfies
 * the specified <code>valueMatcher</code>.
 * <p/>
 * For example:
 * <pre>assertThat(xml, hasXPath("/root/something[2]/cheese", myNs, equalTo("Cheddar")))</pre>
 * 
 * @param xPath
 *     the target xpath
 * @param namespaceContext
 *     the namespace for matching nodes
 * @param valueMatcher
 *     matcher for the value at the specified xpath
 */
@Factory
public static Matcher<Node> hasXPath(String xPath, NamespaceContext namespaceContext, Matcher<String> valueMatcher) {
  return new HasXPath(xPath, namespaceContext, valueMatcher, STRING);
}
origin: org.hamcrest/hamcrest

private HasXPath(String xPathExpression, NamespaceContext namespaceContext, Matcher<String> valueMatcher, QName mode) {
  this.compiledXPath = compiledXPath(xPathExpression, namespaceContext);
  this.xpathString = xPathExpression;
  this.valueMatcher = valueMatcher;
  this.evaluationMode = mode;
}
origin: org.hamcrest/hamcrest-all

/**
 * Creates a matcher of {@link org.w3c.dom.Node}s that matches when the examined node has a value at the
 * specified <code>xPath</code>, within the specified <code>namespaceContext</code>, that satisfies
 * the specified <code>valueMatcher</code>.
 * <p/>
 * For example:
 * <pre>assertThat(xml, hasXPath("/root/something[2]/cheese", myNs, equalTo("Cheddar")))</pre>
 * 
 * @param xPath
 *     the target xpath
 * @param namespaceContext
 *     the namespace for matching nodes
 * @param valueMatcher
 *     matcher for the value at the specified xpath
 */
public static org.hamcrest.Matcher<org.w3c.dom.Node> hasXPath(java.lang.String xPath, javax.xml.namespace.NamespaceContext namespaceContext, org.hamcrest.Matcher<java.lang.String> valueMatcher) {
 return org.hamcrest.xml.HasXPath.hasXPath(xPath, namespaceContext, valueMatcher);
}
origin: org.hamcrest/java-hamcrest

  /**
   * Creates a matcher of {@link org.w3c.dom.Node}s that matches when the examined node contains a node
   * at the specified <code>xPath</code> within the specified namespace context, with any content.
   * For example:
   * <pre>assertThat(xml, hasXPath("/root/something[2]/cheese", myNs))</pre>
   * 
   * @param xPath
   *     the target xpath
   * @param namespaceContext
   *     the namespace for matching nodes
   */
  public static Matcher<Node> hasXPath(String xPath, NamespaceContext namespaceContext) {
    return new HasXPath(xPath, namespaceContext, WITH_ANY_CONTENT, XPathConstants.NODE);
  }
}
origin: hamcrest/JavaHamcrest

/**
 * Creates a matcher of {@link org.w3c.dom.Node}s that matches when the examined node contains a node
 * at the specified <code>xPath</code>, with any content.
 * For example:
 * <pre>assertThat(xml, hasXPath("/root/something[2]/cheese"))</pre>
 * 
 * @param xPath
 *     the target xpath
 */
public static Matcher<Node> hasXPath(String xPath) {
  return hasXPath(xPath, NO_NAMESPACE_CONTEXT);
}
origin: org.hamcrest/java-hamcrest

/**
 * Creates a matcher of {@link org.w3c.dom.Node}s that matches when the examined node has a value at the
 * specified <code>xPath</code>, within the specified <code>namespaceContext</code>, that satisfies
 * the specified <code>valueMatcher</code>.
 * For example:
 * <pre>assertThat(xml, hasXPath("/root/something[2]/cheese", myNs, equalTo("Cheddar")))</pre>
 * 
 * @param xPath
 *     the target xpath
 * @param namespaceContext
 *     the namespace for matching nodes
 * @param valueMatcher
 *     matcher for the value at the specified xpath
 */
public static Matcher<Node> hasXPath(String xPath, NamespaceContext namespaceContext, Matcher<String> valueMatcher) {
  return new HasXPath(xPath, namespaceContext, valueMatcher, STRING);
}
org.hamcrest.xmlHasXPath

Javadoc

Applies a Matcher to a given XML Node in an existing XML Node tree, specified by an XPath expression.

Most used methods

  • hasXPath
    Creates a matcher of org.w3c.dom.Nodes that matches when the examined node has a value at the specif
  • <init>
  • compiledXPath
  • evaluated

Popular in Java

  • Making http requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Kernel (java.awt.image)
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now