java.lang.Object
org.apache.wicket.util.tester.WicketTestCase
Base class for tests which require comparing wicket response with a file.
To create/replace the expected result file with the new content, define the system property like -Dwicket.replace.expected.results=true
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidprotected final voidcompareMarkupWithFile(IMarkupFragment markup, String filename, Class<?> scopeClass) Compare the markup provided with the file contentprotected final voidcompareMarkupWithString(IMarkupFragment markup, String testMarkup) Compare the markup provided with the Stringprotected voidexecuteBehavior(AbstractAjaxBehavior behavior, String filename) protected voidexecuteListener(Component component, String filename) protected <T extends Page>
voidexecuteTest(Class<T> pageClass, String filename) Use-Dwicket.replace.expected.results=trueto automatically replace the expected output file.protected <T extends Page>
voidexecuteTest(Class<T> pageClass, org.apache.wicket.request.mapper.parameter.PageParameters parameters, String filename) Use-Dwicket.replace.expected.results=trueto automatically replace the expected output file.protected voidexecuteTest(Page page, String filename) Use-Dwicket.replace.expected.results=trueto automatically replace the expected output file.Returns the current Maven build directory taken from the basedir system property, or null if not setprotected WebApplicationprotected WicketTesterIn case you need to subclass WicketTester and want to be independent on possible changes in setUp().
-
Field Details
-
tester
-
-
Constructor Details
-
WicketTestCase
public WicketTestCase()
-
-
Method Details
-
commonBefore
-
newApplication
- Returns:
- the application that should be used for the test
-
newWicketTester
In case you need to subclass WicketTester and want to be independent on possible changes in setUp().- Parameters:
app-- Returns:
- WIcketTester
-
commonAfter
-
executeTest
Use-Dwicket.replace.expected.results=trueto automatically replace the expected output file.- Type Parameters:
T-- Parameters:
pageClass-filename-- Throws:
Exception
-
executeTest
Use-Dwicket.replace.expected.results=trueto automatically replace the expected output file.- Parameters:
page-filename-- Throws:
Exception
-
executeTest
protected <T extends Page> void executeTest(Class<T> pageClass, org.apache.wicket.request.mapper.parameter.PageParameters parameters, String filename) throws Exception Use-Dwicket.replace.expected.results=trueto automatically replace the expected output file.- Type Parameters:
T-- Parameters:
pageClass-parameters-filename-- Throws:
Exception
-
executeListener
- Parameters:
component-filename-- Throws:
Exception
-
executeBehavior
- Parameters:
behavior-filename-- Throws:
Exception
-
getBasedir
Returns the current Maven build directory taken from the basedir system property, or null if not set- Returns:
- path with a trailing slash
-
compareMarkupWithFile
protected final void compareMarkupWithFile(IMarkupFragment markup, String filename, Class<?> scopeClass) throws IOException Compare the markup provided with the file content- Parameters:
markup-filename-scopeClass-- Throws:
IOException
-
compareMarkupWithString
Compare the markup provided with the String- Parameters:
markup-testMarkup-
-