|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
net.sourceforge.jwebunit.junit.WebTestCase
com.atlassian.confluence.AbstractAtlassianWebTestCase
com.atlassian.confluence.AbstractConfluenceAcceptanceTest
public abstract class AbstractConfluenceAcceptanceTest
This super class provides Confluence specific functions useful in acceptance tests.
| Field Summary | |
|---|---|
protected AdminConsole |
adminConsole
|
protected java.lang.String |
adminToken
|
static java.lang.String |
ANONYMOUS_USER
|
protected static java.text.SimpleDateFormat |
BLOG_DATE_FORMAT
|
protected static java.lang.String |
BROWSE_MENU_LINK_ID
|
static java.lang.String |
context
|
protected static boolean |
CROWD_MODE
|
protected static boolean |
DB2_MODE
|
static int |
DEFAULT_MAX_ATTACHMENT_SIZE
|
protected java.util.List<java.io.File> |
filesToDelete
|
protected UploadablePlugin |
funcTestRpcPlugin
|
protected static boolean |
LDAP_MODE
|
protected org.apache.log4j.Logger |
log
|
protected MailServices |
mailServices
|
protected static int |
PAUSE_MILLIS
The length of time to pause between actions must be longer for some databases than others. |
protected static int |
PAUSE_MYSQL_MILLIS
|
protected PluginHelper |
pluginHelper
|
static RandomnessHandler |
RANDOM
|
protected ConfluenceRpc |
rpc
|
protected static java.lang.String |
RPCLOG_DEBUG
|
protected static java.lang.String |
RPCLOG_ERROR
|
protected static java.lang.String |
RPCLOG_INFO
|
protected static java.lang.String |
RPCLOG_SYSTEM_ERR
|
protected static java.lang.String |
RPCLOG_SYSTEM_OUT
|
protected static java.lang.String |
RPCLOG_WARN
|
protected static java.lang.String |
SMTP_SUBJECT_PREFIX
|
static int |
TCP_PORT_RANGE_END
|
static int |
TCP_PORT_RANGE_START
|
static User |
TEST_ADMIN
Encapsulates TEST_ADMIN_USERNAME and TEST_ADMIN_PASSWORD. |
static java.lang.String |
TEST_ADMIN_EMAIL
|
static java.lang.String |
TEST_ADMIN_FULLNAME
|
static java.lang.String |
TEST_ADMIN_PASSWORD
|
static java.lang.String |
TEST_ADMIN_USERNAME
|
static java.lang.String |
TEST_GEN_EMAIL1
|
static java.lang.String |
TEST_GEN_EMAIL2
|
static java.lang.String |
TEST_GEN_FULLNAME1
|
static java.lang.String |
TEST_GEN_FULLNAME2
|
static java.lang.String |
TEST_GEN_PASSWORD1
|
static java.lang.String |
TEST_GEN_PASSWORD2
|
static java.lang.String |
TEST_GEN_USERNAME1
|
static java.lang.String |
TEST_GEN_USERNAME2
|
protected static java.lang.String |
TEST_GROUP1
|
static Page |
TEST_PAGE
|
static Space |
TEST_SPACE
|
static Space |
TEST_SPACE2
|
static User |
TEST_USER1
|
static User |
TEST_USER2
|
static java.lang.String |
TESTMAILSERVER_HOSTNAME
|
static java.lang.String |
TESTMAILSERVER_NAME
|
static java.lang.String |
TESTPAGE_COMMENT
|
static java.lang.String |
TESTPAGE_CONTENT
|
static java.lang.String |
TESTPAGE_TITLE
|
static java.lang.String |
TESTSPACE_DESCRIPTION
|
static java.lang.String |
TESTSPACE_KEY
|
static java.lang.String |
TESTSPACE_TITLE
|
static java.lang.String |
TESTSPACE2_DESCRIPTION
|
static java.lang.String |
TESTSPACE2_KEY
|
static java.lang.String |
TESTSPACE2_TITLE
|
protected java.lang.String |
testUser2Token
|
protected java.lang.String |
testUserToken
|
protected UserManagementHelper |
userHelper
|
protected static java.lang.String |
VIEW_PERSONAL_SPACE_LINK
|
protected static boolean |
WATCHDOG_RESIN_MODE
|
protected org.apache.xmlrpc.XmlRpcClient |
xmlrpc
|
| Fields inherited from class com.atlassian.confluence.AbstractAtlassianWebTestCase |
|---|
SITE_TITLE_SUFFIX, TITLE_SEPARATOR |
| Fields inherited from class net.sourceforge.jwebunit.junit.WebTestCase |
|---|
tester |
| Constructor Summary | |
|---|---|
AbstractConfluenceAcceptanceTest()
|
|
AbstractConfluenceAcceptanceTest(java.lang.String testName)
|
|
| Method Summary | |
|---|---|
protected void |
addAnonymousPermissionsToSpace(java.lang.String spaceKey,
java.util.Vector permissions)
|
protected void |
addComment(java.lang.String spaceKey,
java.lang.String pageTitle,
java.lang.String comment)
Deprecated. Should use ViewContentBean.addComment() instead. |
protected void |
addCommentToBlogPost(java.lang.String spaceKey,
java.lang.String newsTitle,
java.lang.String comment)
|
protected void |
addPageComment(java.lang.String comment)
Deprecated. Should use ViewContentBean.addComment() instead. |
protected void |
addSpaceLabel(java.lang.String labelName)
|
protected void |
addUserToGroupViaHelper(java.lang.String token,
java.lang.String username,
java.lang.String groupname)
Adds the given user to a groupname |
protected ViewContentBean |
addWatchPage()
|
protected void |
assertImagePresent(java.lang.String imageName)
Provide our own implementation of WebTestCase.assertImagePresent(String, String) that asserts the image name with
a contains check rather than equals. |
void |
assertImageValid(java.lang.String imgSrc,
java.lang.String imgAlt)
We override the default implementation of this method as it has a bug when dealing with relative URLs Basically if we are on the page /display/blah.action and there is an image src with /images/blah.gif, the default implementation will verify that the img src matches but will attempt to request the image at the URL /display/images/blah.gif. |
protected void |
assertLoggedInAs(java.lang.String username)
|
protected void |
assertMailReceived()
|
protected void |
assertNoMailReceived()
|
protected void |
attachFile(java.io.File attachment,
java.lang.String comment)
Click the attach file link, attach a given file with a given comment and submit the attachment form. |
protected void |
attachFileWithName(java.lang.String fileName,
java.io.InputStream in,
java.lang.String contentType,
java.lang.String comment)
Click the attach file link, attach a given file with a given comment and submit the attachment form. |
java.lang.String |
chooseRandomBaseUrl()
Selects a baseurl from the available specified base urls. |
protected void |
cleanUp()
|
protected void |
createBlog(java.lang.String spaceKey,
java.lang.String title,
java.lang.String body)
|
protected void |
createGroup(java.lang.String group)
Create a group via the Web Interface. |
protected void |
createGroupViaHelper(java.lang.String token,
java.lang.String groupName)
Creates a group with the given name |
protected void |
createMail(java.io.File mail,
java.lang.String spaceKey)
|
protected ViewContentBean |
createPage(java.lang.String spaceKey,
java.lang.String title,
java.lang.String content,
java.lang.String parentPageTitle)
|
protected ViewContentBean |
createPageWithViewRestrictions(java.lang.String spaceKey,
java.lang.String title,
java.lang.String content,
java.lang.String parentPageTitle,
java.lang.String viewPermissionUsers)
|
protected void |
createPersonalSpace(java.lang.String fullname)
|
protected void |
createPersonalSpaceForCurrentUser()
|
protected void |
createSpaceViaWebUi(Space space)
|
protected void |
createSpaceViaWebUI(java.lang.String key,
java.lang.String name,
java.lang.String description)
|
protected void |
createSpaceViaWebUI(java.lang.String key,
java.lang.String name,
java.lang.String description,
java.lang.String spaceGroupKey)
|
protected void |
createTemplate(java.lang.String spaceName,
java.lang.String templateTitle,
java.lang.String templateDescription,
java.lang.String templateContent)
|
protected void |
createTestGroupViaHelper(java.lang.String token)
Creates the test group via the XML-RPC interface |
protected void |
createTestMailServer()
|
protected void |
createTestSpaceViaWebUI()
For those times we need to ensure a space was created via the web UI (For example if the web UI may behave differently to RPC) |
protected void |
createTestUser1ViaHelper(java.lang.String token)
Creates the test user via the XML-RPC interface |
protected void |
createTestUser2ViaHelper(java.lang.String token)
Creates the 2nd test user via the XML-RPC interface |
protected void |
createUserViaHelper(java.lang.String token,
java.lang.String username,
java.lang.String password,
java.lang.String fullName,
java.lang.String email)
Creates a new user with the given details. |
protected void |
createUserViaHelper(java.lang.String token,
User user)
|
protected void |
disableAnonymousAccess()
|
protected void |
disableAnonymousAccessToSpace(java.lang.String spaceKey)
|
protected java.io.File |
downloadToTempFile(java.lang.String url)
|
protected void |
editBlogLabels(java.lang.String labels)
|
protected void |
editBlogPostContent(java.lang.String content)
|
protected void |
editPage(java.lang.String spaceKey,
java.lang.String pageTitle)
|
protected void |
editPageContent(java.lang.String content)
|
protected void |
editPageContent(java.lang.String content,
java.lang.String comment)
|
protected void |
editPageLabels(java.lang.String labels)
|
protected void |
editPageWithContent(java.lang.String spaceKey,
java.lang.String title,
java.lang.String content)
|
protected void |
editPageWithContent(java.lang.String spaceKey,
java.lang.String title,
java.lang.String content,
java.lang.String comment)
|
protected void |
editProfile(java.lang.String info)
|
void |
editProfile(java.lang.String fullName,
java.lang.String email,
java.lang.String aboutMe)
Edit the profile for the current user. |
protected void |
editSpacePermsForm()
|
protected void |
emptyTrash()
|
protected void |
enableAnonymousAccess()
|
protected void |
enableAnonymousAccessToSpace(java.lang.String spaceKey)
|
protected void |
ensureTestUserCanViewTestSpace()
|
protected void |
ensureUserCanViewSpace(java.lang.String user,
java.lang.String spaceTitle)
|
protected void |
forceViewGlobalAdmin()
|
protected java.lang.String |
generateBaseUrl()
|
protected java.io.File |
generateFile(java.lang.String filename,
java.lang.String contents)
|
protected java.lang.String |
getAppContext()
|
java.lang.String |
getBaseUrl()
|
protected java.lang.String |
getConfiguredBaseUrl()
Returns the configured base URL in the Confluence app. |
protected int |
getCurrentMailQueueSize()
|
protected EDU.oswego.cs.dl.util.concurrent.Latch |
getEventLatch(java.lang.String token,
java.lang.Class eventClass,
int timeout)
Create a Latch object that will be released when the event has been fired
OR when the timeout has elapsed. |
protected java.lang.String |
getFriendlyRelativeDate(java.util.Date now,
java.util.Date date,
TimeZone timeZone)
Use the FriendlyDateFormatter to format the date relative to the "now" time. |
protected long |
getPageId(java.lang.String spaceKey,
java.lang.String title)
|
static java.lang.String |
getTestProperty(java.lang.String propName)
|
static int |
getTestPropertyAsInt(java.lang.String propName)
|
static int |
getTestPropertyAsInt(java.lang.String propName,
int defaultValue)
|
protected Space |
getTestSpace()
|
protected java.lang.String |
getTodaysBlogPostDate()
|
protected java.util.Collection |
getUserGroups(java.lang.String username)
Return the groups to which the user belongs. |
protected void |
goToEditGeneralConfiguration()
|
protected void |
gotoPageWithError(java.lang.String url)
|
protected void |
grantAnonymousUseConfluencePermission()
|
protected void |
grantGlobalBrowsePermissionToGroup(java.lang.String groupName)
|
protected void |
grantGlobalPermissionToGroup(java.lang.String permissionType,
java.lang.String groupName)
|
protected void |
grantGlobalPermissionToUser(java.lang.String permissionType,
java.lang.String userName)
|
protected void |
grantSpacePermissionToGroup(java.lang.String spaceKey,
java.lang.String permissionType,
java.lang.String groupName)
Grant view space permissions and one other space permission to a specified group. |
protected void |
grantSpacePermissionToGroupAndDelegate(java.lang.String spaceKey,
java.lang.String permissionType,
java.lang.String groupName)
|
protected void |
grantSpacePermissionToUser(java.lang.String spaceKey,
java.lang.String permissionType,
java.lang.String userName)
Grant view space permissions and one other space permission to a specified user. |
protected void |
grantSpacePermissionToUserAndDelegate(java.lang.String spaceKey,
java.lang.String permissionType,
java.lang.String userName)
Grants space permissions to the user by delegating to the rpc equivalent. |
protected void |
grantViewSpacePermissionToGroup(java.lang.String spaceKey,
java.lang.String groupName)
|
protected void |
grantViewSpacePermissionToGroupAndDelegate(java.lang.String spaceKey,
java.lang.String groupName)
|
protected void |
grantViewSpacePermissionToUser(java.lang.String spaceKey,
java.lang.String username)
|
protected void |
importGlobalBackup(java.lang.String importZipLocation,
boolean waitForSuccess)
Perform a site import via the web ui. |
protected void |
importMail(java.lang.String filePath,
java.lang.String spaceKey)
Creates mails in the specified space. |
protected void |
importMailAndAssertNoRunningTask(java.lang.String filePath,
java.lang.String spaceKey)
Creates mails in the specified space and then checks if it successfully moved to the No Long Running Task page. |
protected void |
importSpaceBackup(java.lang.String importZipLocation,
boolean waitForSuccess)
Import an xml exported space from the classpath into Confluence via the web ui. |
protected boolean |
isClustered()
|
void |
logIn(User user,
java.lang.String destination)
Log in as the specified user, going to the provided URL (relative to the context path) after logging in. |
protected void |
logInAs(java.lang.String username,
java.lang.String password)
|
protected void |
logInAs(java.lang.String username,
java.lang.String password,
boolean fastMode,
boolean rememberMe)
|
protected void |
loginAs(User user)
|
protected void |
logInAsAdmin()
|
protected void |
logInAsAdminAtDashboard()
|
protected void |
logInAsAtDashboard(java.lang.String username,
java.lang.String password)
|
protected void |
loginAsAtDashboard(User user)
|
protected void |
loginAsTestUser()
|
protected void |
loginAsTestUser2()
|
protected void |
loginAsTestUserAtDashboard()
|
protected void |
loginViaForm(java.lang.String username,
java.lang.String password,
boolean rememberMe)
|
protected void |
logout()
|
static java.util.Vector<java.lang.Object> |
makeParams(java.lang.Object... params)
|
protected void |
movePage(java.lang.String spaceKey,
java.lang.String title,
java.lang.String newSpaceName,
boolean moveHierarchy)
|
protected void |
movePage(java.lang.String spaceKey,
java.lang.String title,
java.lang.String newSpaceName,
java.lang.String newParentPage)
|
protected void |
movePageToNewParent(java.lang.String spaceKey,
java.lang.String title,
java.lang.String newParentPage)
|
protected void |
movePageToNewParent(java.lang.String oldSpaceKey,
java.lang.String title,
java.lang.String newSpaceKey,
java.lang.String newParentPage)
|
protected void |
movePageToNewSpace(java.lang.String spaceKey,
java.lang.String title,
java.lang.String newSpaceKey)
|
protected void |
openInsertImagePopup()
Clicks the "Insert Image" button, if it exists, on the current page (expected to be the "Add" or "Edit" page) Focus will then be moved to the popup window |
protected void |
openInsertLinkPopup()
Clicks the "Insert Link" button, if it exists, on the current page (expected to be the "Add" or "Edit" page) Focus will then be moved to the popup window |
protected void |
pause(long milliseconds)
We use pause because mysql is not very good at distinguishing times that are close together. |
protected void |
removeAnonymousPermissionToSpace(java.lang.String spaceKey,
java.lang.String permission)
|
protected void |
removeBlog(java.lang.String spaceKey,
java.lang.String postDateString,
java.lang.String postTitle)
Deprecated. Use ViewContentBean.remove() instead. |
protected void |
removeGroup(java.lang.String groupName)
Delete a group via the Web Interface. |
protected void |
removePageOrBlogById(long id)
|
protected void |
removePersonalSpace(java.lang.String username)
|
protected void |
removeTestUser1()
Remove testUser1 via the Web Interface. |
protected void |
removeTestUser1ViaHelper(java.lang.String token)
Removes the test user |
protected void |
removeUser(java.lang.String username)
Remove a user via the Web Interface. |
protected void |
removeUserFromGroupViaHelper(java.lang.String token,
java.lang.String username,
java.lang.String groupname)
Removes the given user from the group |
protected void |
removeUserViaHelper(java.lang.String token,
java.lang.String username)
Removes a user with the given username |
protected void |
renamePage(java.lang.String spaceKey,
java.lang.String originalPageTitle,
java.lang.String newPageTitle)
|
protected void |
restoreBaseUrl()
Sets Confluence's baseUrl to whatever it is in the test properties. |
protected void |
revokeAnonymousUseConfluencePermission()
|
protected void |
revokeGlobalPermissionFromGroup(java.lang.String permissionType,
java.lang.String groupName)
Removes the specified global permission (from SpacePermission) from the given group name |
protected void |
revokeGlobalPermissionFromUser(java.lang.String permissionType,
User user)
Removes the specified global permission (from SpacePermission) from the given group name |
protected void |
revokeSpacePermissionFromGroup(java.lang.String spaceKey,
java.lang.String permissionType,
java.lang.String groupName)
Remove a space permission from a specified group. |
protected void |
revokeSpacePermissionFromUser(java.lang.String spaceKey,
java.lang.String permissionType,
java.lang.String userName)
Remove a space permission from a specified user. |
protected java.util.Hashtable |
rpcAddComment(java.lang.String token,
long pageId,
long parentCommentId,
java.lang.String comment)
Adds a comment to a page via the XML-RPC interface |
protected java.util.Hashtable |
rpcAddComment(java.lang.String token,
long pageId,
java.lang.String comment)
Adds a comment to a page via the XML-RPC interface |
protected java.util.Hashtable |
rpcAddComment(java.lang.String token,
java.lang.String spaceKey,
java.lang.String pageTitle,
java.lang.String comment)
Adds a comment to a page via the XML-RPC interface |
protected void |
rpcAddLabelToBlog(java.lang.String token,
java.lang.String label,
long blogId)
Adds a label to the blogpost with the given page ID |
protected void |
rpcAddLabelToPage(java.lang.String token,
java.lang.String label,
long pageId)
Adds a label to the Page with the given page ID |
protected void |
rpcAddLabelToPage(java.lang.String token,
java.lang.String label,
java.lang.String spaceKey,
java.lang.String pageTitle)
Adds a label to the Page with the given details This method retrieves the ID for the given Page and passes it onto the appropriate rpcAddLabelToPage method |
protected void |
rpcAddLabelToSpace(java.lang.String token,
java.lang.String label,
java.lang.String spaceKey)
Adds a label to a space |
protected java.lang.String |
rpcAddTestComment(java.lang.String token)
|
protected java.lang.String |
rpcChangeLogLevel(java.lang.String loggerName,
java.lang.String level)
Change the specified logger to a new level. |
protected void |
rpcConvertToPersonalSpace(java.lang.String token,
java.lang.String userName,
java.lang.String spaceKey,
java.lang.String newName,
boolean updateLinks)
|
protected long |
rpcCreateBlogPost(java.lang.String token,
java.lang.String spaceKey,
java.lang.String postTitle,
java.lang.String postContent)
Creates a new blog entry via the XML-RPC interface |
protected long |
rpcCreateBlogPost(java.lang.String token,
java.lang.String spaceKey,
java.lang.String postTitle,
java.lang.String postContent,
java.util.Date lastModification)
|
protected long |
rpcCreatePage(java.lang.String token,
java.lang.String spaceKey,
java.lang.String title,
java.lang.String content)
Creates a page via the XML-RPC interface |
protected long |
rpcCreatePage(java.lang.String token,
java.lang.String spaceKey,
java.lang.String title,
java.lang.String content,
long parentPageId)
Creates a page via the XML-RPC interface |
protected java.util.Hashtable |
rpcCreatePersonalSpace(java.lang.String token,
java.lang.String name,
java.lang.String description,
java.lang.String username)
Creates a personal space via the XML-RPC interface |
protected java.util.Hashtable |
rpcCreateSpace(java.lang.String token,
java.lang.String key,
java.lang.String name,
java.lang.String description)
&n |