
net.sf.jsptest.assertion.OutputAssertion Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsptest-framework Show documentation
Show all versions of jsptest-framework Show documentation
The core framework functionality for JspTest.
The newest version!
package net.sf.jsptest.assertion;
/**
* Provides assertion methods related to raw text output.
*
* @author Lasse Koskela
*/
public class OutputAssertion extends AbstractAssertion {
private final String content;
/**
* @param content
* The raw output to perform assertions on.
*/
public OutputAssertion(String content) {
this.content = content;
}
/**
* Assert that the output should contain the given text.
*
* @param text
* The (partial) content that should be found from the output.
*/
public void shouldContain(String text) {
String msg = "Rendered output did not contain the expected text <" + text + ">:\n"
+ content;
assertContains(msg, content, text);
}
/**
* Assert that the output should not contain the given text.
*
* @param text
* The (partial) content that shouldn't be found from the output.
*/
public void shouldNotContain(String text) {
String msg = "Rendered output contained unexpected text <" + text + ">:\n" + content;
assertDoesNotContain(msg, content, text);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy