public class XpathExpectationsHelper extends ObjectSE
| コンストラクターと説明 |
|---|
XpathExpectationsHelper(StringSE expression, MapSE<StringSE, StringSE> namespaces, ObjectSE... args)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<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, Matcher<? super StringSE> matcher)XPath 式を適用し、結果のコンテンツを特定の Hamcrest マッチャーでアサートします。 |
void | assertString(byte[] content, StringSE encoding, StringSE expectedValue)XPath 式を適用し、結果のコンテンツを文字列としてアサートします。 |
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 式を適用し、結果のコンテンツが存在することをアサートします。 |
protected XPathExpressionSE | getXpathExpression() コンパイルされた XPath 式を返します。 |
protected DocumentSE | parseXmlByteArray(byte[] xml, StringSE encoding) 指定された XML コンテンツを DocumentSE に解析します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEpublic XpathExpectationsHelper(StringSE expression, @Nullable MapSE<StringSE,StringSE> namespaces, ObjectSE... args) throws XPathExpressionExceptionSE
expression - XPath 式 namespaces - XPath 式で参照される XML 名前空間、または nullargs - String.format(String, Object...)SE で定義されたフォーマット指定子を使用して XPath 式をパラメーター化する引数 XPathExpressionExceptionSE - 式のコンパイルが失敗した場合 protected XPathExpressionSE getXpathExpression()
public void assertNode(byte[] content,
@Nullable
StringSE encoding,
Matcher<? super NodeSE> matcher)
throws ExceptionSENodeSE として評価し、指定された Matcher<Node> でそれをアサートします。ExceptionSEpublic void assertNodeList(byte[] content,
@Nullable
StringSE encoding,
Matcher<? super NodeListSE> matcher)
throws ExceptionSENodeListSE として評価し、指定された Matcher<NodeList> でそれをアサートします。ExceptionSEpublic void exists(byte[] content,
@Nullable
StringSE encoding)
throws ExceptionSEExceptionSE - コンテンツの解析または式の評価が失敗した場合 public void doesNotExist(byte[] content,
@Nullable
StringSE encoding)
throws ExceptionSEExceptionSE - コンテンツの解析または式の評価が失敗した場合 public void assertNodeCount(byte[] content,
@Nullable
StringSE encoding,
Matcher<IntegerSE> matcher)
throws ExceptionSEExceptionSE - コンテンツの解析または式の評価が失敗した場合 public void assertNodeCount(byte[] content,
@Nullable
StringSE encoding,
int expectedCount)
throws ExceptionSEExceptionSE - コンテンツの解析または式の評価が失敗した場合 public void assertString(byte[] content,
@Nullable
StringSE encoding,
Matcher<? super StringSE> matcher)
throws ExceptionSEExceptionSE - コンテンツの解析または式の評価が失敗した場合 public void assertString(byte[] content,
@Nullable
StringSE encoding,
StringSE expectedValue)
throws ExceptionSEExceptionSE - コンテンツの解析または式の評価が失敗した場合 public void assertNumber(byte[] content,
@Nullable
StringSE encoding,
Matcher<? super DoubleSE> matcher)
throws ExceptionSEExceptionSE - コンテンツの解析または式の評価が失敗した場合 public void assertNumber(byte[] content,
@Nullable
StringSE encoding,
DoubleSE expectedValue)
throws ExceptionSEExceptionSE - コンテンツの解析または式の評価が失敗した場合 public void assertBoolean(byte[] content,
@Nullable
StringSE encoding,
boolean expectedValue)
throws ExceptionSEExceptionSE - コンテンツの解析または式の評価が失敗した場合 @Nullable public <T> T evaluateXpath(byte[] content, @Nullable StringSE encoding, ClassSE<T> targetClass) throws ExceptionSE
content - 評価するコンテンツ encoding - 使用するエンコーディング (必要に応じて)targetClass - ターゲットクラス。Number、String、Boolean、org.w3c.Node、NodeList のいずれか ExceptionSE - コンテンツの解析または式の評価が失敗した場合 protected DocumentSE parseXmlByteArray(byte[] xml, @Nullable StringSE encoding) throws ExceptionSE
DocumentSE に解析します。xml - 解析するコンテンツ encoding - メタデータとして提供される場合、オプションのコンテンツエンコーディング (たとえば HTTP ヘッダー)ExceptionSE@Nullable protected <T> T evaluateXpath(DocumentSE document, QNameSE evaluationType, ClassSE<T> expectedClass) throws XPathExpressionExceptionSE
XPathExpressionExceptionSE - 式の評価が失敗した場合