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 式を Node SE として評価し、指定された 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 式を NodeList SE として評価し、指定された 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 コンテンツを Document SE に解析します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public XpathExpectationsHelper(StringSE expression, @Nullable MapSE<StringSE,StringSE> namespaces, ObjectSE... args) throws XPathExpressionExceptionSE
expression
- XPath 式 namespaces
- XPath 式で参照される XML 名前空間、または null
args
- String.format(String, Object...)
SE で定義されたフォーマット指定子を使用して XPath 式をパラメーター化する引数 XPathExpressionExceptionSE
- 式のコンパイルが失敗した場合 protected XPathExpressionSE getXpathExpression()
public void assertNode(byte[] content, @Nullable StringSE encoding, Matcher<? super NodeSE> matcher) throws ExceptionSE
Node
SE として評価し、指定された Matcher<Node>
でそれをアサートします。ExceptionSE
public void assertNodeList(byte[] content, @Nullable StringSE encoding, Matcher<? super NodeListSE> matcher) throws ExceptionSE
NodeList
SE として評価し、指定された Matcher<NodeList>
でそれをアサートします。ExceptionSE
public void exists(byte[] content, @Nullable StringSE encoding) throws ExceptionSE
ExceptionSE
- コンテンツの解析または式の評価が失敗した場合 public void doesNotExist(byte[] content, @Nullable StringSE encoding) throws ExceptionSE
ExceptionSE
- コンテンツの解析または式の評価が失敗した場合 public void assertNodeCount(byte[] content, @Nullable StringSE encoding, Matcher<? super IntegerSE> matcher) throws ExceptionSE
ExceptionSE
- コンテンツの解析または式の評価が失敗した場合 public void assertNodeCount(byte[] content, @Nullable StringSE encoding, int expectedCount) throws ExceptionSE
ExceptionSE
- コンテンツの解析または式の評価が失敗した場合 public void assertString(byte[] content, @Nullable StringSE encoding, Matcher<? super StringSE> matcher) throws ExceptionSE
ExceptionSE
- コンテンツの解析または式の評価が失敗した場合 public void assertString(byte[] content, @Nullable StringSE encoding, StringSE expectedValue) throws ExceptionSE
ExceptionSE
- コンテンツの解析または式の評価が失敗した場合 public void assertNumber(byte[] content, @Nullable StringSE encoding, Matcher<? super DoubleSE> matcher) throws ExceptionSE
ExceptionSE
- コンテンツの解析または式の評価が失敗した場合 public void assertNumber(byte[] content, @Nullable StringSE encoding, DoubleSE expectedValue) throws ExceptionSE
ExceptionSE
- コンテンツの解析または式の評価が失敗した場合 public void assertBoolean(byte[] content, @Nullable StringSE encoding, boolean expectedValue) throws ExceptionSE
ExceptionSE
- コンテンツの解析または式の評価が失敗した場合 @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
Document
SE に解析します。xml
- 解析するコンテンツ encoding
- メタデータとして提供される場合、オプションのコンテンツエンコーディング (たとえば HTTP ヘッダー)ExceptionSE
@Nullable protected <T> T evaluateXpath(DocumentSE document, QNameSE evaluationType, ClassSE<T> expectedClass) throws XPathExpressionExceptionSE
XPathExpressionExceptionSE
- 式の評価が失敗した場合