|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
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 |
CONFLUNECE_ADMIN_GROUP
|
static java.lang.String |
CONFLUNECE_USERS_GROUP
|
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
|
static UploadablePlugin |
FUNCTEST_RPC_PLUGIN
|
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
|
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 |
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 EditContentBean |
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 |
editSpaceDescription(User user,
java.lang.String spaceKey,
java.lang.String newDescription)
|
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 |
rebuildIndex()
|
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 |
resetEmailMask()
|
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 |
rpcClearIndex()
|
protected void |
rpcClearQueue(java.lang.String token,
java.lang.String queueName)
|
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)
|
protected java.util.Hashtable |
rpcCreateSpace(java.lang.String token,
java.lang.String key,
java.lang.String name,
java.lang.String description,
java.lang.String spaceGroup)
Creates a space via the XML-RPC interface |
protected java.util.Hashtable |
rpcCreateSpaceGroup(java.lang.String token,
java.lang.String key,
java.lang.String name)
|
protected long |
rpcCreateTestPage(java.lang.String token)
Creates the test page in the test space via the XML-RPC interface |
protected java.util.Hashtable |
rpcCreateTestSpace(java.lang.String token)
Creates the test space via the XML-RPC interface This method first checks if the test space exists, and logs a message if it does |
protected java.util.Hashtable |
rpcCreateTestSpace2(java.lang.String token)
Creates the 2nd test space via the XML-RPC interface This method first checks if the test space exists, and logs a message if it does |
protected void |
rpcEditBlogPost(java.lang.String token,
long entryId,
java.lang.String newTitle,
java.lang.String newContent)
Modifies the page with the given details via the XML-RPC interface |
protected java.util.Hashtable |
rpcEditComment(java.lang.String token,
long pageId,
long commentId,
java.lang.String comment)
|
protected void |
rpcEditPage(java.lang.String token,
java.lang.String spaceKey,
java.lang.String pageTitle,
java.lang.String newTitle,
java.lang.String newContent)
Modifies the page with the given details via the XML-RPC interface |
protected void |
rpcFlushAllCaches(java.lang.String token)
Flush all the caches via rpc. |
protected void |
rpcFlushIndexQueue()
|
protected void |
rpcFlushMailQueue()
|
protected java.lang.String |
rpcGetAdminToken()
Retrieves a token for the admin user |
protected long |
rpcGetBlogPostId(java.lang.String token,
java.lang.String spaceKey,
int dayOfMonth,
java.lang.String postTitle)
Retrieves the ID of a blog post with the given details |
protected java.util.Vector |
rpcGetChildren(java.lang.String token,
long pageId)
Returns the ordered id list of pages that are direct children of a given page. |
protected java.util.Vector |
rpcGetComments(java.lang.String token,
java.lang.String pageId)
|
protected java.lang.String |
rpcGetLocalisedText(java.lang.String messageKey)
Returns the localised message text for the given key, retrieved from the application via RPC. |
protected int |
rpcGetMailQueueSize()
|
protected long |
rpcGetPageId(java.lang.String token,
java.lang.String spaceKey,
java.lang.String pageTitle)
Retrieves the page ID for a page with the given details |
protected java.util.List |
rpcGetPageLabels(java.lang.String token,
long pageId)
Retrieves the labels assigned to a Page with the given page ID |
protected java.util.List |
rpcGetPageLabels(java.lang.String token,
java.lang.String spaceKey,
java.lang.String pageTitle)
Retrieves the labels assigned to a page with the given details This method retrieves the page ID and passes it onto the appropriate rpcGetPageLabels method |
protected java.lang.String |
rpcGetTestUser2Token()
Retrieves a token for the test user 2 |
protected java.lang.String |
rpcGetTestUserToken()
Retrieves a token for the test user |
protected java.util.Vector |
rpcGetTopLevelPages(java.lang.String token,
java.lang.String spaceKey)
Returns the ordered id list of top-level pages in a given space. |
protected java.util.Vector |
rpcGetUserGroups(java.lang.String token,
java.lang.String username)
|
java.util.List |
rpcGetUsersForActivity(java.lang.String key)
|
protected java.lang.String |
rpcGetUserToken(java.lang.String username,
java.lang.String password)
Retrieves the user token for the given details, for use with the XML-RPC interface |
protected java.lang.String |
rpcGetUserToken(User user)
|
protected int |
rpcGetVersionForPage(java.lang.String token,
long pageId)
|
protected void |
rpcGrantAnonymousSpacePermission(java.lang.String token,
java.lang.String permission,
java.lang.String spaceKey)
Grants the given permission to the anonymous user for the given space |
protected void |
rpcGrantGlobalPermission(java.lang.String token,
java.lang.String permission,
java.lang.String entityName)
Grants the given global permission to a user. |
protected void |
rpcGrantSpacePermission(java.lang.String token,
java.lang.String permission,
java.lang.String username,
java.lang.String spaceKey)
Grants the given permission to a user for a particular Space |
protected void |
rpcGrantViewSpacePermission(java.lang.String token,
java.lang.String entityName,
java.lang.String spaceKey)
Convenience method for granting VIEWSPACE permission to a particular user |
protected boolean |
rpcHasGroup(java.lang.String token,
java.lang.String groupName)
|
protected boolean |
rpcHasUser(java.lang.String token,
java.lang.String username)
|
protected boolean |
rpcLog(java.lang.String destination,
java.lang.String message)
|
protected void |
rpclogCommandOutput(java.lang.String commandString)
|
protected void |
rpcLogOutAdmin()
|
protected void |
rpcMovePage(java.lang.String token,
long sourcePageId,
long targetPageId,
java.lang.String position)
Moves a page to a location relative to another page. |
protected void |
rpcMovePageToTopLevel(java.lang.String token,
long pageId,
java.lang.String targetSpaceKey)
Moves a page to the top of a given space. |
protected void |
rpcPauseJob(java.lang.String jobName)
|
protected void |
rpcRemoveAllSpaceGroups(java.lang.String token)
|
protected void |
rpcRemoveAnonymousSpacePermission(java.lang.String token,
java.lang.String permission,
java.lang.String spaceKey)
Removes the given permission for the anonymous user from the given space |
protected void |
rpcRemoveAttachment(java.lang.String token,
java.lang.String attachmentFileName,
long contentId)
Remove an attachment from a page or blog. |
protected void |
rpcRemoveComment(java.lang.String token,
long commentId)
Remove a comment, identified by its id. |
protected void |
rpcRemoveComment(java.lang.String token,
java.lang.String commentContent,
java.lang.String spaceKey,
java.lang.String pageTitle)
Remove a comment, identified by its location and content, from a page. |
protected void |
rpcRemoveGlobalPermissions(java.lang.String token,
java.lang.String permission,
java.lang.String username)
Removes the given global permission for a user |
protected void |
rpcRemoveGroup(java.lang.String token,
java.lang.String groupname)
Removes the given group |
protected void |
rpcRemoveLabelFromPage(java.lang.String token,
java.lang.String label,
long pageId)
Removes the given label from the page with the given page ID |
protected void |
rpcRemoveLabelFromPage(java.lang.String token,
java.lang.String label,
java.lang.String spaceKey,
java.lang.String pageTitle)
|
protected void |
rpcRemoveLabelFromSpace(java.lang.String token,
java.lang.String label,
java.lang.String spaceKey)
Removes a label from a space |
protected void |
rpcRemovePage(java.lang.String token,
java.lang.String spaceKey,
long pageId)
|
protected void |
rpcRemoveSpace(java.lang.String token,
java.lang.String spaceKey)
Remove a space with the given key via the XML-RPC interface |
protected void |
rpcRemoveSpacePermission(java.lang.String token,
java.lang.String permission,
java.lang.String username,
java.lang.String spaceKey)
Removes the given permission for a user for a particular Space |
protected void |
rpcRemoveUserUncleanly(java.lang.String token,
java.lang.String username)
Removes a user with the given username but do not remove their dependent permissions or pages. |
protected void |
rpcRenderContent(java.lang.String token,
java.lang.String spaceKey,
long pageId,
java.lang.String newContent)
|
protected void |
rpcRestoreAbstractPage(long id)
|
protected void |
rpcResumeJob(java.lang.String jobName)
|
void |
rpcStartActivity(java.lang.String key,
java.lang.String user)
|
protected java.util.Hashtable |
rpcStoreBlogEntry(java.lang.String token,
long pageId,
java.lang.String comment)
|
protected void |
rpcTrashPage(java.lang.String token,
long pageId)
Trashes (removes) a page with the given ID This method converts the long into a String and calls the appropriate rpcTrashPage method |
protected void |
rpcTrashPage(java.lang.String token,
java.lang.String pageId)
Trashes (removes) a page with the given ID |
protected void |
rpcTrashPage(java.lang.String token,
java.lang.String spaceKey,
java.lang.String pageTitle)
Trashes (removes) a page with the given details This method retrieves the page with the given details and calls the appropriate rpcTrashPage method |
protected void |
rpcTriggerJob(java.lang.String jobName)
|
protected void |
search(java.lang.String query)
|
protected void |
setAllowCamelCase(boolean allow)
|
protected void |
setAnonymousRemoteApi(boolean enabled)
|
protected void |
setAttachmentMaxUploadSize(long max)
|
protected void |
setDraftSaveInterval(long seconds)
|
protected void |
setEditPermissionsForGroups(java.lang.String spaceKey,
java.lang.String pageTitle,
java.lang.String groups)
Edit the permissions of the specified page as the current user. |
protected void |
setEditPermissionsForUsers(java.lang.String spaceKey,
java.lang.String pageTitle,
java.lang.String users)
Edit the permissions of the specified page as the current user. |
protected void |
setEmailMask(java.lang.String setting)
|
protected void |
setEnableWysiwyg(boolean enabled)
|
protected void |
setExternalUserManagement(boolean enabled)
|
void |
setHttpCompression(boolean compressHttp)
Set the Http Compression setting according to the given parameter. |
protected void |
setPageLabels(java.lang.String spaceKey,
java.lang.String pageTitle,
java.lang.String labels)
Add the specified label to the page via the pages edit view. |
protected void |
setPublicSignup(boolean enabled)
|
protected void |
setRemoteApi(boolean enabled)
|
protected void |
setSharedMode(boolean enable)
|
protected void |
setThreadedComments(boolean enable)
|
protected void |
setUp()
|
protected void |
setUp(java.lang.String beginAt)
Default setUp method. |
protected void |
setViewPermissionsForGroups(java.lang.String spaceKey,
java.lang.String pageTitle,
java.lang.String groups)
Edit the permissions of the specified page as the current user. |
protected void |
setViewPermissionsForUsers(java.lang.String spaceKey,
java.lang.String pageTitle,
java.lang.String users)
Edit the permissions of the specified page as the current user. |
protected void |
showAllUsers()
|
protected void |
shutdownQuartz()
|
protected void |
stopTestMailServer()
|
java.lang.String |
stripContext(java.lang.String context,
java.lang.String url)
This function takes a URL like /context/foo/bar/baz..., and the context, and returns foo/bar/baz |
protected void |
tearDown()
Default tearDown method. |
protected void |
viewAbstractPage(long entityId)
Views the page for a Page or BlogPost (AbstractPage) |
protected void |
viewBlog(java.lang.String spaceKey,
java.lang.String datePath,
java.lang.String title)
|
protected void |
viewEditBlogPostPage(long entryId)
Views the edit blog post page for the post with the given ID |
protected void |
viewGlobalAdmin()
|
protected void |
viewGlobalPermissions()
|
protected void |
viewHomepage()
|
protected void |
viewLabel(java.lang.String spaceKey,
java.lang.String labelName)
|
protected void |
viewLanguages()
|
protected ViewContentBean |
viewPage(java.lang.String spaceKey,
java.lang.String pageTitle)
|
void |
viewPeopleDirectory()
|
protected SpaceAdmin |
viewSpaceAdmin()
|
protected void |
viewSpaceAdvanced()
|
protected void |
viewSpaceContent()
|
protected void |
viewSpacePermissions(java.lang.String spaceKey)
|
protected void |
viewSpaceSummary()
|
protected void |
viewSpaceSummary(java.lang.String spaceKey)
|
protected void |
viewTodaysBlog(java.lang.String spaceKey,
java.lang.String title)
|
protected void |
viewTrash()
|
protected void |
viewUser(java.lang.String name)
|
protected boolean |
waitForLongRunningTaskToComplete(int timeout,
java.lang.String errorText)
Wait for the current long running task to complete. |
protected ViewContentBean |
watchPage(java.lang.String spaceKey,
java.lang.String pageTitle)
|
protected void |
watchSpace(java.lang.String spaceKey)
|
protected java.lang.Object |
xmlRpcExecute(java.lang.String method,
java.util.Vector params)
Wrapper for calling the xml rpc methods and handles the exceptions properly. |
Methods inherited from class net.sourceforge.jwebunit.junit.WebTestCase |
---|
assertButtonNotPresent, assertButtonNotPresentWithText, assertButtonPresent, assertButtonPresentWithText, assertCheckboxNotPresent, assertCheckboxNotPresent, assertCheckboxNotSelected, assertCheckboxNotSelected, assertCheckboxPresent, assertCheckboxPresent, assertCheckboxSelected, assertCheckboxSelected, assertCookiePresent, assertCookieValueEquals, assertCookieValueMatch, assertDownloadedFileEquals, assertElementNotPresent, assertElementPresent, assertFormElementEmpty, assertFormElementEquals, assertFormElementMatch, assertFormElementNotPresent, assertFormElementPresent, assertFormNotPresent, assertFormNotPresent, assertFormPresent, assertFormPresent, assertFramePresent, assertHiddenFieldPresent, assertImagePresent, assertImageValidAndStore, assertKeyInTable, assertKeyInTable, assertKeyNotInTable, assertKeyNotPresent, assertKeyNotPresent, assertKeyPresent, assertKeyPresent, assertKeysInTable, assertKeysInTable, assertLinkNotPresent, assertLinkNotPresentWithExactText, assertLinkNotPresentWithExactText, assertLinkNotPresentWithImage, assertLinkNotPresentWithText, assertLinkNotPresentWithText, assertLinkPresentWithExactText, assertLinkPresentWithExactText, assertLinkPresentWithText, assertMatch, assertMatchInElement, assertMatchInTable, assertMatchInTable, assertNoMatch, assertNoMatchInElement, assertNoMatchInTable, assertNoMatchInTable, assertRadioOptionNotPresent, assertRadioOptionNotSelected, assertRadioOptionPresent, assertRadioOptionSelected, assertResetButtonNotPresent, assertResetButtonNotPresent, assertResetButtonPresent, assertResetButtonPresent, assertSelectedOptionEquals, assertSelectedOptionMatches, assertSelectedOptionsEqual, assertSelectedOptionsMatch, assertSelectedOptionValueEquals, assertSelectedOptionValuesEqual, assertSelectOptionNotPresent, assertSelectOptionPresent, assertSelectOptionsEqual, assertSelectOptionsNotEqual, assertSelectOptionsPresent, assertSelectOptionValueNotPresent, assertSelectOptionValuePresent, assertSelectOptionValuesEqual, assertSelectOptionValuesNotEqual, assertSelectOptionValuesPresent, assertSubmitButtonNotPresent, assertSubmitButtonNotPresent, assertSubmitButtonPresent, assertSubmitButtonPresent, assertSubmitButtonPresent, assertTableEquals, assertTableEquals, assertTableMatch, assertTableMatch, assertTableNotPresent, assertTablePresent, assertTableRowCountEquals, assertTableRowsEqual, assertTableRowsEqual, assertTableRowsMatch, assertTableRowsMatch, assertTextFieldEquals, assertTextInElement, assertTextInTable, assertTextInTable, assertTextNotInElement, assertTextNotInTable, assertTextNotInTable, assertTextPresent, assertTitleEqualsKey, assertTitleEqualsKey, assertTitleMatch, assertWindowCountEquals, assertWindowPresent, assertWindowPresent, assertWindowPresentWithTitle, beginAt, checkCheckbox, checkCheckbox, clickButton, clickButtonWithText, clickElementByXPath, clickLink, clickLinkWithExactText, clickLinkWithExactText, clickLinkWithImage, clickLinkWithText, clickLinkWithText, clickRadioOption, closeBrowser, closeWindow, dumpCookies, dumpHtml, dumpHtml, dumpTable, dumpTable, getDialog, getElementAttributByXPath, getElementTextByXPath, getFormElementValue, getImage, getMessage, getMessage, getPageSource, getServeurResponse, getTable, getTestContext, getTester, getTestingEngineKey, gotoFrame, gotoPage, gotoRootWindow, gotoWindow, gotoWindow, gotoWindowByTitle, reset, runBare, saveAs, selectOption, selectOptionByValue, selectOptions, selectOptionsByValues, setDialog, setExpectedJavaScriptAlert, setExpectedJavaScriptAlert, setExpectedJavaScriptConfirm, setExpectedJavaScriptConfirm, setExpectedJavaScriptPrompt, setExpectedJavaScriptPrompt, setFormElement, setScriptingEnabled, setTestContext, setTestingEngineKey, setTextField, setWorkingForm, setWorkingForm, setWorkingForm, submit, submit, submit, uncheckCheckbox, uncheckCheckbox |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final transient org.apache.log4j.Logger log
protected static final java.lang.String RPCLOG_INFO
protected static final java.lang.String RPCLOG_DEBUG
protected static final java.lang.String RPCLOG_WARN
protected static final java.lang.String RPCLOG_ERROR
protected static final java.lang.String RPCLOG_SYSTEM_OUT
protected static final java.lang.String RPCLOG_SYSTEM_ERR
public static final java.lang.String context
protected static final boolean LDAP_MODE
protected static final boolean CROWD_MODE
protected static final boolean DB2_MODE
protected static final boolean WATCHDOG_RESIN_MODE
public static final java.lang.String TEST_ADMIN_USERNAME
public static final java.lang.String TEST_ADMIN_PASSWORD
public static final java.lang.String TEST_ADMIN_FULLNAME
public static final java.lang.String TEST_ADMIN_EMAIL
public static final User TEST_ADMIN
TEST_ADMIN_USERNAME
and TEST_ADMIN_PASSWORD
.
public static final java.lang.String ANONYMOUS_USER
public static final java.lang.String CONFLUNECE_USERS_GROUP
public static final java.lang.String CONFLUNECE_ADMIN_GROUP
public static final java.lang.String TEST_GEN_USERNAME1
public static final java.lang.String TEST_GEN_PASSWORD1
public static final java.lang.String TEST_GEN_FULLNAME1
public static final java.lang.String TEST_GEN_EMAIL1
public static final java.lang.String TEST_GEN_USERNAME2
public static final java.lang.String TEST_GEN_PASSWORD2
public static final java.lang.String TEST_GEN_FULLNAME2
public static final java.lang.String TEST_GEN_EMAIL2
protected static final java.lang.String TEST_GROUP1
public static final java.lang.String TESTSPACE_TITLE
public static final java.lang.String TESTSPACE_KEY
public static final java.lang.String TESTSPACE_DESCRIPTION
public static final java.lang.String TESTSPACE2_TITLE
public static final java.lang.String TESTSPACE2_KEY
public static final java.lang.String TESTSPACE2_DESCRIPTION
public static final java.lang.String TESTPAGE_TITLE
public static final java.lang.String TESTPAGE_CONTENT
public static final java.lang.String TESTPAGE_COMMENT
public static final User TEST_USER1
public static final User TEST_USER2
public static final Space TEST_SPACE
public static final Space TEST_SPACE2
public Page TEST_PAGE
public static final java.lang.String TESTMAILSERVER_NAME
public static final java.lang.String TESTMAILSERVER_HOSTNAME
public static final int TCP_PORT_RANGE_START
public static final int TCP_PORT_RANGE_END
public static final RandomnessHandler RANDOM
public static final int DEFAULT_MAX_ATTACHMENT_SIZE
public static final UploadablePlugin FUNCTEST_RPC_PLUGIN
protected static final int PAUSE_MILLIS
protected static final int PAUSE_MYSQL_MILLIS
protected static final java.text.SimpleDateFormat BLOG_DATE_FORMAT
protected static final java.lang.String BROWSE_MENU_LINK_ID
protected static final java.lang.String SMTP_SUBJECT_PREFIX
protected org.apache.xmlrpc.XmlRpcClient xmlrpc
protected ConfluenceRpc rpc
protected java.lang.String adminToken
protected java.lang.String testUserToken
protected java.lang.String testUser2Token
protected java.util.List<java.io.File> filesToDelete
protected PluginHelper pluginHelper
protected UserManagementHelper userHelper
protected MailServices mailServices
protected AdminConsole adminConsole
protected static final java.lang.String VIEW_PERSONAL_SPACE_LINK
Constructor Detail |
---|
public AbstractConfluenceAcceptanceTest(java.lang.String testName)
public AbstractConfluenceAcceptanceTest()
Method Detail |
---|
protected void setUp() throws java.lang.Exception
setUp
in class junit.framework.TestCase
java.lang.Exception
protected void setUp(java.lang.String beginAt) throws java.lang.Exception
beginAt
- the initial path (relative to the context path) to begin at
java.lang.Exception
- from superprotected void tearDown() throws java.lang.Exception
filesToDelete
list.
tearDown
in class AbstractAtlassianWebTestCase
java.lang.Exception
protected java.lang.String generateBaseUrl()
public java.lang.String chooseRandomBaseUrl()
RANDOM
which is created with a seed that is logged so that the tests may be reproduced by passing
a test property named "seed".
Note that the search for baseurls stops at the first number that isn't specified. Eg if baseurl4 is specified but baseurl3 is not specified, then baseurl4 will not be discovered.
protected java.lang.String getConfiguredBaseUrl()
protected void shutdownQuartz()
protected void cleanUp() throws java.lang.Exception
java.lang.Exception
protected void rpcPauseJob(java.lang.String jobName)
protected void rpcResumeJob(java.lang.String jobName)
protected void rpcTriggerJob(java.lang.String jobName)
protected void rpcFlushAllCaches(java.lang.String token) throws java.io.IOException, org.apache.xmlrpc.XmlRpcException
token
- of the user who is flushing the caches.
java.io.IOException
- e
org.apache.xmlrpc.XmlRpcException
- eprotected void rpcFlushIndexQueue()
protected void logInAs(java.lang.String username, java.lang.String password)
protected void loginAs(User user)
protected void logInAsAtDashboard(java.lang.String username, java.lang.String password)
protected void loginAsAtDashboard(User user)
public void logIn(User user, java.lang.String destination)
user
- the user to log in as.destination
- where to go after logging in. Pass 'null' to go to the default homepage.protected void logInAs(java.lang.String username, java.lang.String password, boolean fastMode, boolean rememberMe)
protected void loginViaForm(java.lang.String username, java.lang.String password, boolean rememberMe)
protected void logInAsAdmin()
protected void logInAsAdminAtDashboard()
protected void loginAsTestUser()
protected void loginAsTestUserAtDashboard()
protected void loginAsTestUser2()
protected void logout()
protected void assertLoggedInAs(java.lang.String username)
protected java.lang.String rpcGetUserToken(User user)
protected java.lang.String rpcGetUserToken(java.lang.String username, java.lang.String password)
username
- the usernamepassword
- the password
protected boolean rpcLog(java.lang.String destination, java.lang.String message)
protected java.lang.String rpcChangeLogLevel(java.lang.String loggerName, java.lang.String level)
loggerName
- level
-
protected java.lang.String rpcGetLocalisedText(java.lang.String messageKey)
If the key is not found, the key itself will be returned, as per
ConfluenceActionSupport.getText(String)
.
messageKey
- the message key to internationalise.
FuncTestRpcHandler.getLocalisedText(String, String)
,
ConfluenceActionSupport.getText(String)
protected int rpcGetMailQueueSize()
protected java.lang.String rpcGetAdminToken()
protected void rpcLogOutAdmin()
protected java.lang.String rpcGetTestUserToken()
protected java.lang.String rpcGetTestUser2Token()
public static java.util.Vector<java.lang.Object> makeParams(java.lang.Object... params)
public static java.lang.String getTestProperty(java.lang.String propName)
propName
- the property name
java.lang.NullPointerException
- if propertiesManager
has not been initialisedpublic static int getTestPropertyAsInt(java.lang.String propName)
public static int getTestPropertyAsInt(java.lang.String propName, int defaultValue)
protected java.util.Hashtable rpcCreateSpace(java.lang.String token, java.lang.String key, java.lang.String name, java.lang.String description)
protected java.util.Hashtable rpcCreateSpace(java.lang.String token, java.lang.String key, java.lang.String name, java.lang.String description, java.lang.String spaceGroup)
token
- the authentication tokenkey
- the key of the Spacename
- the name of the Spacedescription
- the description of the SpacespaceGroup
- the space group key, can be null
protected java.util.Hashtable rpcCreateSpaceGroup(java.lang.String token, java.lang.String key, java.lang.String name)
protected void rpcConvertToPersonalSpace(java.lang.String token, java.lang.String userName, java.lang.String spaceKey, java.lang.String newName, boolean updateLinks)
protected java.util.Hashtable rpcCreatePersonalSpace(java.lang.String token, java.lang.String name, java.lang.String description, java.lang.String username)
token
- the authentication tokenname
- the name of the Spacedescription
- the description of the Spaceusername
- name of the user to own the space
protected java.util.Hashtable rpcCreateTestSpace(java.lang.String token)
This method first checks if the test space exists, and logs a message if it does
token
- the authentication token
protected java.util.Hashtable rpcCreateTestSpace2(java.lang.String token)
This method first checks if the test space exists, and logs a message if it does
token
- the authentication token
protected boolean rpcHasGroup(java.lang.String token, java.lang.String groupName)
protected boolean rpcHasUser(java.lang.String token, java.lang.String username)
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 createSpaceViaWebUi(Space space)
protected void createTestSpaceViaWebUI()
protected void rpcRemoveSpace(java.lang.String token, java.lang.String spaceKey)
token
- the authentication tokenspaceKey
- the space to removeprotected void rpcRemoveAllSpaceGroups(java.lang.String token) throws java.io.IOException, org.apache.xmlrpc.XmlRpcException
java.io.IOException
org.apache.xmlrpc.XmlRpcException
protected Space getTestSpace()
protected long rpcCreatePage(java.lang.String token, java.lang.String spaceKey, java.lang.String title, java.lang.String content)
token
- the authentication tokenspaceKey
- the key for the space the page will be created intitle
- the title of the new pagecontent
- the content of the new page
protected long rpcCreatePage(java.lang.String token, java.lang.String spaceKey, java.lang.String title, java.lang.String content, long parentPageId)
token
- the authentication tokenspaceKey
- the key for the space the page will be created intitle
- the title of the new pagecontent
- the content of the new pageparentPageId
- the id of the parent page, 0 if none.
protected void rpcRemovePage(java.lang.String token, java.lang.String spaceKey, long pageId)
protected void rpcRestoreAbstractPage(long id)
protected void rpcRemoveAttachment(java.lang.String token, java.lang.String attachmentFileName, long contentId)
attachmentFileName
- The name of the attachmentcontentId
- the id of the page or blogpost to which the file is currently attachedprotected java.util.Vector rpcGetChildren(java.lang.String token, long pageId)
token
- the authentication tokenpageId
- the page to find children for
protected java.util.Vector rpcGetTopLevelPages(java.lang.String token, java.lang.String spaceKey)
token
- the authentication tokenspaceKey
- the key of the space to find top-level pages for
protected void rpcMovePage(java.lang.String token, long sourcePageId, long targetPageId, java.lang.String position) throws org.apache.xmlrpc.XmlRpcException
token
- the authentication tokensourcePageId
- the id of the page being movedtargetPageId
- the id of the page the source page is moved in relation toposition
- the relative position to move to, see MovePageCommand
org.apache.xmlrpc.XmlRpcException
protected void rpcMovePageToTopLevel(java.lang.String token, long pageId, java.lang.String targetSpaceKey)
token
- the authentication tokenpageId
- the id of the page being movedtargetSpaceKey
- the space to move the page toprotected long rpcCreateTestPage(java.lang.String token)
token
- the authentication token
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 long rpcGetPageId(java.lang.String token, java.lang.String spaceKey, java.lang.String pageTitle)
token
- the authentication tokenspaceKey
- the key of the Space the Page is located inpageTitle
- the title of the page
protected int rpcGetVersionForPage(java.lang.String token, long pageId)
protected long getPageId(java.lang.String spaceKey, java.lang.String title)
protected ViewContentBean viewPage(java.lang.String spaceKey, java.lang.String pageTitle)
protected void viewAbstractPage(long entityId)
entityId
- the ID of the AbstractPageprotected void viewLabel(java.lang.String spaceKey, java.lang.String labelName)
protected void rpcEditPage(java.lang.String token, java.lang.String spaceKey, java.lang.String pageTitle, java.lang.String newTitle, java.lang.String newContent)
token
- the authentication tokenspaceKey
- the key of the Space the Page is inpageTitle
- the current title of the PagenewTitle
- the new title of the Page (null if the same)newContent
- the new content of the Page (null if the same)protected EditContentBean editPage(java.lang.String spaceKey, java.lang.String pageTitle)
protected void movePageToNewSpace(java.lang.String spaceKey, java.lang.String title, java.lang.String newSpaceKey)
protected void movePage(java.lang.String spaceKey, java.lang.String title, java.lang.String newSpaceName, boolean moveHierarchy)
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 movePage(java.lang.String spaceKey, java.lang.String title, java.lang.String newSpaceName, java.lang.String newParentPage)
protected void openInsertLinkPopup()
Focus will then be moved to the popup window
protected void openInsertImagePopup()
Focus will then be moved to the popup window
protected void rpcTrashPage(java.lang.String token, java.lang.String pageId)
token
- the authentication tokenpageId
- ID of the page to be trashedprotected void rpcTrashPage(java.lang.String token, long pageId)
This method converts the long into a String and calls the appropriate rpcTrashPage method
token
- the authentication tokenpageId
- ID of the page to be trashedprotected void rpcTrashPage(java.lang.String token, java.lang.String spaceKey, java.lang.String pageTitle)
This method retrieves the page with the given details and calls the appropriate rpcTrashPage method
token
- the authentication tokenspaceKey
- key of the Space the page is inpageTitle
- title of the page to be trashedprotected void rpcRenderContent(java.lang.String token, java.lang.String spaceKey, long pageId, java.lang.String newContent) throws org.apache.xmlrpc.XmlRpcException, java.io.IOException
org.apache.xmlrpc.XmlRpcException
java.io.IOException
protected long rpcCreateBlogPost(java.lang.String token, java.lang.String spaceKey, java.lang.String postTitle, java.lang.String postContent)
token
- the authentication tokenspaceKey
- the key of the Space the blog entry will be created inpostTitle
- the title of the post to be createdpostContent
- the content of the post to be created
protected long rpcCreateBlogPost(java.lang.String token, java.lang.String spaceKey, java.lang.String postTitle, java.lang.String postContent, java.util.Date lastModification)
protected void createBlog(java.lang.String spaceKey, java.lang.String title, java.lang.String body)
protected void rpcEditBlogPost(java.lang.String token, long entryId, java.lang.String newTitle, java.lang.String newContent)
token
- the authentication tokenentryId
- the ID of the blog entrynewTitle
- the new title of the Blog Post (null if the same)newContent
- the new content of the Blog Post (null if the same)protected void viewEditBlogPostPage(long entryId)
entryId
- the ID of the blog postprotected long rpcGetBlogPostId(java.lang.String token, java.lang.String spaceKey, int dayOfMonth, java.lang.String postTitle)
token
- the authentication tokenspaceKey
- the key of the Space the blog post is located intdayOfMonth
- the day of the month the blog post was madepostTitle
- the title of the blog post
protected void viewTodaysBlog(java.lang.String spaceKey, java.lang.String title)
protected java.lang.String getTodaysBlogPostDate()
protected void viewBlog(java.lang.String spaceKey, java.lang.String datePath, java.lang.String title)
@Deprecated protected void removeBlog(java.lang.String spaceKey, java.lang.String postDateString, java.lang.String postTitle)
ViewContentBean.remove()
instead.
protected void createTemplate(java.lang.String spaceName, java.lang.String templateTitle, java.lang.String templateDescription, java.lang.String templateContent)
protected java.util.Hashtable rpcAddComment(java.lang.String token, long pageId, java.lang.String comment)
token
- the authentication tokenpageId
- the ID of the page to add the comment tocomment
- the text of the comment
protected java.util.Hashtable rpcAddComment(java.lang.String token, long pageId, long parentCommentId, java.lang.String comment)
token
- the authentication tokenpageId
- the ID of the page to add the comment toparentCommentId
- the ID of the parent comment to add the comment tocomment
- the text of the comment
protected java.util.Hashtable rpcEditComment(java.lang.String token, long pageId, long commentId, java.lang.String comment)
protected java.util.Vector rpcGetComments(java.lang.String token, java.lang.String pageId)
protected java.util.Hashtable rpcStoreBlogEntry(java.lang.String token, long pageId, java.lang.String comment)
protected java.lang.String rpcAddTestComment(java.lang.String token)
protected java.util.Hashtable rpcAddComment(java.lang.String token, java.lang.String spaceKey, java.lang.String pageTitle, java.lang.String comment)
token
- the authentication tokenspaceKey
- the space key of the pagepageTitle
- the title of the pagecomment
- the text of the comment
protected void rpcRemoveComment(java.lang.String token, long commentId) throws org.apache.xmlrpc.XmlRpcException, java.io.IOException
token
- authentication token of usercommentId
- the id of the comment to remove
junit.framework.AssertionFailedError
- if the comment cannot be found or removed.
org.apache.xmlrpc.XmlRpcException
java.io.IOException
protected void rpcRemoveComment(java.lang.String token, java.lang.String commentContent, java.lang.String spaceKey, java.lang.String pageTitle) throws org.apache.xmlrpc.XmlRpcException, java.io.IOException
token
- authentication token of usercommentContent
- content of the comment to remove. This is used to identify the commentspaceKey
- identifies the space containing the commentpageTitle
- identifies the page
junit.framework.AssertionFailedError
- if the comment cannot be found or removed.
org.apache.xmlrpc.XmlRpcException
java.io.IOException
protected void addCommentToBlogPost(java.lang.String spaceKey, java.lang.String newsTitle, java.lang.String comment)
protected void rpcAddLabelToPage(java.lang.String token, java.lang.String label, long pageId)
token
- the authentication tokenlabel
- the label to be added to the PagepageId
- the ID of the pageprotected void rpcAddLabelToBlog(java.lang.String token, java.lang.String label, long blogId)
token
- the authentication tokenlabel
- the label to be added to the PageblogId
- the ID of the pageprotected void rpcAddLabelToPage(java.lang.String token, java.lang.String label, java.lang.String spaceKey, java.lang.String pageTitle)
This method retrieves the ID for the given Page and passes it onto the appropriate rpcAddLabelToPage method
token
- the authentication tokenspaceKey
- the key of the Space the page is located inpageTitle
- the title of the Pagelabel
- the label to be added to the pageprotected void rpcAddLabelToSpace(java.lang.String token, java.lang.String label, java.lang.String spaceKey)
token
- the token identifying the userlabel
- the label name (namespaces allowed)spaceKey
- the space keyprotected java.util.List rpcGetPageLabels(java.lang.String token, long pageId)
token
- the authentication tokenpageId
- the ID of the page
protected java.util.List rpcGetPageLabels(java.lang.String token, java.lang.String spaceKey, java.lang.String pageTitle)
This method retrieves the page ID and passes it onto the appropriate rpcGetPageLabels method
token
- the authentication tokenspaceKey
- the key of the space the Page is located inpageTitle
- the title of the Page
protected void rpcRemoveLabelFromPage(java.lang.String token, java.lang.String label, long pageId)
token
- the authentication tokenlabel
- the label name to be removedpageId
- the page ID of the page with the labelprotected void rpcRemoveLabelFromPage(java.lang.String token, java.lang.String label, java.lang.String spaceKey, java.lang.String pageTitle)
protected void rpcRemoveLabelFromSpace(java.lang.String token, java.lang.String label, java.lang.String spaceKey)
token
- the token identifying the userlabel
- the label name (namespaces allowed)spaceKey
- the space keyprotected void createUserViaHelper(java.lang.String token, java.lang.String username, java.lang.String password, java.lang.String fullName, java.lang.String email)
ldapMode
test property the
user is created in an ldap repository or via the XML-RPC interface.
token
- the authentication tokenusername
- the username of the new userpassword
- the password of the new userfullName
- the full name of the new useremail
- the email of the new userprotected void createUserViaHelper(java.lang.String token, User user)
protected void createTestUser1ViaHelper(java.lang.String token)
token
- the authentication tokenprotected void createTestUser2ViaHelper(java.lang.String token)
token
- the authentication tokenprotected void createTestGroupViaHelper(java.lang.String token)
token
- the authentication tokenprotected void viewUser(java.lang.String name)
protected void removePersonalSpace(java.lang.String username)
protected void removeUserViaHelper(java.lang.String token, java.lang.String username)
token
- the authentication tokenusername
- the username of the user to removeprotected void rpcRemoveUserUncleanly(java.lang.String token, java.lang.String username) throws java.io.IOException, org.apache.xmlrpc.XmlRpcException
token
- the authentication tokenusername
- the username of the user to remove
org.apache.xmlrpc.XmlRpcException
- if there were problems removing the user
java.io.IOException
protected void removeTestUser1ViaHelper(java.lang.String token)
token
- the authentication tokenprotected void removeUser(java.lang.String username)
protected void removeTestUser1()
protected void createGroupViaHelper(java.lang.String token, java.lang.String groupName)
token
- the authentication tokengroupName
- the name of the group to be createdprotected void createGroup(java.lang.String group)
protected void addUserToGroupViaHelper(java.lang.String token, java.lang.String username, java.lang.String groupname)
token
- the authentication tokenusername
- the username of the user to be addedgroupname
- the group the user should be added toprotected void removeUserFromGroupViaHelper(java.lang.String token, java.lang.String username, java.lang.String groupname)
token
- the authentication tokenusername
- the username of the user to be removedgroupname
- the name of the group the user should be removed fromprotected java.util.Vector rpcGetUserGroups(java.lang.String token, java.lang.String username)
protected void rpcRemoveGroup(java.lang.String token, java.lang.String groupname)
token
- the authentication tokengroupname
- the group to be removedprotected void removeGroup(java.lang.String groupName)
public void viewPeopleDirectory()
protected void viewGlobalAdmin()
protected void viewGlobalPermissions()
protected void viewLanguages()
protected SpaceAdmin viewSpaceAdmin()
protected void viewSpaceSummary()
protected void viewSpaceSummary(java.lang.String spaceKey)
protected void viewSpacePermissions(java.lang.String spaceKey)
protected void viewHomepage()
protected void viewSpaceContent()
protected void viewTrash()
protected void setThreadedComments(boolean enable)
protected void setSharedMode(boolean enable)
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 revokeGlobalPermissionFromUser(java.lang.String permissionType, User user)
permissionType
- the permission type to removeuser
- who will lose the permissionprotected void revokeGlobalPermissionFromGroup(java.lang.String permissionType, java.lang.String groupName)
permissionType
- the permissiont typegroupName
- the group to remove the permission fromprotected void ensureTestUserCanViewTestSpace()
protected void editSpacePermsForm()
protected void ensureUserCanViewSpace(java.lang.String user, java.lang.String spaceTitle)
protected void enableAnonymousAccess()
protected void disableAnonymousAccess()
protected void setEnableWysiwyg(boolean enabled)
protected void setExternalUserManagement(boolean enabled)
protected void setPublicSignup(boolean enabled)
protected void enableAnonymousAccessToSpace(java.lang.String spaceKey)
protected void disableAnonymousAccessToSpace(java.lang.String spaceKey)
protected void addAnonymousPermissionsToSpace(java.lang.String spaceKey, java.util.Vector permissions)
protected void removeAnonymousPermissionToSpace(java.lang.String spaceKey, java.lang.String permission)
protected void setRemoteApi(boolean enabled)
protected void setAnonymousRemoteApi(boolean enabled)
protected void rpcGrantSpacePermission(java.lang.String token, java.lang.String permission, java.lang.String username, java.lang.String spaceKey)
token
- the authentication tokenpermission
- the String corresponding to the permissionusername
- the user to grant the permission tospaceKey
- the key of the Space to grant the permission inprotected void rpcGrantGlobalPermission(java.lang.String token, java.lang.String permission, java.lang.String entityName)
token
- the authentication tokenpermission
- the String corresponding to the permissionentityName
- the username or group name to grant the permission toprotected void rpcRemoveSpacePermission(java.lang.String token, java.lang.String permission, java.lang.String username, java.lang.String spaceKey)
token
- the authentication tokenpermission
- the String corresponding to the permissionusername
- the user to remove the permission fromspaceKey
- the key of the Space to grant the permission inprotected void rpcRemoveGlobalPermissions(java.lang.String token, java.lang.String permission, java.lang.String username)
token
- the authentication tokenpermission
- the String corresponding to the permissionusername
- the user to remove the permission fromprotected void rpcGrantViewSpacePermission(java.lang.String token, java.lang.String entityName, java.lang.String spaceKey)
token
- the authentication tokenentityName
- the username or group namespaceKey
- the key of the Space to grant the permission inprotected void grantViewSpacePermissionToUser(java.lang.String spaceKey, java.lang.String username)
protected void grantViewSpacePermissionToGroup(java.lang.String spaceKey, java.lang.String groupName)
protected void grantViewSpacePermissionToGroupAndDelegate(java.lang.String spaceKey, java.lang.String groupName)
protected void grantSpacePermissionToGroup(java.lang.String spaceKey, java.lang.String permissionType, java.lang.String groupName)
spaceKey
- the key of the existing space.permissionType
- one of the strings in SpacePermission
,
eg SpacePermission.SYSTEM_ADMINISTRATOR_PERMISSION
groupName
- The name of the 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)
spaceKey
- the key of the existing space.permissionType
- one of the strings in SpacePermission
,
eg SpacePermission.SYSTEM_ADMINISTRATOR_PERMISSION
userName
- The name of the user.protected void grantSpacePermissionToUserAndDelegate(java.lang.String spaceKey, java.lang.String permissionType, java.lang.String userName)
spaceKey
- to grant the space permission topermissionType
- to grantuserName
- the name of the user to grant the permission to.protected void revokeSpacePermissionFromGroup(java.lang.String spaceKey, java.lang.String permissionType, java.lang.String groupName)
spaceKey
- the key of the existing space.permissionType
- one of the strings in SpacePermission
,
eg SpacePermission.SYSTEM_ADMINISTRATOR_PERMISSION
groupName
- The name of the group.protected void revokeSpacePermissionFromUser(java.lang.String spaceKey, java.lang.String permissionType, java.lang.String userName)
spaceKey
- the key of the existing space.permissionType
- one of the strings in SpacePermission
,
eg SpacePermission.SYSTEM_ADMINISTRATOR_PERMISSION
userName
- The name of the user.protected void rpcGrantAnonymousSpacePermission(java.lang.String token, java.lang.String permission, java.lang.String spaceKey)
token
- the token identifying the current userpermission
- the permission to give the anonymous userspaceKey
- the space to grant the permission onprotected void rpcRemoveAnonymousSpacePermission(java.lang.String token, java.lang.String permission, java.lang.String spaceKey)
token
- the token identifying the current userpermission
- the permission to removespaceKey
- the space to remove the permission onpublic void rpcStartActivity(java.lang.String key, java.lang.String user)
public java.util.List rpcGetUsersForActivity(java.lang.String key)
protected java.lang.Object xmlRpcExecute(java.lang.String method, java.util.Vector params)
method
- the method Nameparams
- the method parameters
protected void attachFile(java.io.File attachment, java.lang.String comment)
attachment
- the file attachmentcomment
- the comment for the attachmentprotected void attachFileWithName(java.lang.String fileName, java.io.InputStream in, java.lang.String contentType, java.lang.String comment)
fileName
- the filename to attachin
- the stream to read the filecontentType
- the content type of the attachmentcomment
- a comment for this attachmentprotected void createMail(java.io.File mail, java.lang.String spaceKey)
protected void setEmailMask(java.lang.String setting)
protected void resetEmailMask()
protected void goToEditGeneralConfiguration()
protected void setAttachmentMaxUploadSize(long max)
protected void setDraftSaveInterval(long seconds)
public void setHttpCompression(boolean compressHttp)
compressHttp
- true to turn (or leave) compression on.protected void search(java.lang.String query)
protected java.lang.String getAppContext()
protected void importMailAndAssertNoRunningTask(java.lang.String filePath, java.lang.String spaceKey)
filePath
- the file path to the mailboxspaceKey
- the space key to import intoprotected void importMail(java.lang.String filePath, java.lang.String spaceKey)
filePath
- the file path to the mailboxspaceKey
- the space key to import intoprotected void pause(long milliseconds)
milliseconds
- the time to pauseprotected void addSpaceLabel(java.lang.String labelName)
protected void renamePage(java.lang.String spaceKey, java.lang.String originalPageTitle, java.lang.String newPageTitle)
protected void emptyTrash()
protected void viewSpaceAdvanced()
protected void grantAnonymousUseConfluencePermission()
protected void revokeAnonymousUseConfluencePermission()
protected void showAllUsers()
protected ViewContentBean addWatchPage() throws java.lang.Exception
java.lang.Exception
protected ViewContentBean watchPage(java.lang.String spaceKey, java.lang.String pageTitle)
protected void watchSpace(java.lang.String spaceKey)
protected java.io.File generateFile(java.lang.String filename, java.lang.String contents)
protected int getCurrentMailQueueSize()
protected void importGlobalBackup(java.lang.String importZipLocation, boolean waitForSuccess) throws java.lang.InterruptedException
Perform a site import via the web ui. Logs in as admin first. After the import is performed, the admin user logs in again and the base url setting is restored.
If waiting for success, the method relies on being the only import process running at the time,
since it waits for an ImportFinishedEvent
.
importZipLocation
- zip file location relative to classpathwaitForSuccess
- synchronously wait for the export to complete
java.lang.InterruptedException
protected void importSpaceBackup(java.lang.String importZipLocation, boolean waitForSuccess) throws java.lang.InterruptedException
Import an xml exported space from the classpath into Confluence via the web ui. Logs in as admin first.
If waiting for success, the method relies on being the only import process running at the time,
since it waits for an ImportFinishedEvent
.
importZipLocation
- zip file location relative to classpathwaitForSuccess
- synchronously wait for the export to complete
java.lang.InterruptedException
protected final void restoreBaseUrl()
public java.lang.String stripContext(java.lang.String context, java.lang.String url)
context
- the contexturl
- the url
protected java.io.File downloadToTempFile(java.lang.String url) throws java.io.IOException
java.io.IOException
protected void rpclogCommandOutput(java.lang.String commandString) throws java.lang.InterruptedException, org.apache.xmlrpc.XmlRpcException
java.lang.InterruptedException
org.apache.xmlrpc.XmlRpcException
protected void setViewPermissionsForUsers(java.lang.String spaceKey, java.lang.String pageTitle, java.lang.String users)
Edit the permissions of the specified page as the current user.
One doesn't need to navigate to the page before calling this method.
spaceKey
- the space the page belongs topageTitle
- the title of the pageusers
- the users to restrict view permissions to as a comma separated list of usernames.protected void setViewPermissionsForGroups(java.lang.String spaceKey, java.lang.String pageTitle, java.lang.String groups)
Edit the permissions of the specified page as the current user.
One doesn't need to navigate to the page before calling this method.
spaceKey
- the space the page belongs topageTitle
- the title of the pagegroups
- the groups to restrict view permissions to as a comma separated list of group names.protected void setEditPermissionsForUsers(java.lang.String spaceKey, java.lang.String pageTitle, java.lang.String users)
Edit the permissions of the specified page as the current user.
One doesn't need to navigate to the page before calling this method.
spaceKey
- the space the page belongs topageTitle
- the title of the pageusers
- the users to restrict edit permissions to as a comma separated list of usernames.protected void setEditPermissionsForGroups(java.lang.String spaceKey, java.lang.String pageTitle, java.lang.String groups)
Edit the permissions of the specified page as the current user.
One doesn't need to navigate to the page before calling this method.
spaceKey
- the space the page belongs topageTitle
- the title of the pagegroups
- the groups to restrict edit permissions to as a comma separated list of group names.protected void removePageOrBlogById(long id)
public java.lang.String getBaseUrl()
protected boolean waitForLongRunningTaskToComplete(int timeout, java.lang.String errorText)
timeout
- fail after this many milliseconds if the long running task has not completed.errorText
- the appearance of this string in the response indicates that the task has completed with an error.
protected EDU.oswego.cs.dl.util.concurrent.Latch getEventLatch(java.lang.String token, java.lang.Class eventClass, int timeout)
Latch
object that will be released
when the event has been fired
OR when the timeout has elapsed.
@Deprecated protected void addPageComment(java.lang.String comment)
ViewContentBean.addComment()
instead.
@Deprecated protected void addComment(java.lang.String spaceKey, java.lang.String pageTitle, java.lang.String comment)
ViewContentBean.addComment()
instead.
protected void setPageLabels(java.lang.String spaceKey, java.lang.String pageTitle, java.lang.String labels)
spaceKey
- the space keypageTitle
- the page titlelabels
- the labelsprotected void editPageLabels(java.lang.String labels)
protected void editPageContent(java.lang.String content)
protected void editPageContent(java.lang.String content, java.lang.String comment)
protected void editBlogPostContent(java.lang.String content)
protected void editBlogLabels(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 gotoPageWithError(java.lang.String url)
protected void setAllowCamelCase(boolean allow)
public void assertImageValid(java.lang.String imgSrc, java.lang.String imgAlt)
createUrl(java.lang.String, java.net.URL)
assertImageValid
in class net.sourceforge.jwebunit.junit.WebTestCase
protected void assertImagePresent(java.lang.String imageName)
WebTestCase.assertImagePresent(String, String)
that asserts the image name with
a contains check rather than equals.
protected java.util.Collection getUserGroups(java.lang.String username) throws org.apache.xmlrpc.XmlRpcException, java.io.IOException
username
- user's login name
String
s.
org.apache.xmlrpc.XmlRpcException
java.io.IOException
protected boolean isClustered()
protected java.lang.String getFriendlyRelativeDate(java.util.Date now, java.util.Date date, TimeZone timeZone)
FriendlyDateFormatter
to format the date relative to the "now" time.
Note that the output format varies greatly even from second to second -- see FriendlyDateFormatter
.
now
- the date which the relative time is calculated in relation todate
- the date of some event which is to be formattedtimeZone
- the current time zone
FriendlyDateFormatter
protected void forceViewGlobalAdmin()
protected void createTestMailServer() throws java.lang.Exception
java.lang.Exception
protected void stopTestMailServer()
protected void rpcFlushMailQueue()
protected void assertNoMailReceived() throws java.lang.InterruptedException
java.lang.InterruptedException
protected void assertMailReceived() throws java.lang.InterruptedException
java.lang.InterruptedException
protected void rpcClearIndex()
protected void rpcClearQueue(java.lang.String token, java.lang.String queueName)
protected void rebuildIndex() throws java.lang.InterruptedException
java.lang.InterruptedException
protected void editSpaceDescription(User user, java.lang.String spaceKey, java.lang.String newDescription)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |