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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
protected final void
compareMarkupWithFile
(IMarkupFragment markup, String filename, Class<?> scopeClass) Compare the markup provided with the file contentprotected final void
compareMarkupWithString
(IMarkupFragment markup, String testMarkup) Compare the markup provided with the Stringprotected void
executeBehavior
(AbstractAjaxBehavior behavior, String filename) protected void
executeListener
(Component component, String filename) protected <T extends Page>
voidexecuteTest
(Class<T> pageClass, String filename) Use-Dwicket.replace.expected.results=true
to automatically replace the expected output file.protected <T extends Page>
voidexecuteTest
(Class<T> pageClass, PageParameters parameters, String filename) Use-Dwicket.replace.expected.results=true
to automatically replace the expected output file.protected void
executeTest
(Page page, String filename) Use-Dwicket.replace.expected.results=true
to automatically replace the expected output file.Returns the current Maven build directory taken from the basedir system property, or null if not setprotected WebApplication
protected WicketTester
In 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=true
to automatically replace the expected output file.- Type Parameters:
T
-- Parameters:
pageClass
-filename
-- Throws:
Exception
-
executeTest
Use-Dwicket.replace.expected.results=true
to automatically replace the expected output file.- Parameters:
page
-filename
-- Throws:
Exception
-
executeTest
protected <T extends Page> void executeTest(Class<T> pageClass, PageParameters parameters, String filename) throws Exception Use-Dwicket.replace.expected.results=true
to 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
-
-