|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.testframework.AbstractMagnoliaIntegrationTest info.magnolia.testframework.htmlunit.AbstractMagnoliaHtmlUnitTest
public abstract class AbstractMagnoliaHtmlUnitTest
A base class for Magnolia integration tests. Might be split into util class/methods; since we use JUnit4, inheritance isn't really mandatory.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class info.magnolia.testframework.AbstractMagnoliaIntegrationTest |
---|
AbstractMagnoliaIntegrationTest.Instance, AbstractMagnoliaIntegrationTest.User |
Field Summary | |
---|---|
protected static Map<String,String> |
DEFAULT_HEADERS
|
protected static String |
SESSION_ID_REGEXP
Session id's can consist of any digit and letter (lower or upper case). |
Fields inherited from class info.magnolia.testframework.AbstractMagnoliaIntegrationTest |
---|
AUTHOR_CONTEXT_PATH_PROPERTY, DEFAULT_DOMAIN, DOMAIN_PROPERTY, PUBLIC_CONTEXT_PATH_PROPERTY |
Constructor Summary | |
---|---|
AbstractMagnoliaHtmlUnitTest()
|
Method Summary | ||
---|---|---|
protected
|
assertRedirected(String reason,
String expectedTargetURLPattern,
com.gargoylesoftware.htmlunit.Page page,
AbstractMagnoliaIntegrationTest.User user)
|
|
protected HttpURLConnection |
openConnection(AbstractMagnoliaIntegrationTest.Instance instance,
String path,
AbstractMagnoliaIntegrationTest.User user)
|
|
protected HttpURLConnection |
openConnection(AbstractMagnoliaIntegrationTest.Instance instance,
String path,
AbstractMagnoliaIntegrationTest.User user,
Map<String,String> headers)
Use this method when you need low-level access to the connection headers and content. |
|
protected com.gargoylesoftware.htmlunit.html.HtmlPage |
openHtmlPage(AbstractMagnoliaIntegrationTest.Instance instance,
String path,
AbstractMagnoliaIntegrationTest.User user)
Deprecated. openPage now uses generics, so use that instead. |
|
protected com.gargoylesoftware.htmlunit.html.HtmlPage |
openHtmlPage(AbstractMagnoliaIntegrationTest.Instance instance,
String path,
AbstractMagnoliaIntegrationTest.User user,
boolean followRedirects)
Deprecated. openPage now uses generics, so use that instead. |
|
protected com.gargoylesoftware.htmlunit.Page |
openPage(AbstractMagnoliaIntegrationTest.Instance instance,
String path,
AbstractMagnoliaIntegrationTest.User user)
Deprecated. use #openPage(String, AbstractMagnoliaHtmlUnitTest.User, boolean)
with AbstractMagnoliaHtmlUnitTest.Instance.AUTHOR.getURL() |
|
protected
|
openPage(AbstractMagnoliaIntegrationTest.Instance instance,
String path,
AbstractMagnoliaIntegrationTest.User user,
boolean followRedirects)
Deprecated. use #openPage(String, AbstractMagnoliaHtmlUnitTest.User, boolean)
with AbstractMagnoliaIntegrationTest.Instance.AUTHOR.getURL() |
|
protected
|
openPage(String url,
AbstractMagnoliaIntegrationTest.User user)
|
|
protected
|
openPage(String url,
AbstractMagnoliaIntegrationTest.User user,
boolean followRedirects)
|
|
protected
|
openPage(String url,
AbstractMagnoliaIntegrationTest.User user,
boolean followRedirects,
boolean enableJavascript)
|
|
protected
|
openPage(String url,
AbstractMagnoliaIntegrationTest.User user,
boolean followRedirects,
boolean enableJavascript,
Map<String,String> headers)
This uses htmlunit, simulates a browser and does all kind of fancy stuff for you. |
|
protected void |
saveToFile(com.gargoylesoftware.htmlunit.Page page,
StackTraceElement stackTraceElement)
Need to pass a StackTraceElement to determine the current method, because we can't safely guess at what depth of the stack this method was called. |
|
protected void |
saveToFile(com.gargoylesoftware.htmlunit.Page page,
Throwable fakeException)
Passing a fake exception might be simpler for some cases. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String SESSION_ID_REGEXP
protected static final Map<String,String> DEFAULT_HEADERS
Constructor Detail |
---|
public AbstractMagnoliaHtmlUnitTest()
Method Detail |
---|
protected HttpURLConnection openConnection(AbstractMagnoliaIntegrationTest.Instance instance, String path, AbstractMagnoliaIntegrationTest.User user) throws IOException
IOException
#openConnection(AbstractMagnoliaHtmlUnitTest.Instance, String, AbstractMagnoliaHtmlUnitTest.User, java.util.Map)
protected HttpURLConnection openConnection(AbstractMagnoliaIntegrationTest.Instance instance, String path, AbstractMagnoliaIntegrationTest.User user, Map<String,String> headers) throws IOException
IOException
@Deprecated protected com.gargoylesoftware.htmlunit.html.HtmlPage openHtmlPage(AbstractMagnoliaIntegrationTest.Instance instance, String path, AbstractMagnoliaIntegrationTest.User user) throws IOException
IOException
#openPage(AbstractMagnoliaHtmlUnitTest.Instance, String, AbstractMagnoliaHtmlUnitTest.User, boolean)
@Deprecated protected com.gargoylesoftware.htmlunit.html.HtmlPage openHtmlPage(AbstractMagnoliaIntegrationTest.Instance instance, String path, AbstractMagnoliaIntegrationTest.User user, boolean followRedirects) throws IOException
IOException
@Deprecated protected com.gargoylesoftware.htmlunit.Page openPage(AbstractMagnoliaIntegrationTest.Instance instance, String path, AbstractMagnoliaIntegrationTest.User user) throws IOException
#openPage(String, AbstractMagnoliaHtmlUnitTest.User, boolean)
with AbstractMagnoliaHtmlUnitTest.Instance.AUTHOR.getURL()
IOException
@Deprecated protected <P extends com.gargoylesoftware.htmlunit.Page> P openPage(AbstractMagnoliaIntegrationTest.Instance instance, String path, AbstractMagnoliaIntegrationTest.User user, boolean followRedirects) throws IOException
#openPage(String, AbstractMagnoliaHtmlUnitTest.User, boolean)
with AbstractMagnoliaIntegrationTest.Instance.AUTHOR.getURL()
IOException
protected <P extends com.gargoylesoftware.htmlunit.Page> P openPage(String url, AbstractMagnoliaIntegrationTest.User user) throws IOException
IOException
protected <P extends com.gargoylesoftware.htmlunit.Page> P openPage(String url, AbstractMagnoliaIntegrationTest.User user, boolean followRedirects) throws IOException
IOException
protected <P extends com.gargoylesoftware.htmlunit.Page> P openPage(String url, AbstractMagnoliaIntegrationTest.User user, boolean followRedirects, boolean enableJavascript) throws IOException
IOException
protected <P extends com.gargoylesoftware.htmlunit.Page> P openPage(String url, AbstractMagnoliaIntegrationTest.User user, boolean followRedirects, boolean enableJavascript, Map<String,String> headers) throws IOException
IOException
protected <P extends com.gargoylesoftware.htmlunit.Page> P assertRedirected(String reason, String expectedTargetURLPattern, com.gargoylesoftware.htmlunit.Page page, AbstractMagnoliaIntegrationTest.User user) throws IOException
IOException
protected void saveToFile(com.gargoylesoftware.htmlunit.Page page, Throwable fakeException) throws IOException
IOException
saveToFile(com.gargoylesoftware.htmlunit.Page, StackTraceElement)
protected void saveToFile(com.gargoylesoftware.htmlunit.Page page, StackTraceElement stackTraceElement) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |