public class XpathExpectationsHelper
extends java.lang.Object| コンストラクターと説明 |
|---|
XpathExpectationsHelper(java.lang.String expression, java.util.Map<java.lang.String,java.lang.String> namespaces, java.lang.Object... args)XpathExpectationsHelper コンストラクター。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
void | assertBoolean(byte[] content, java.lang.String encoding, boolean expectedValue)XPath 式を適用し、結果のコンテンツをブール値としてアサートします。 |
void | assertNode(byte[] content, java.lang.String encoding, org.hamcrest.Matcher<? super org.w3c.dom.Node> matcher) コンテンツを解析し、XPath 式を Node として評価し、指定された Matcher<Node> でアサートします。 |
void | assertNodeCount(byte[] content, java.lang.String encoding, int expectedCount)XPath 式を適用し、結果のコンテンツを整数としてアサートします。 |
void | assertNodeCount(byte[] content, java.lang.String encoding, org.hamcrest.Matcher<java.lang.Integer> matcher)XPath 式を適用し、結果のコンテンツを特定の Hamcrest マッチャーでアサートします。 |
void | assertNumber(byte[] content, java.lang.String encoding, java.lang.Double expectedValue)XPath 式を適用し、結果のコンテンツを Double としてアサートします。 |
void | assertNumber(byte[] content, java.lang.String encoding, org.hamcrest.Matcher<? super java.lang.Double> matcher)XPath 式を適用し、結果のコンテンツを特定の Hamcrest マッチャーでアサートします。 |
void | assertString(byte[] content, java.lang.String encoding, org.hamcrest.Matcher<? super java.lang.String> matcher)XPath 式を適用し、結果のコンテンツを特定の Hamcrest マッチャーでアサートします。 |
void | assertString(byte[] content, java.lang.String encoding, java.lang.String expectedValue)XPath 式を適用し、結果のコンテンツを文字列としてアサートします。 |
void | doesNotExist(byte[] content, java.lang.String encoding)XPath 式を適用し、結果のコンテンツが存在しないことを表明します。 |
<T> T | evaluateXpath(byte[] content, java.lang.String encoding, java.lang.Class<T> targetClass)XPath を評価し、結果の値を返します。 |
protected <T> T | evaluateXpath(org.w3c.dom.Document document, QNameEE evaluationType, java.lang.Class<T> expectedClass) 指定されたドキュメントに XPath 式を適用します。 |
void | exists(byte[] content, java.lang.String encoding)XPath 式を適用し、結果のコンテンツが存在することをアサートします。 |
protected javax.xml.xpath.XPathExpression | getXpathExpression() コンパイルされた XPath 式を返します。 |
protected org.w3c.dom.Document | parseXmlByteArray(byte[] xml, java.lang.String encoding) 指定された XML コンテンツを Document に解析します。 |
public XpathExpectationsHelper(java.lang.String expression,
@Nullable
java.util.Map<java.lang.String,java.lang.String> namespaces,
java.lang.Object... args)
throws javax.xml.xpath.XPathExpressionExceptionexpression - XPath 式 namespaces - XPath 式で参照される XML 名前空間、または nullargs - String.format(String, Object...) で定義されたフォーマット指定子を使用して XPath 式をパラメーター化する引数 javax.xml.xpath.XPathExpressionException - 式のコンパイルが失敗した場合 protected javax.xml.xpath.XPathExpression getXpathExpression()
public void assertNode(byte[] content,
@Nullable
java.lang.String encoding,
org.hamcrest.Matcher<? super org.w3c.dom.Node> matcher)
throws java.lang.ExceptionNode として評価し、指定された Matcher<Node> でアサートします。java.lang.Exceptionpublic void exists(byte[] content,
@Nullable
java.lang.String encoding)
throws java.lang.Exceptionjava.lang.Exception - コンテンツの解析または式の評価が失敗した場合 public void doesNotExist(byte[] content,
@Nullable
java.lang.String encoding)
throws java.lang.Exceptionjava.lang.Exception - コンテンツの解析または式の評価が失敗した場合 public void assertNodeCount(byte[] content,
@Nullable
java.lang.String encoding,
org.hamcrest.Matcher<java.lang.Integer> matcher)
throws java.lang.Exceptionjava.lang.Exception - コンテンツの解析または式の評価が失敗した場合 public void assertNodeCount(byte[] content,
@Nullable
java.lang.String encoding,
int expectedCount)
throws java.lang.Exceptionjava.lang.Exception - コンテンツの解析または式の評価が失敗した場合 public void assertString(byte[] content,
@Nullable
java.lang.String encoding,
org.hamcrest.Matcher<? super java.lang.String> matcher)
throws java.lang.Exceptionjava.lang.Exception - コンテンツの解析または式の評価が失敗した場合 public void assertString(byte[] content,
@Nullable
java.lang.String encoding,
java.lang.String expectedValue)
throws java.lang.Exceptionjava.lang.Exception - コンテンツの解析または式の評価が失敗した場合 public void assertNumber(byte[] content,
@Nullable
java.lang.String encoding,
org.hamcrest.Matcher<? super java.lang.Double> matcher)
throws java.lang.Exceptionjava.lang.Exception - コンテンツの解析または式の評価が失敗した場合 public void assertNumber(byte[] content,
@Nullable
java.lang.String encoding,
java.lang.Double expectedValue)
throws java.lang.Exceptionjava.lang.Exception - コンテンツの解析または式の評価が失敗した場合 public void assertBoolean(byte[] content,
@Nullable
java.lang.String encoding,
boolean expectedValue)
throws java.lang.Exceptionjava.lang.Exception - コンテンツの解析または式の評価が失敗した場合 @Nullable public <T> T evaluateXpath(byte[] content, @Nullable java.lang.String encoding, java.lang.Class<T> targetClass) throws java.lang.Exception
content - 評価するコンテンツ encoding - 使用するエンコーディング (必要に応じて)targetClass - ターゲットクラス。Number、String、Boolean、org.w3c.Node、NodeList のいずれか java.lang.Exception - コンテンツの解析または式の評価が失敗した場合 protected org.w3c.dom.Document parseXmlByteArray(byte[] xml,
@Nullable
java.lang.String encoding)
throws java.lang.ExceptionDocument に解析します。xml - 解析するコンテンツ encoding - メタデータとして提供される場合、オプションのコンテンツエンコーディング (たとえば HTTP ヘッダー)java.lang.Exception