クラス XpathExpectationsHelper

java.lang.ObjectSE
org.springframework.test.util.XpathExpectationsHelper

public class XpathExpectationsHelper extends ObjectSE
XPath 式を介してアサーションを適用するためのヘルパークラス。
導入:
3.2
作成者:
Rossen Stoyanchev
  • コンストラクターのサマリー

    コンストラクター
    コンストラクター
    説明
    XpathExpectationsHelper コンストラクター。
  • メソッドのサマリー

    修飾子と型
    メソッド
    説明
    void
    assertBoolean(byte[] content, StringSE encoding, boolean expectedValue)
    XPath 式を適用し、結果のコンテンツをブール値としてアサートします。
    void
    assertNode(byte[] content, StringSE encoding, Matcher<? super NodeSE> matcher)
    コンテンツを解析し、XPath 式を NodeSE として評価し、指定された Matcher<Node> でそれをアサートします。
    void
    assertNodeCount(byte[] content, StringSE encoding, int expectedCount)
    XPath 式を適用し、結果のコンテンツを整数としてアサートします。
    void
    assertNodeCount(byte[] content, StringSE encoding, Matcher<? super IntegerSE> matcher)
    XPath 式を適用し、結果のコンテンツを特定の Hamcrest マッチャーでアサートします。
    void
    assertNodeList(byte[] content, StringSE encoding, Matcher<? super NodeListSE> matcher)
    コンテンツを解析し、XPath 式を NodeListSE として評価し、指定された Matcher<NodeList> でそれをアサートします。
    void
    assertNumber(byte[] content, StringSE encoding, DoubleSE expectedValue)
    XPath 式を適用し、結果のコンテンツを Double としてアサートします。
    void
    assertNumber(byte[] content, StringSE encoding, Matcher<? super DoubleSE> matcher)
    XPath 式を適用し、結果のコンテンツを特定の Hamcrest マッチャーでアサートします。
    void
    assertString(byte[] content, StringSE encoding, StringSE expectedValue)
    XPath 式を適用し、結果のコンテンツを文字列としてアサートします。
    void
    assertString(byte[] content, StringSE encoding, Matcher<? super StringSE> matcher)
    XPath 式を適用し、結果のコンテンツを特定の Hamcrest マッチャーでアサートします。
    void
    doesNotExist(byte[] content, StringSE encoding)
    XPath 式を適用し、結果のコンテンツが存在しないことを表明します。
    <T> T
    evaluateXpath(byte[] content, StringSE encoding, ClassSE<T> targetClass)
    XPath を評価し、結果の値を返します。
    protected <T> T
    evaluateXpath(DocumentSE document, QNameSE evaluationType, ClassSE<T> expectedClass)
    指定されたドキュメントに XPath 式を適用します。
    void
    exists(byte[] content, StringSE encoding)
    XPath 式を適用し、結果のコンテンツが存在することをアサートします。
    コンパイルされた XPath 式を返します。
    protected DocumentSE
    parseXmlByteArray(byte[] xml, StringSE encoding)
    指定された XML コンテンツを DocumentSE に解析します。

    クラス java.lang.ObjectSE から継承されたメソッド

    clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSE
  • コンストラクターの詳細

  • メソッドの詳細

    • getXpathExpression

      protected XPathExpressionSE getXpathExpression()
      コンパイルされた XPath 式を返します。
    • assertNode

      public void assertNode(byte[] content, @Nullable StringSE encoding, Matcher<? super NodeSE> matcher) throws ExceptionSE
      コンテンツを解析し、XPath 式を NodeSE として評価し、指定された Matcher<Node> でそれをアサートします。
      例外:
      ExceptionSE
    • assertNodeList

      public void assertNodeList(byte[] content, @Nullable StringSE encoding, Matcher<? super NodeListSE> matcher) throws ExceptionSE
      コンテンツを解析し、XPath 式を NodeListSE として評価し、指定された Matcher<NodeList> でそれをアサートします。
      例外:
      ExceptionSE
      導入:
      5.2.2
    • exists

      public void exists(byte[] content, @Nullable StringSE encoding) throws ExceptionSE
      XPath 式を適用し、結果のコンテンツが存在することをアサートします。
      例外:
      ExceptionSE - コンテンツの解析または式の評価が失敗した場合
    • doesNotExist

      public void doesNotExist(byte[] content, @Nullable StringSE encoding) throws ExceptionSE
      XPath 式を適用し、結果のコンテンツが存在しないことを表明します。
      例外:
      ExceptionSE - コンテンツの解析または式の評価が失敗した場合
    • assertNodeCount

      public void assertNodeCount(byte[] content, @Nullable StringSE encoding, Matcher<? super IntegerSE> matcher) throws ExceptionSE
      XPath 式を適用し、結果のコンテンツを特定の Hamcrest マッチャーでアサートします。
      例外:
      ExceptionSE - コンテンツの解析または式の評価が失敗した場合
    • assertNodeCount

      public void assertNodeCount(byte[] content, @Nullable StringSE encoding, int expectedCount) throws ExceptionSE
      XPath 式を適用し、結果のコンテンツを整数としてアサートします。
      例外:
      ExceptionSE - コンテンツの解析または式の評価が失敗した場合
    • assertString

      public void assertString(byte[] content, @Nullable StringSE encoding, Matcher<? super StringSE> matcher) throws ExceptionSE
      XPath 式を適用し、結果のコンテンツを特定の Hamcrest マッチャーでアサートします。
      例外:
      ExceptionSE - コンテンツの解析または式の評価が失敗した場合
    • assertString

      public void assertString(byte[] content, @Nullable StringSE encoding, StringSE expectedValue) throws ExceptionSE
      XPath 式を適用し、結果のコンテンツを文字列としてアサートします。
      例外:
      ExceptionSE - コンテンツの解析または式の評価が失敗した場合
    • assertNumber

      public void assertNumber(byte[] content, @Nullable StringSE encoding, Matcher<? super DoubleSE> matcher) throws ExceptionSE
      XPath 式を適用し、結果のコンテンツを特定の Hamcrest マッチャーでアサートします。
      例外:
      ExceptionSE - コンテンツの解析または式の評価が失敗した場合
    • assertNumber

      public void assertNumber(byte[] content, @Nullable StringSE encoding, DoubleSE expectedValue) throws ExceptionSE
      XPath 式を適用し、結果のコンテンツを Double としてアサートします。
      例外:
      ExceptionSE - コンテンツの解析または式の評価が失敗した場合
    • assertBoolean

      public void assertBoolean(byte[] content, @Nullable StringSE encoding, boolean expectedValue) throws ExceptionSE
      XPath 式を適用し、結果のコンテンツをブール値としてアサートします。
      例外:
      ExceptionSE - コンテンツの解析または式の評価が失敗した場合
    • evaluateXpath

      @Nullable public <T> T evaluateXpath(byte[] content, @Nullable StringSE encoding, ClassSE<T> targetClass) throws ExceptionSE
      XPath を評価し、結果の値を返します。
      パラメーター:
      content - 評価するコンテンツ
      encoding - 使用するエンコーディング (必要に応じて)
      targetClass - ターゲットクラス。Number、String、Boolean、org.w3c.Node、NodeList のいずれか
      例外:
      ExceptionSE - コンテンツの解析または式の評価が失敗した場合
      導入:
      5.1
    • parseXmlByteArray

      protected DocumentSE parseXmlByteArray(byte[] xml, @Nullable StringSE encoding) throws ExceptionSE
      指定された XML コンテンツを DocumentSE に解析します。
      パラメーター:
      xml - 解析するコンテンツ
      encoding - メタデータとして提供される場合、オプションのコンテンツエンコーディング (たとえば HTTP ヘッダー)
      戻り値:
      解析されたドキュメント
      例外:
      ExceptionSE
    • evaluateXpath

      @Nullable protected <T> T evaluateXpath(DocumentSE document, QNameSE evaluationType, ClassSE<T> expectedClass) throws XPathExpressionExceptionSE
      指定されたドキュメントに XPath 式を適用します。
      例外:
      XPathExpressionExceptionSE - 式の評価が失敗した場合