de.oio.jpdfunit
Interface ContentAssertion

All Known Subinterfaces:
DocumentAssertion
All Known Implementing Classes:
DocumentTester

public interface ContentAssertion

This interface provides the user the different content assertions.

Author:
bbratkus

Method Summary
 void assertContentContainsText(String text, TextSearchType type)
          This assert method checks if the supposed parameters are contained in the pdf document.
 void assertContentContainsTextMultipleTimes(String text, TextSearchType type)
          This assert method checks if the supposed parameters are contained in the document.
 void assertContentContainsTextOnPage(String text, int page, TextSearchType type)
          This assert method checks if the supposed parameters are contained in the document.
 void assertContentDoesNotContainText(String text, TextSearchType type)
          This assert method checks if the supposed parameters are not contained in the pdf document.
 void assertContentDoesNotContainTextMultipleTimes(String text, TextSearchType type)
          This assert method checks if the supposed parameters are contained in the document.
 void assertContentDoesNotContainTextOnPage(String text, int page, TextSearchType type)
          This assert method checks if the supposed parameters are not contained in the document.
 

Method Detail

assertContentContainsText

void assertContentContainsText(String text,
                               TextSearchType type)
This assert method checks if the supposed parameters are contained in the pdf document. The method matches the first time the text was found in the pdf document.

Parameters:
text - The string or regular expression (constructs a regular expression matcher from a String by compiling it using a new instance of RECompiler) to search for in the document. Be carefull regex are greedy.
type - The kind of search. The type is related to the pages of the document.

assertContentContainsTextMultipleTimes

void assertContentContainsTextMultipleTimes(String text,
                                            TextSearchType type)
This assert method checks if the supposed parameters are contained in the document. The method trys to match all the time the text was found in the document.

Parameters:
text - The string or regular expression to search for in the document. Be carefull regex are greedy.
type - The kind of search. The type is related to the pages of the document.

assertContentContainsTextOnPage

void assertContentContainsTextOnPage(String text,
                                     int page,
                                     TextSearchType type)
This assert method checks if the supposed parameters are contained in the document. The method trys to match the text on a certain page in the document.

Parameters:
text - The string or regular expression to search for in the document. Be carefull regex are greedy.
page - The page of the document which should be passed trough. The page count equals to a real document its 1-based.
type - The kind of search. The type is related to the pages of the document.

assertContentDoesNotContainText

void assertContentDoesNotContainText(String text,
                                     TextSearchType type)
This assert method checks if the supposed parameters are not contained in the pdf document. The method matches the first time the text was found in the pdf document.

Parameters:
text - The string or regular expression (constructs a regular expression matcher from a String by compiling it using a new instance of RECompiler) to search for in the document. Be carefull regex are greedy.
type - The kind of search. The type is related to the pages of the document.

assertContentDoesNotContainTextMultipleTimes

void assertContentDoesNotContainTextMultipleTimes(String text,
                                                  TextSearchType type)
This assert method checks if the supposed parameters are contained in the document. The method trys to match all the time the text was found in the document.

Parameters:
text - The string or regular expression to search for in the document. Be carefull regex are greedy.
type - The kind of search. The type is related to the pages of the document.

assertContentDoesNotContainTextOnPage

void assertContentDoesNotContainTextOnPage(String text,
                                           int page,
                                           TextSearchType type)
This assert method checks if the supposed parameters are not contained in the document. The method trys to match the text on a certain page in the document.

Parameters:
text - The string or regular expression to search for in the document. Be carefull regex are greedy.
page - The page of the document which should be passed trough. The page count equals to a real document its 1-based.
type - The kind of search. The type is related to the pages of the document.


Copyright © 2011. All Rights Reserved.