public abstract class ModuleTestBase
extends TestCase
Look an introduction to OpenXava module testing at wiki .
Constructor and Description |
---|
ModuleTestBase(java.lang.String nameTest,
java.lang.String module)
To test the specified module of the default application.
|
ModuleTestBase(java.lang.String nameTest,
java.lang.String application,
java.lang.String module)
To test the specified module of the specified application.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
_collectionHasFilterHeader(java.lang.String collection) |
protected void |
assertAction(java.lang.String action) |
protected void |
assertAction(java.lang.String action,
java.lang.String arguments) |
protected void |
assertActions(java.lang.String[] expectedActions) |
protected void |
assertAllChecked() |
protected void |
assertAllCollectionChecked(java.lang.String collection) |
protected void |
assertAllCollectionUnchecked(java.lang.String collection) |
protected void |
assertAllGroupBys(java.lang.String... expectedTitles) |
protected void |
assertAllUnchecked() |
protected void |
assertCollectionColumnCount(java.lang.String collection,
int expected) |
protected void |
assertCollectionNotEmpty(java.lang.String collection) |
protected void |
assertCollectionRowCount(java.lang.String collection,
int expectedCount)
Row count displayed with data.
|
protected void |
assertContentType(java.lang.String type)
Util for web applications, but using it make the test web dependent.
|
protected void |
assertContentTypeForPopup(int popup,
java.lang.String type)
Util for web applications, but using it makes the test web dependent.
|
protected void |
assertContentTypeForPopup(java.lang.String type)
Util for web applications, but using it makes the test web dependent.
|
protected void |
assertDescriptionValue(java.lang.String name,
java.lang.String value) |
protected void |
assertDialog() |
protected void |
assertDialogTitle(java.lang.String expectedTitle) |
protected void |
assertDiscussionCommentContentText(java.lang.String name,
int row,
java.lang.String expectedText)
Assert the content of a comment of DISCUSSION property as text,
just the content of the comment excluding header data.
|
protected void |
assertDiscussionCommentsCount(java.lang.String name,
int expectedCount)
Assert the amount of comments in a DISCUSSION property.
|
protected void |
assertDiscussionCommentText(java.lang.String name,
int row,
java.lang.String extendedText)
Assert the content of a comment of DISCUSSION property as text,
including header data like user and date.
|
protected void |
assertEditable(java.lang.String name) |
protected void |
assertEditableInCollection(java.lang.String collection,
int row,
int column) |
protected void |
assertEditableInCollection(java.lang.String collection,
int row,
java.lang.String name) |
protected void |
assertError(java.lang.String message) |
protected void |
assertErrorsCount(int expectedCount) |
protected void |
assertExists(java.lang.String name) |
protected void |
assertFile(java.lang.String property)
Assert if the property with an upload editor has a file associated.
|
protected void |
assertFile(java.lang.String property,
int index,
java.lang.String expectedType)
Assert if the property with an upload editor with multiple files has a file associated in certain position.
|
protected void |
assertFile(java.lang.String property,
java.lang.String contentType)
Assert if the property with an upload editor of has a file associated.
|
protected void |
assertFilesCount(java.lang.String property,
int expectedCount)
Assert the amount of files in a property with an upload multiple editor.
|
protected void |
assertFocusOn(java.lang.String name) |
protected void |
assertInfo(java.lang.String message) |
protected void |
assertInfosCount(int expectedCount) |
protected void |
assertLabel(int sectionIndex,
java.lang.String expectedLabel) |
protected void |
assertLabel(java.lang.String name,
java.lang.String expectedLabel) |
protected void |
assertLabelInCollection(java.lang.String collection,
int column,
java.lang.String label) |
protected void |
assertLabelInList(int column,
java.lang.String label) |
protected void |
assertListAllConfigurations(java.lang.String... expectedTitles) |
protected void |
assertListColumnCount(int expected) |
protected void |
assertListNotEmpty() |
protected void |
assertListRowCount(int expected)
Rows count displayed with data.
|
protected void |
assertListSelectedConfiguration(java.lang.String expectedTitle) |
protected void |
assertListTitle(java.lang.String expectedTitle) |
protected void |
assertMessage(java.lang.String message) |
protected void |
assertMessagesCount(int expectedCount) |
protected void |
assertNoAction(java.lang.String action) |
protected void |
assertNoAction(java.lang.String action,
java.lang.String arguments) |
protected void |
assertNoDialog() |
protected void |
assertNoEditable(java.lang.String name) |
protected void |
assertNoEditableInCollection(java.lang.String collection,
int row,
int column) |
protected void |
assertNoEditableInCollection(java.lang.String collection,
int row,
java.lang.String name) |
protected void |
assertNoError(java.lang.String message) |
protected void |
assertNoErrors() |
protected void |
assertNoFile(java.lang.String property)
Assert if the property with an upload editor has not a file associated.
|
protected void |
assertNoInfo(java.lang.String message) |
protected void |
assertNoInfos() |
protected void |
assertNoLabel(java.lang.String name) |
protected void |
assertNoListTitle() |
protected void |
assertNoMessage(java.lang.String message) |
protected void |
assertNoMessages() |
protected void |
assertNoPopup() |
protected void |
assertNoRowStyleInCollection(java.lang.String collection,
int row) |
protected void |
assertNoRowStyleInList(int row) |
protected void |
assertNotEquals(java.lang.String msg,
java.lang.String value1,
java.lang.String value2) |
protected void |
assertNotExists(java.lang.String name) |
protected void |
assertNoWarning(java.lang.String message) |
protected void |
assertNoWarnings() |
protected void |
assertPopupCount(int count) |
protected void |
assertPopupPDFLine(int lineNumber,
java.lang.String expectedContent)
Assert the value for the specified line as text of PDF in the popup window.
|
protected void |
assertPopupPDFLinesCount(int expectedCount)
Assert the count of lines of the PDF in the popup window.
|
protected void |
assertRowChecked(int row) |
protected void |
assertRowCollectionChecked(java.lang.String collection,
int row) |
protected void |
assertRowCollectionUnchecked(java.lang.String collection,
int row) |
protected void |
assertRowsChecked(int[] rows) |
protected void |
assertRowsChecked(int f1,
int f2) |
protected void |
assertRowStyleInCollection(java.lang.String collection,
int row,
java.lang.String expectedStyle) |
protected void |
assertRowStyleInList(int row,
java.lang.String expectedStyle) |
protected void |
assertRowUnchecked(int row) |
protected void |
assertTotalInCollection(java.lang.String collection,
int row,
int column,
java.lang.String total) |
protected void |
assertTotalInCollection(java.lang.String collection,
int column,
java.lang.String total) |
protected void |
assertTotalInCollection(java.lang.String collection,
int row,
java.lang.String name,
java.lang.String total) |
protected void |
assertTotalInCollection(java.lang.String collection,
java.lang.String name,
java.lang.String total) |
protected void |
assertTotalInList(int column,
java.lang.String total) |
protected void |
assertTotalInList(java.lang.String name,
java.lang.String total) |
protected void |
assertValidValueExists(java.lang.String name,
java.lang.String key,
java.lang.String description) |
protected void |
assertValidValueNotExists(java.lang.String name,
java.lang.String key) |
protected void |
assertValidValues(java.lang.String name,
java.lang.String[][] values) |
protected void |
assertValidValuesCount(java.lang.String name,
int count) |
protected void |
assertValidValuesCountInCollection(java.lang.String collection,
int row,
java.lang.String name,
int count) |
protected void |
assertValidValuesInCollection(java.lang.String collection,
int row,
java.lang.String name,
java.lang.String[][] values) |
protected void |
assertValue(java.lang.String name,
java.lang.String value) |
protected void |
assertValue(java.lang.String model,
java.lang.String name,
java.lang.String value) |
protected void |
assertValueIgnoringCase(java.lang.String name,
java.lang.String value) |
protected void |
assertValueInCollection(java.lang.String collection,
int row,
int column,
java.lang.String value) |
protected void |
assertValueInCollection(java.lang.String collection,
int row,
java.lang.String name,
java.lang.String value) |
protected void |
assertValueInCollectionIgnoringCase(java.lang.String collection,
int row,
int column,
java.lang.String value) |
protected void |
assertValueInList(int row,
int column,
java.lang.String value) |
protected void |
assertValueInList(int row,
java.lang.String value) |
protected void |
assertValueInList(int row,
java.lang.String name,
java.lang.String value) |
protected void |
assertValues(java.lang.String name,
java.lang.String[] values)
For multiple values property.
|
protected void |
assertValuesInList(int row,
java.lang.String... values) |
protected void |
assertWarning(java.lang.String message) |
protected void |
assertWarningsCount(int expectedCount) |
protected void |
changeModule(java.lang.String module) |
protected void |
changeModule(java.lang.String application,
java.lang.String module) |
protected void |
checkAll() |
protected void |
checkAllCollection(java.lang.String collection) |
protected void |
checkRow(int row) |
protected void |
checkRow(java.lang.String id,
java.lang.String value) |
protected void |
checkRowCollection(java.lang.String collection,
int row) |
protected void |
clearCondition() |
protected void |
closeDialog() |
protected java.lang.String |
decorateId(java.lang.String name)
Decorate the name to produced an unique identifier as the used by
OX for HTML elements.
|
protected void |
execute(java.lang.String action)
Execute the action clicking in the link or button.
|
protected void |
execute(java.lang.String action,
java.lang.String arguments) |
protected void |
executeClicking(java.lang.String action,
java.lang.String arguments)
Executes an action simulating a real click in the button or link.
|
protected void |
executeDefaultAction() |
protected boolean |
existsAction(java.lang.String action) |
protected BrowserVersion |
getBrowserVersion()
The browser emulation used for the test.
|
protected int |
getCollectionColumnCount(java.lang.String collection) |
protected int |
getCollectionRowCount(java.lang.String collection)
Row count displayed with data.
|
protected java.lang.String |
getContextPath() |
protected java.lang.String |
getDescriptionValue(java.lang.String name)
In the case of combo (descriptionsEditor.jsp) (or his read only version)
the value that is visualized to user.
|
protected java.lang.String |
getDiscussionCommentContentText(java.lang.String name,
int row)
Get the content of a comment of DISCUSSION property as text,
just the content of the comment excluding header data.
|
protected java.lang.String |
getDiscussionCommentText(java.lang.String name,
int row)
Get the content of a comment of DISCUSSION property as text,
including header data like user and date.
|
protected HtmlForm |
getForm()
Current HtmlForm (of HtmlUnit).
|
protected static java.lang.String |
getHost() |
protected java.lang.String |
getHtml()
Current HTML code.
|
protected HtmlPage |
getHtmlPage()
This allows you testing using HtmlUnit APIs directly.
|
protected java.lang.String[] |
getKeysValidValues(java.lang.String name) |
protected java.lang.String |
getLabel(java.lang.String name) |
protected static java.lang.String |
getLiferayURL() |
protected int |
getListColumnCount() |
protected int |
getListRowCount()
Rows count displayed with data.
|
protected java.lang.String |
getLocale() |
protected java.lang.String |
getMessage()
The first message
|
protected java.lang.String |
getModuleURL() |
protected java.io.InputStream |
getPopupContentAsStream()
The content of the response for popup window.
|
protected java.lang.String |
getPopupPDFAsText()
The content of the PDF in the popup window as text.
|
protected java.lang.String |
getPopupPDFLine(int lineNumber)
The specified line as text of PDF in the popup window.
|
protected int |
getPopupPDFLinesCount()
The count of lines of the PDF in the popup window.
|
protected int |
getPopupPDFPageCount()
Number of pages of the PDF in the popup window
|
protected java.lang.String |
getPopupText()
The text of the response for popup window.
|
protected static java.lang.String |
getPort() |
protected java.lang.String |
getText()
The text of the response.
|
protected java.lang.String |
getValue(java.lang.String name) |
protected java.lang.String |
getValue(java.lang.String model,
java.lang.String name)
Deprecated.
The model is automatically deduced, so you can use just getValue(String name)
|
protected java.lang.String |
getValueInCollection(java.lang.String collection,
int row,
int column) |
protected java.lang.String |
getValueInCollection(java.lang.String collection,
int row,
java.lang.String name) |
protected java.lang.String |
getValueInList(int row) |
protected java.lang.String |
getValueInList(int row,
int column) |
protected java.lang.String |
getValueInList(int row,
java.lang.String name) |
protected java.lang.String[] |
getValues(java.lang.String name)
For properties with multiple values
|
protected WebClient |
getWebClient()
This allows you testing using HtmlUnit APIs directly.
|
static java.lang.String |
getXavaJUnitProperty(java.lang.String id)
From file xava-junit.properties
|
static java.lang.String |
getXavaJUnitProperty(java.lang.String id,
java.lang.String defaultValue)
From file xava-junit.properties
|
protected static boolean |
isJetspeed2Enabled() |
protected static boolean |
isLiferayEnabled() |
protected static boolean |
isPortalEnabled()
Jetspeed2 or Liferay
|
protected void |
login(java.lang.String user,
java.lang.String password) |
protected void |
logout()
User logout.
|
protected void |
moveRow(java.lang.String collection,
int from,
int to)
Move an element of collection from a row to another.
|
protected void |
moveRow(java.lang.String collection,
int from,
int to,
boolean classRequired)
Move an element of collection from a row to another.
|
protected void |
postDiscussionComment(java.lang.String name,
java.lang.String commentContent)
Post a new comment into a DISCUSSION property.
|
protected void |
printHtml()
Only for debug.
|
protected void |
printPopupPDFAsText()
Only for debug.
|
protected void |
reload()
Like clicking on the reload button of the browser.
|
protected void |
removeFile(java.lang.String property)
Remove the current file from a property with an upload editor.
|
protected void |
removeFile(java.lang.String property,
int index)
Remove a file from a property with an upload multiple editor.
|
protected void |
resetModule()
Like close navigator, open again, and reexecute the module.
|
protected void |
selectGroupBy(java.lang.String title) |
protected void |
selectListConfiguration(java.lang.String title) |
protected void |
selectModuleInPage(java.lang.String module) |
protected void |
setConditionComparators(java.util.List values)
To be used from Groovy, that does not work with setConditionComparators(String ... values).
|
protected void |
setConditionComparators(java.lang.String... values) |
protected void |
setConditionComparators(java.lang.String collection,
java.lang.String[] values) |
protected void |
setConditionValues(java.util.List values)
To be used from Groovy, that does not work with setConditionValues(String ... values).
|
protected void |
setConditionValues(java.lang.String... values) |
protected void |
setConditionValues(java.lang.String collection,
java.lang.String[] values) |
protected void |
setConditionValuesTo(java.lang.String... values) |
protected void |
setFileValue(java.lang.String name,
java.lang.String filePath) |
protected void |
setLocale(java.lang.String locale) |
protected void |
setModel(java.lang.String defaultModel)
Deprecated.
Now the model is deduced automatically
|
protected void |
setModelToModuleSetting()
Deprecated.
Now this is done automatically
|
protected void |
setUp() |
protected void |
setValue(java.lang.String name,
java.lang.String value) |
protected void |
setValue(java.lang.String model,
java.lang.String name,
java.lang.String value)
Deprecated.
Now model is deduced automatically, so you can use setValue(String model, String value)
|
protected void |
setValueInCollection(java.lang.String collection,
int row,
int column,
java.lang.String value) |
protected void |
setValueInCollection(java.lang.String collection,
int row,
java.lang.String name,
java.lang.String value) |
protected void |
setValueNotNotify(java.lang.String name,
java.lang.String value) |
protected void |
setValues(java.lang.String name,
java.lang.String[] values)
For multiple values properties
|
protected void |
tearDown() |
protected java.lang.String |
toKeyString(java.lang.Object pojo)
Returns a string representations of the key of a POJO
from the POJO itself.
|
protected void |
uncheckAll() |
protected void |
uncheckAllCollection(java.lang.String collection) |
protected void |
uncheckRow(int row) |
protected void |
uncheckRowCollection(java.lang.String collection,
int row) |
protected void |
uploadFile(java.lang.String property,
java.lang.String fileURL)
Upload a file in a property with an upload editor.
|
protected boolean |
usesAnnotatedPOJO()
The business component of the tested module can be defined
using a annotated POJO or an XML file.
|
protected void |
waitAJAX()
Wait until the current AJAX request is done and update the page if needed.
|
public ModuleTestBase(java.lang.String nameTest, java.lang.String application, java.lang.String module)
You can send null
for null
in such a case you
must use changeModule(java.lang.String)
at the very first of your test methods.
public ModuleTestBase(java.lang.String nameTest, java.lang.String module)
In this case the application is obtained from the application
property in xava-junit.properties
file.
You can send null
for null
in such a case you
must use changeModule(java.lang.String)
at the very first of your test methods.
protected void setUp() throws java.lang.Exception
java.lang.Exception
protected void tearDown() throws java.lang.Exception
java.lang.Exception
protected void login(java.lang.String user, java.lang.String password) throws java.lang.Exception
java.lang.Exception
protected boolean usesAnnotatedPOJO()
protected void logout() throws java.lang.Exception
At the moment only works against Liferay, JetSpeed2 and NaviOX.
java.lang.Exception
protected void resetModule() throws java.lang.Exception
java.lang.Exception
protected BrowserVersion getBrowserVersion() throws java.lang.Exception
If you overwrite this method maybe some methods of ModuleTestBase
would not work correctly. Usually you overwrite it to test using
directly the HtmlUnit API.
The use of this method is discouraged because binds your test
to a HTML implementation.
Before to use this method look for another more abstract method
in this class.
java.lang.Exception
protected void reload() throws java.lang.Exception
java.lang.Exception
protected void selectModuleInPage(java.lang.String module) throws java.lang.Exception
java.lang.Exception
protected void changeModule(java.lang.String module) throws java.lang.Exception
java.lang.Exception
protected void changeModule(java.lang.String application, java.lang.String module) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getModuleURL() throws XavaException
XavaException
protected void setModel(java.lang.String defaultModel)
By default is the model of module. The effect of the this setting is only for the life of one test.
protected void setModelToModuleSetting()
This is the default setting, hence this method is called to restore the original setting.
protected void execute(java.lang.String action) throws java.lang.Exception
java.lang.Exception
protected void waitAJAX() throws java.lang.Exception
Usually is only needed to call this method when you use directly HtmlUnit APIs.
java.lang.Exception
protected java.lang.String decorateId(java.lang.String name)
protected void assertFocusOn(java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected void execute(java.lang.String action, java.lang.String arguments) throws java.lang.Exception
java.lang.Exception
protected void executeClicking(java.lang.String action, java.lang.String arguments) throws java.lang.Exception
In addition to execute the action this method throws the corresponding
events of clicking the real link, like the focus lost of the current
editor, for example.
Why does not the plain execute() method work in this way by default?
Because simulating the click does not work in all cases, because a bug of HtmlUnit.
So you have to use execute() instead of executeClicking() for most case, and use
executeClicking() when the events produced by the button click would be important
for the test.
java.lang.Exception
protected void executeDefaultAction() throws java.lang.Exception
java.lang.Exception
protected void assertExists(java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected void assertNotExists(java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getDescriptionValue(java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getValue(java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected java.lang.String[] getValues(java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getLabel(java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getValue(java.lang.String model, java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected void printHtml() throws java.lang.Exception
java.lang.Exception
protected void assertContentType(java.lang.String type)
type
- text/html, application/pdf, etc.protected void assertContentTypeForPopup(int popup, java.lang.String type)
popup
- The window numbertype
- text/html, application/pdf, etc.protected void assertContentTypeForPopup(java.lang.String type)
type
- text/html, application/pdf, etc.protected void assertPopupCount(int count) throws java.lang.Exception
java.lang.Exception
protected void assertNoPopup() throws java.lang.Exception
java.lang.Exception
protected java.lang.String getHtml() throws java.lang.Exception
It is not very advisable because this will cause dependency to HTML and it will be difficult migrate to another presentation technology.
java.lang.Exception
protected java.lang.String getText() throws java.io.IOException
java.io.IOException
protected java.lang.String getPopupText() throws java.lang.Exception
java.lang.Exception
protected java.io.InputStream getPopupContentAsStream() throws java.lang.Exception
java.lang.Exception
protected java.lang.String getPopupPDFAsText() throws java.lang.Exception
java.lang.Exception
protected void printPopupPDFAsText() throws java.lang.Exception
java.lang.Exception
protected int getPopupPDFPageCount() throws java.lang.Exception
java.lang.Exception
protected java.lang.String getPopupPDFLine(int lineNumber) throws java.lang.Exception
java.lang.Exception
protected void assertPopupPDFLine(int lineNumber, java.lang.String expectedContent) throws java.lang.Exception
java.lang.Exception
protected void assertPopupPDFLinesCount(int expectedCount) throws java.lang.Exception
java.lang.Exception
protected int getPopupPDFLinesCount() throws java.lang.Exception
java.lang.Exception
protected void setConditionValues(java.lang.String... values) throws java.lang.Exception
Varargs
- since 4m5.java.lang.Exception
protected void setConditionValuesTo(java.lang.String... values) throws java.lang.Exception
java.lang.Exception
protected void setConditionValues(java.util.List values) throws java.lang.Exception
java.lang.Exception
protected void setConditionComparators(java.util.List values) throws java.lang.Exception
java.lang.Exception
protected void clearCondition() throws java.lang.Exception
java.lang.Exception
protected void setConditionComparators(java.lang.String... values) throws java.lang.Exception
values
- varargs since 4m5java.lang.Exception
protected void setConditionValues(java.lang.String collection, java.lang.String[] values) throws java.lang.Exception
java.lang.Exception
protected void setConditionComparators(java.lang.String collection, java.lang.String[] values) throws java.lang.Exception
java.lang.Exception
protected void setValueNotNotify(java.lang.String name, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected void setValue(java.lang.String name, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected void setValues(java.lang.String name, java.lang.String[] values) throws java.lang.Exception
java.lang.Exception
protected void setFileValue(java.lang.String name, java.lang.String filePath) throws java.lang.Exception
java.lang.Exception
protected void setValue(java.lang.String model, java.lang.String name, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected void assertLabel(java.lang.String name, java.lang.String expectedLabel) throws java.lang.Exception
java.lang.Exception
protected void assertLabel(int sectionIndex, java.lang.String expectedLabel) throws java.lang.Exception
java.lang.Exception
protected void assertNoLabel(java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected void assertValue(java.lang.String name, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected void assertValues(java.lang.String name, java.lang.String[] values) throws java.lang.Exception
java.lang.Exception
protected void assertValueIgnoringCase(java.lang.String name, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected void assertValue(java.lang.String model, java.lang.String name, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected void assertDescriptionValue(java.lang.String name, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected boolean existsAction(java.lang.String action) throws java.lang.Exception
java.lang.Exception
protected void assertAction(java.lang.String action) throws java.lang.Exception
java.lang.Exception
protected void assertAction(java.lang.String action, java.lang.String arguments) throws java.lang.Exception
java.lang.Exception
protected void assertNoAction(java.lang.String action) throws java.lang.Exception
java.lang.Exception
protected void assertNoAction(java.lang.String action, java.lang.String arguments) throws java.lang.Exception
java.lang.Exception
protected void assertActions(java.lang.String[] expectedActions) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getValueInList(int row, java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getValueInList(int row, int column) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getValueInList(int row) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getValueInCollection(java.lang.String collection, int row, java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected void setValueInCollection(java.lang.String collection, int row, java.lang.String name, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected void setValueInCollection(java.lang.String collection, int row, int column, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getValueInCollection(java.lang.String collection, int row, int column) throws java.lang.Exception
java.lang.Exception
protected void assertRowStyleInList(int row, java.lang.String expectedStyle) throws java.lang.Exception
java.lang.Exception
protected void assertRowStyleInCollection(java.lang.String collection, int row, java.lang.String expectedStyle) throws java.lang.Exception
java.lang.Exception
protected void assertNoRowStyleInList(int row) throws java.lang.Exception
java.lang.Exception
protected void assertNoRowStyleInCollection(java.lang.String collection, int row) throws java.lang.Exception
java.lang.Exception
protected boolean _collectionHasFilterHeader(java.lang.String collection) throws java.lang.Exception
java.lang.Exception
protected int getListRowCount() throws java.lang.Exception
Exclude heading and footing, and the not displayed data (maybe in cache).
java.lang.Exception
protected int getListColumnCount() throws java.lang.Exception
java.lang.Exception
protected int getCollectionColumnCount(java.lang.String collection) throws java.lang.Exception
java.lang.Exception
protected int getCollectionRowCount(java.lang.String collection) throws java.lang.Exception
Excludes heading and footing, and not displayed data (but cached).
java.lang.Exception
protected void assertCollectionRowCount(java.lang.String collection, int expectedCount) throws java.lang.Exception
Excludes heading and footing, and not displayed data (but cached).
java.lang.Exception
protected void assertListRowCount(int expected) throws java.lang.Exception
Exclude headers and footing, and the not displayed data (maybe cached).
java.lang.Exception
protected void assertListColumnCount(int expected) throws java.lang.Exception
java.lang.Exception
protected void assertCollectionColumnCount(java.lang.String collection, int expected) throws java.lang.Exception
java.lang.Exception
protected void assertValueInList(int row, java.lang.String name, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected void assertValueInList(int row, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected void assertValuesInList(int row, java.lang.String... values) throws java.lang.Exception
java.lang.Exception
protected void assertValueInList(int row, int column, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected void assertValueInCollection(java.lang.String collection, int row, java.lang.String name, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected void assertValueInCollection(java.lang.String collection, int row, int column, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected void assertValueInCollectionIgnoringCase(java.lang.String collection, int row, int column, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected void assertLabelInCollection(java.lang.String collection, int column, java.lang.String label) throws java.lang.Exception
java.lang.Exception
protected void assertLabelInList(int column, java.lang.String label) throws java.lang.Exception
java.lang.Exception
protected void assertTotalInList(int column, java.lang.String total) throws java.lang.Exception
java.lang.Exception
protected void assertTotalInList(java.lang.String name, java.lang.String total) throws java.lang.Exception
java.lang.Exception
protected void assertTotalInCollection(java.lang.String collection, int column, java.lang.String total) throws java.lang.Exception
java.lang.Exception
protected void assertTotalInCollection(java.lang.String collection, int row, int column, java.lang.String total) throws java.lang.Exception
java.lang.Exception
protected void assertTotalInCollection(java.lang.String collection, java.lang.String name, java.lang.String total) throws java.lang.Exception
java.lang.Exception
protected void assertTotalInCollection(java.lang.String collection, int row, java.lang.String name, java.lang.String total) throws java.lang.Exception
java.lang.Exception
protected void checkRow(int row) throws java.lang.Exception
java.lang.Exception
protected void checkAll() throws java.lang.Exception
java.lang.Exception
protected void uncheckRow(int row) throws java.lang.Exception
java.lang.Exception
protected void uncheckAll() throws java.lang.Exception
java.lang.Exception
protected void checkRowCollection(java.lang.String collection, int row) throws java.lang.Exception
java.lang.Exception
protected void checkAllCollection(java.lang.String collection) throws java.lang.Exception
java.lang.Exception
protected void uncheckAllCollection(java.lang.String collection) throws java.lang.Exception
java.lang.Exception
protected void uncheckRowCollection(java.lang.String collection, int row) throws java.lang.Exception
java.lang.Exception
protected void checkRow(java.lang.String id, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected void assertRowChecked(int row)
protected void assertAllChecked()
protected void assertRowCollectionChecked(java.lang.String collection, int row) throws java.lang.Exception
java.lang.Exception
protected void assertAllCollectionChecked(java.lang.String collection) throws java.lang.Exception
java.lang.Exception
protected void assertRowsChecked(int f1, int f2)
protected void assertRowsChecked(int[] rows)
protected void assertRowUnchecked(int row)
protected void assertAllUnchecked()
protected void assertRowCollectionUnchecked(java.lang.String collection, int row) throws java.lang.Exception
java.lang.Exception
protected void assertAllCollectionUnchecked(java.lang.String collection) throws java.lang.Exception
java.lang.Exception
protected void assertError(java.lang.String message) throws java.lang.Exception
java.lang.Exception
protected void assertMessage(java.lang.String message) throws java.lang.Exception
java.lang.Exception
protected void assertInfo(java.lang.String message) throws java.lang.Exception
java.lang.Exception
protected void assertWarning(java.lang.String message) throws java.lang.Exception
java.lang.Exception
protected void assertErrorsCount(int expectedCount) throws java.lang.Exception
java.lang.Exception
protected void assertMessagesCount(int expectedCount) throws java.lang.Exception
java.lang.Exception
protected void assertInfosCount(int expectedCount) throws java.lang.Exception
java.lang.Exception
protected void assertWarningsCount(int expectedCount) throws java.lang.Exception
java.lang.Exception
protected void assertNoError(java.lang.String message) throws java.lang.Exception
java.lang.Exception
protected void assertNoMessage(java.lang.String message) throws java.lang.Exception
java.lang.Exception
protected void assertNoInfo(java.lang.String message) throws java.lang.Exception
java.lang.Exception
protected void assertNoWarning(java.lang.String message) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getMessage() throws java.lang.Exception
java.lang.Exception
protected void assertNoErrors() throws java.lang.Exception
java.lang.Exception
protected void assertNoMessages() throws java.lang.Exception
java.lang.Exception
protected void assertNoWarnings() throws java.lang.Exception
java.lang.Exception
protected void assertNoInfos() throws java.lang.Exception
java.lang.Exception
protected void assertValidValuesInCollection(java.lang.String collection, int row, java.lang.String name, java.lang.String[][] values) throws java.lang.Exception
java.lang.Exception
protected void assertValidValuesCountInCollection(java.lang.String collection, int row, java.lang.String name, int count) throws java.lang.Exception
java.lang.Exception
protected void assertValidValueNotExists(java.lang.String name, java.lang.String key) throws java.lang.Exception
java.lang.Exception
protected void assertValidValues(java.lang.String name, java.lang.String[][] values) throws java.lang.Exception
java.lang.Exception
protected void assertValidValuesCount(java.lang.String name, int count) throws java.lang.Exception
java.lang.Exception
protected java.lang.String[] getKeysValidValues(java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected void assertEditable(java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected void assertNoEditable(java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected void assertEditableInCollection(java.lang.String collection, int row, java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected void assertNoEditableInCollection(java.lang.String collection, int row, java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected void assertEditableInCollection(java.lang.String collection, int row, int column) throws java.lang.Exception
java.lang.Exception
protected void assertNoEditableInCollection(java.lang.String collection, int row, int column) throws java.lang.Exception
java.lang.Exception
protected void assertListTitle(java.lang.String expectedTitle) throws java.lang.Exception
java.lang.Exception
protected void assertNoListTitle() throws java.lang.Exception
java.lang.Exception
protected void assertListNotEmpty() throws java.lang.Exception
java.lang.Exception
protected void assertCollectionNotEmpty(java.lang.String collection) throws java.lang.Exception
java.lang.Exception
protected void assertValidValueExists(java.lang.String name, java.lang.String key, java.lang.String description) throws java.lang.Exception
java.lang.Exception
protected static java.lang.String getPort()
protected static java.lang.String getHost()
protected java.lang.String getContextPath()
protected static boolean isJetspeed2Enabled()
protected static boolean isLiferayEnabled()
protected static boolean isPortalEnabled()
protected static java.lang.String getLiferayURL()
public static java.lang.String getXavaJUnitProperty(java.lang.String id)
public static java.lang.String getXavaJUnitProperty(java.lang.String id, java.lang.String defaultValue)
protected HtmlForm getForm()
This allow you to access directly to html form elements, but it is not very advisable because this will cause dependency to HTML and HtmlUnit so it will be difficult migrate to another presentation technology.
protected WebClient getWebClient()
The use of this method is discoraged because binds your test
to a HTML implementation.
Before to use this method look for another more abstract method
in this class.
By default CSS is disabled for performance,
if you need that CSS works for your test, write this line:
getWebClient().setCssEnabled(true);
protected java.lang.String getLocale()
protected void setLocale(java.lang.String locale) throws java.lang.Exception
java.lang.Exception
protected java.lang.String toKeyString(java.lang.Object pojo) throws java.lang.Exception
Useful for obtaining the value to put into a combo (a descriptions list)
from a POJO object.
java.lang.Exception
protected void assertNotEquals(java.lang.String msg, java.lang.String value1, java.lang.String value2)
protected void assertDialog() throws java.lang.Exception
java.lang.Exception
protected void assertNoDialog() throws java.lang.Exception
java.lang.Exception
protected void closeDialog() throws java.lang.Exception
java.lang.Exception
protected void assertDialogTitle(java.lang.String expectedTitle) throws java.lang.Exception
java.lang.Exception
protected HtmlPage getHtmlPage()
The use of this method is discouraged because binds your test to a HTML implementation. Before to use this method look for another more abstract method in this class.
protected void assertDiscussionCommentText(java.lang.String name, int row, java.lang.String extendedText)
protected java.lang.String getDiscussionCommentText(java.lang.String name, int row)
protected java.lang.String getDiscussionCommentContentText(java.lang.String name, int row)
protected void assertDiscussionCommentContentText(java.lang.String name, int row, java.lang.String expectedText)
protected void assertDiscussionCommentsCount(java.lang.String name, int expectedCount)
protected void postDiscussionComment(java.lang.String name, java.lang.String commentContent) throws java.lang.Exception
java.lang.Exception
protected void selectListConfiguration(java.lang.String title) throws java.lang.Exception
java.lang.Exception
protected void assertListSelectedConfiguration(java.lang.String expectedTitle)
protected void assertListAllConfigurations(java.lang.String... expectedTitles) throws java.lang.Exception
java.lang.Exception
protected void selectGroupBy(java.lang.String title) throws java.lang.Exception
java.lang.Exception
protected void assertAllGroupBys(java.lang.String... expectedTitles) throws java.lang.Exception
java.lang.Exception
protected void assertFile(java.lang.String property, java.lang.String contentType) throws java.lang.Exception
assertFile("photo", "image");It tries to recover the file from the server and verify if it is of contentType.
property
- The property name of the current view with an upload editorcontentType
- The content type, such as image, image/png, text/html, etc.java.lang.Exception
protected void assertFile(java.lang.String property) throws java.lang.Exception
assertFile("photo");It tries to recover the file from the server.
property
- The property name of the current view with an upload editorjava.lang.Exception
protected void assertFile(java.lang.String property, int index, java.lang.String expectedType) throws java.lang.Exception
assertFile("attachments", 2, "text/html");It tries to recover the file from the server and verify if it is of contentType.
property
- The property name of the current view with an upload editorindex
- Position of the filecontentType
- The content type, such as image, image/png, text/html, etc.java.lang.Exception
protected void assertNoFile(java.lang.String property) throws java.lang.Exception
assertNoFile("photo");
property
- The property name of the current view with an upload editorjava.lang.Exception
protected void uploadFile(java.lang.String property, java.lang.String fileURL) throws java.lang.Exception
uploadFile("photo", "test-images/cake.gif");
property
- The property name of the current view with an upload editorfileURL
- If the URL is relative it starts from the current project, if it is absolute (starts with /) it is used 'as is'.java.lang.Exception
protected void removeFile(java.lang.String property) throws java.lang.Exception
removeFile("photo");It's like clicking in the X button of the file, if the file is actually deleted from database depends on the concrete editor.
property
- The property name of the current view with an upload editorjava.lang.Exception
protected void assertFilesCount(java.lang.String property, int expectedCount) throws java.lang.Exception
assertFilesCount("screenshots", 5);
property
- The property name of the current view with an upload multiple editorexpectedCount
- The expected number of filesjava.lang.Exception
protected void removeFile(java.lang.String property, int index) throws java.lang.Exception
removeFile("screenshots", 2);It's like clicking in the X button of the file, if the file is actually deleted from database depends on the concrete editor.
property
- The property name of the current view with an upload multiple editorindex
- The position (0 based) of the file to removejava.lang.Exception
protected void moveRow(java.lang.String collection, int from, int to) throws java.lang.Exception
It is for @OrderColumn collection where the user can reorder the rows with the mouse.
WARNING! This method does not work for all "from, to" combinations, so if it does not work
just try with other combination.
Example:
moveRow("details", 2, 0);
collection
- The name of the collectionfrom
- Index of the origin rowto
- Index of the target rowjava.lang.Exception
protected void moveRow(java.lang.String collection, int from, int to, boolean classRequired) throws java.lang.Exception
It is for @OrderColumn collection where the user can reorder the rows with the mouse.
WARNING! This method does not work for all "from, to" combinations, so if it does not work
just try with other combination.
Example:
moveRow("details", 2, 0);
collection
- The name of the collectionfrom
- Index of the origin rowto
- Index of the target rowclassRequired
- If true it verifies the CSS class of target row to assures it is sortablejava.lang.Exception