|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase com.atlassian.confluence.ThreadLocalWebTestCase com.atlassian.confluence.AbstractAtlassianWebTestCase com.atlassian.confluence.AbstractConfluenceAcceptanceTest
public abstract class AbstractConfluenceAcceptanceTest
This super class provides Confluence specific functions useful in acceptance tests.
Fields inherited from class com.atlassian.confluence.AbstractAtlassianWebTestCase |
---|
SITE_TITLE_SUFFIX, TITLE_SEPARATOR |
Constructor Summary | |
---|---|
AbstractConfluenceAcceptanceTest()
|
|
AbstractConfluenceAcceptanceTest(String testName)
|
Method Summary | |
---|---|
void |
addAnonymousPermissionsToSpace(String spaceKey,
Vector permissions)
|
void |
addComment(String spaceKey,
String pageTitle,
String comment)
Deprecated. Should use ViewContentBean.addComment() instead. |
void |
addCommentToBlogPost(String spaceKey,
String newsTitle,
String comment)
|
void |
addSpaceLabel(String labelName)
|
void |
addUserToGroupViaHelper(String username,
String groupname)
Adds the given user to a groupname |
ViewContentBean |
addWatchPage()
|
void |
assertImagePresent(String imageName)
Provide our own implementation of ThreadLocalWebTestCase.assertImagePresent(String, String) that asserts the image name with
a contains check rather than equals. |
void |
assertImageValid(String imgSrc,
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. |
void |
assertLinkPresentWithExactTextAndClass(String linkText,
String cls)
|
void |
assertLoggedInAs(String username)
Deprecated. since 4.0. Use LoginHelper.isLoggedInAs(String) and assertTrue. |
protected void |
assertMailReceived()
|
protected void |
assertNoMailReceived()
|
void |
attachFile(File attachment)
Click the attach file link, attach a given file with a given comment and submit the attachment form. |
void |
attachFile(File attachment,
String comment)
Click the attach file link, attach a given file with a given comment and submit the attachment form. |
void |
attachFileWithName(String fileName,
InputStream in,
String contentType,
String comment)
Click the attach file link, attach a given file with a given comment and submit the attachment form. |
String |
chooseRandomBaseUrl()
Selects a baseurl from the available specified base urls. |
void |
createBlog(String spaceKey,
String spaceTitle,
String title,
String body)
|
void |
createBlogInTestSpace(String title,
String body)
|
void |
createGroup(String group)
Create a group via the Web Interface. |
void |
createGroupViaHelper(String groupName)
Creates a group with the given name |
void |
createMail(File mail,
String spaceKey)
|
ViewContentBean |
createPage(String spaceKey,
String title,
String content,
String parentPageTitle)
|
ViewContentBean |
createPageWithViewRestrictions(String spaceKey,
String title,
String content,
String parentPageTitle,
String viewPermissionUsers)
|
void |
createSpaceViaWebUI(Space space)
|
void |
createSpaceViaWebUI(String key,
String name,
String description)
|
void |
createSpaceViaWebUI(String key,
String name,
String description,
String spaceGroupKey)
|
void |
createTemplate(String spaceName,
String templateTitle,
String templateDescription,
String templateContent)
|
protected void |
createTestMailServer()
Starts up and configures a new mail server which will be pulled back down during tearDown() . |
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) |
void |
createUserViaHelper(String token,
String username,
String password,
String fullName,
String email)
Creates a new user with the given details. |
void |
createUserViaHelper(User user)
|
void |
disableAnonymousAccess()
|
void |
disableAnonymousAccessToSpace(String spaceKey)
|
void |
editBlog(String spaceKey,
String title,
String content)
|
void |
editBlogLabels(String labels)
|
EditContentBean |
editPage(String spaceKey,
String pageTitle)
|
void |
editPageContent(String content)
Sets content via RPC, as the admin user. |
void |
editPageContentViaForm(String content)
Edits content on the form, and submits the form as the current user. |
void |
editPageWithContent(String spaceKey,
String title,
String content)
|
void |
editSpaceDescription(User user,
String spaceKey,
String newDescription)
|
void |
editSpacePermsForm()
|
void |
enableAnonymousAccess()
|
void |
enableAnonymousAccessToSpace(String spaceKey)
|
void |
ensureTestUserCanViewTestSpace()
Deprecated. since 3.5 permissions should be granted using SpacePermissions.grantPermission(com.atlassian.confluence.it.SpacePermission, User)
(which already ensures that users can view a space before other permissions are granted) |
void |
forceViewGlobalAdmin()
|
protected String |
generateBaseUrl()
|
File |
generateFile(String filename,
String contents)
|
String |
getAppContext()
|
String |
getBaseUrl()
Returns base url that is used in tests. |
String |
getConfiguredBaseUrl()
Returns the configured base URL in the Confluence app. |
int |
getCurrentMailQueueSize()
|
protected long |
getCurrentPageId()
|
String |
getFriendlyRelativeDate(Date now,
Date date,
TimeZone timeZone)
Use the FriendlyDateFormatter to format the date relative to the "now" time. |
long |
getPageId(String spaceKey,
String title)
|
protected PluginHelper |
getPluginHelper()
|
String |
getTodaysBlogPostDate()
|
void |
gotoPageWithError(String url)
|
void |
grantAnonymousUseConfluencePermission()
|
void |
grantGlobalBrowsePermissionToGroup(String groupName)
Deprecated. since 3.5 use GlobalPermissions.grantPermission(GlobalPermission, Group) instead |
void |
grantGlobalPermissionToGroup(String permissionType,
String groupName)
Deprecated. since 3.5 use GlobalPermissions.grantPermission(GlobalPermission, Group) instead |
void |
grantGlobalPermissionToUser(String permissionType,
String userName)
Deprecated. since 3.5 use GlobalPermissions.grantPermission(GlobalPermission, User) instead |
void |
grantSpacePermissionToGroup(String spaceKey,
String permissionType,
String groupName)
Grant view space permissions and one other space permission to a specified group. |
void |
grantSpacePermissionToGroupAndDelegate(String spaceKey,
String permissionType,
String groupName)
|
void |
grantSpacePermissionToUser(String spaceKey,
String permissionType,
String userName)
Grant view space permissions and one other space permission to a specified user. |
void |
grantSpacePermissionToUserAndDelegate(String spaceKey,
String permissionType,
String userName)
Grants space permissions to the user by delegating to the rpc equivalent. |
void |
grantViewSpacePermissionToGroup(String spaceKey,
String groupName)
Deprecated. since 3.5 use SpacePermissions.grantPermission(com.atlassian.confluence.it.SpacePermission, Group) instead |
void |
grantViewSpacePermissionToGroupAndDelegate(String spaceKey,
String groupName)
|
void |
grantViewSpacePermissionToUser(String spaceKey,
String username)
Deprecated. since 3.5 use SpacePermissions.grantPermission(com.atlassian.confluence.it.SpacePermission, User) instead |
protected void |
importGlobalBackup(File backupFile,
boolean waitForSuccess)
Deprecated. since 4.1 use an Importer instead. |
void |
importGlobalBackup(String importZipLocation,
boolean waitForSuccess)
Deprecated. since 4.1 use an Importer instead. |
void |
importMail(String filePath,
String spaceKey)
Creates mails in the specified space. |
void |
importMailAndAssertNoRunningTask(String filePath,
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(String importZipLocation,
boolean waitForSuccess)
Deprecated. since 4.1 use an Importer instead. |
boolean |
isClustered()
|
void |
logIn(User user)
Log in as the specified user, going to the default start page. |
void |
logIn(User user,
String destination)
Log in as the specified user, going to the provided URL (relative to the context path) after logging in. |
void |
logInAs(String username,
String password)
|
void |
logInAs(String username,
String password,
boolean rememberMe)
|
void |
loginAs(User user)
|
void |
logInAsAdminAtDashboard()
|
void |
logInAsAtDashboard(String username,
String password)
|
void |
loginAsAtDashboard(User user)
|
void |
loginAsTestUser()
|
void |
loginAsTestUser2()
|
void |
loginAsTestUserAtDashboard()
|
protected void |
loginViaForm(String username,
String password,
boolean rememberMe)
|
void |
logout()
|
static Vector<Object> |
makeParams(Object... params)
Deprecated. Use rpc instead. |
void |
movePage(String title,
Space oldSpace,
Space newSpace)
|
void |
movePage(String spaceKey,
String title,
String newSpaceKey)
|
void |
movePageToNewParent(String spaceKey,
String title,
String newParentPage)
|
void |
movePageToNewParent(String oldSpaceKey,
String title,
String newSpaceKey,
String newParentPage)
|
void |
movePageToNewSpace(String spaceKey,
String title,
String newSpaceKey)
|
protected void |
rebuildIndex()
|
void |
removeAnonymousPermissionToSpace(String spaceKey,
String permission)
|
void |
removeGroup(String groupName)
Delete a group via the Web Interface. |
void |
removePageLabel(String spaceKey,
String pageTitle)
|
void |
removePageOrBlogById(long id)
|
void |
removePersonalSpace(String username)
|
void |
removeTestUser1()
Remove testUser1 via the Web Interface. |
void |
removeTestUser1ViaHelper(String token)
Removes the test user |
void |
removeUser(String username)
Remove a user via the Web Interface. |
void |
removeUserFromGroupViaHelper(String username,
String groupname)
Removes the given user from the group |
void |
removeUserViaHelper(String username)
Removes a user with the given username |
void |
renamePage(String spaceKey,
String originalPageTitle,
String newPageTitle)
|
void |
revokeAnonymousUseConfluencePermission()
|
void |
revokeGlobalPermissionFromGroup(String permissionType,
String groupName)
Deprecated. since 3.5 use GlobalPermissions.revokePermission(GlobalPermission, Entity) instead |
void |
revokeGlobalPermissionFromUser(String permissionType,
User user)
Deprecated. since 3.5 use GlobalPermissions.revokePermission(GlobalPermission, Entity) instead |
void |
revokeSpacePermissionFromGroup(String spaceKey,
String permissionType,
String groupName)
Remove a space permission from a specified group. |
void |
revokeSpacePermissionFromUser(String spaceKey,
String permissionType,
String userName)
Remove a space permission from a specified user. |
Hashtable |
rpcAddComment(String token,
long pageId,
long parentCommentId,
String comment)
Adds a comment to a page via the XML-RPC interface |
Hashtable |
rpcAddComment(String token,
long pageId,
String comment)
Adds a comment to a page via the XML-RPC interface |
Hashtable |
rpcAddComment(String token,
String spaceKey,
String pageTitle,
String comment)
Adds a comment to a page via the XML-RPC interface |
void |
rpcAddLabelToBlog(String token,
String label,
long blogId)
Adds a label to the blogpost with the given page ID |
void |
rpcAddLabelToPage(String token,
String label,
long pageId)
Adds a label to the Page with the given page ID |
void |
rpcAddLabelToPage(String token,
String label,
String spaceKey,
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 |
void |
rpcAddLabelToSpace(String token,
String label,
String spaceKey)
Adds a label to a space |
String |
rpcAddTestComment(String token)
|
void |
rpcClearIndex()
|
void |
rpcClearQueue(String token,
String queueName)
|
long |
rpcCreateBlogPost(String token,
String spaceKey,
String postTitle,
String postContent)
Creates a new blog entry via the XML-RPC interface |
long |
rpcCreateBlogPost(String token,
String spaceKey,
String postTitle,
String postContent,
Date lastModification)
|
long |
rpcCreatePage(String token,
String spaceKey,
String title,
String content)
Deprecated. use ConfluenceRpc.createPage(String, String, String, long) instead. |
long |
rpcCreatePage(String token,
String spaceKey,
String title,
String content,
long parentPageId)
Deprecated. use ConfluenceRpc.createPage(String, String, String, long) instead. |
Hashtable |
rpcCreatePersonalSpace(String token,
String name,
String description,
String username)
Creates a personal space via the XML-RPC interface |
Hashtable |
rpcCreateSpace(String token,
String key,
String name,
String description)
Deprecated. Use ConfluenceRpc.createSpace(com.atlassian.confluence.it.Space) instead. |
Hashtable |
rpcCreateSpace(String token,
String key,
String name,
String description,
String spaceGroup)
Deprecated. Use ConfluenceRpc.createSpace(com.atlassian.confluence.it.Space) instead. |
Hashtable |
rpcCreateSpaceGroup(String token,
String key,
String name)
|
Hashtable |
rpcCreateTestSpace(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 |
Hashtable |
rpcCreateTestSpace2(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 |
long |
rpcCreateXhtmlPage(String token,
String spaceKey,
String title,
String content)
|
void |
rpcEditBlogPost(String token,
long entryId,
String newTitle,
String newContent)
Modifies the page with the given details via the XML-RPC interface |
Hashtable |
rpcEditComment(String token,
long pageId,
long commentId,
String comment)
|
void |
rpcEditPage(String token,
String spaceKey,
String pageTitle,
String newTitle,
String newContent)
Deprecated. use ConfluenceRpc.editPage(com.atlassian.confluence.it.Space, String, String, String) instead |
protected void |
rpcFlushAllCaches(String token)
Deprecated. use ConfluenceRpc.flushAllCaches() instead. |
void |
rpcFlushIndexQueue()
Deprecated. use ConfluenceRpc.flushIndexQueue() instead. |
void |
rpcFlushMailQueue()
Deprecated. since 3.3 |
String |
rpcGetAdminToken()
Retrieves a token for the admin user |
long |
rpcGetBlogPostId(String token,
String spaceKey,
int dayOfMonth,
String postTitle)
Retrieves the ID of a blog post with the given details |
Vector |
rpcGetChildren(String token,
long pageId)
Returns the ordered id list of pages that are direct children of a given page. |
Vector |
rpcGetComments(String token,
String pageId)
|
String |
rpcGetLocalisedText(String messageKey)
Returns the localised message text for the given key, retrieved from the application via RPC. |
int |
rpcGetMailQueueSize()
|
long |
rpcGetPageId(String token,
String spaceKey,
String pageTitle)
Retrieves the page ID for a page with the given details |
List |
rpcGetPageLabels(String token,
long pageId)
Retrieves the labels assigned to a Page with the given page ID |
List |
rpcGetPageLabels(String token,
String spaceKey,
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 |
String |
rpcGetTestUser2Token()
Retrieves a token for the test user 2 |
String |
rpcGetTestUserToken()
Retrieves a token for the test user |
Vector |
rpcGetTopLevelPages(String token,
String spaceKey)
Returns the ordered id list of top-level pages in a given space. |
Vector |
rpcGetUserGroups(String token,
String username)
|
String |
rpcGetUserToken(String username,
String password)
Retrieves the user token for the given details, for use with the XML-RPC interface |
String |
rpcGetUserToken(User user)
|
int |
rpcGetVersionForPage(String token,
long pageId)
|
void |
rpcGrantAnonymousSpacePermission(String token,
String permission,
String spaceKey)
Grants the given permission to the anonymous user for the given space |
void |
rpcGrantGlobalPermission(String token,
String permission,
String entityName)
Grants the given global permission to a user. |
void |
rpcGrantSpacePermission(String token,
String permission,
String username,
String spaceKey)
Grants the given permission to a user for a particular Space |
void |
rpcGrantViewSpacePermission(String token,
String entityName,
String spaceKey)
Convenience method for granting VIEWSPACE permission to a particular user |
boolean |
rpcHasGroup(String token,
String groupName)
|
boolean |
rpcHasUser(String token,
String username)
|
protected void |
rpclogCommandOutput(String commandString)
|
void |
rpcLogOut(String token)
|
void |
rpcLogOutAdmin()
|
protected void |
rpcMovePage(String token,
long sourcePageId,
long targetPageId,
String position)
Moves a page to a location relative to another page. |
void |
rpcMovePageToTopLevel(String token,
long pageId,
String targetSpaceKey)
Moves a page to the top of a given space. |
void |
rpcPauseJob(String jobName)
|
protected void |
rpcRemoveAllSpaceGroups(String token)
|
void |
rpcRemoveAnonymousSpacePermission(String token,
String permission,
String spaceKey)
Removes the given permission for the anonymous user from the given space |
void |
rpcRemoveAttachment(String token,
String attachmentFileName,
long contentId)
Remove an attachment from a page or blog. |
protected void |
rpcRemoveComment(String token,
long commentId)
Remove a comment, identified by its id. |
protected void |
rpcRemoveComment(String token,
String commentContent,
String spaceKey,
String pageTitle)
Remove a comment, identified by its location and content, from a page. |
void |
rpcRemoveGlobalPermissions(String token,
String permission,
String username)
Removes the given global permission for a user |
void |
rpcRemoveGroup(String groupname)
Removes the given group |
void |
rpcRemoveLabelFromPage(String token,
String label,
long pageId)
Removes the given label from the page with the given page ID |
void |
rpcRemoveLabelFromPage(String token,
String label,
String spaceKey,
String pageTitle)
|
void |
rpcRemoveLabelFromSpace(String token,
String label,
String spaceKey)
Removes a label from a space |
void |
rpcRemovePage(String token,
String spaceKey,
long pageId)
Deprecated. use ConfluenceRpc.removePage(long) instead. |
void |
rpcRemoveSpace(String token,
String spaceKey)
Deprecated. use ConfluenceRpc.removeSpace(String) instead. |
void |
rpcRemoveSpacePermission(String token,
String permission,
String username,
String spaceKey)
Removes the given permission for a user for a particular Space |
void |
rpcRenderContent(String token,
String spaceKey,
long pageId,
String newContent)
|
void |
rpcRestoreAbstractPage(long id)
|
void |
rpcResumeJob(String jobName)
|
Hashtable |
rpcStoreBlogEntry(String token,
long pageId,
String comment)
|
void |
rpcTrashPage(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 |
void |
rpcTrashPage(String token,
String pageId)
Trashes (removes) a page with the given ID |
void |
rpcTrashPage(String token,
String spaceKey,
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 |
void |
rpcTriggerJob(String jobName)
|
void |
search(String query)
|
void |
setApplicationConfigProperty(String propertyKey,
String propertyValue)
|
void |
setAttachmentMaxUploadSize(long max)
|
JSONObject |
setBlogLabels(String spaceKey,
String blogTitle,
String labels)
Add the specified labels to the blog |
protected void |
setCheckbox(boolean check,
String checkBox)
|
void |
setEditPermissionsForGroups(String spaceKey,
String pageTitle,
String groups)
Deprecated. Use ConfluenceRpc.grantContentPermission(com.atlassian.confluence.it.content.security.ContentPermission, ContentEntity) |
void |
setEditPermissionsForUsers(String spaceKey,
String pageTitle,
String users)
Deprecated. Use ConfluenceRpc.grantContentPermission(com.atlassian.confluence.it.content.security.ContentPermission, ContentEntity) |
void |
setMaxAttachmentsInUI(long max)
|
JSONObject |
setPageLabels(String spaceKey,
String pageTitle,
String labels)
Add the specified labels to the page |
void |
setSharedMode(boolean enable)
|
void |
setThreadedComments(boolean enable)
|
protected void |
setUp()
|
protected void |
setUp(String beginAt)
Default setUp method. |
protected void |
setUpTestNG(Method method)
Called by TestNG, calls setUp() on the current class, prevents the need to put this annotation everywhere, and sets the test name properly. |
void |
setViewPermissionsForGroups(String spaceKey,
String pageTitle,
String groups)
Deprecated. Use ConfluenceRpc.grantContentPermission(com.atlassian.confluence.it.content.security.ContentPermission, ContentEntity) |
void |
setViewPermissionsForUsers(String spaceKey,
String pageTitle,
String users)
Deprecated. Use ConfluenceRpc.grantContentPermission(com.atlassian.confluence.it.content.security.ContentPermission, ContentEntity) |
void |
showAllUsers()
|
void |
shutdownQuartz()
|
void |
stopTestMailServer()
|
protected void |
tearDown()
Default tearDown method. |
protected void |
tearDownTestNG(Method method)
Called by TestNG, calls tearDown() on the current class, prevents the need to put this annotation everywhere, and sets the test name properly. |
void |
viewBlog(String spaceKey,
String datePath,
String title)
|
void |
viewEditBlogPostPage(long entryId)
Views the edit blog post page for the post with the given ID |
void |
viewGlobalAdmin()
|
GlobalPermissions |
viewGlobalPermissions()
|
void |
viewHomepage()
|
void |
viewLabel(String spaceKey,
String labelName)
|
void |
viewLanguages()
|
ViewContentBean |
viewPage(String spaceKey,
String pageTitle)
|
void |
viewPeopleDirectory()
|
SpaceAdmin |
viewSpaceAdmin()
|
void |
viewSpaceAdvanced()
|
void |
viewSpaceContent()
|
SpacePermissions |
viewSpacePermissions(Space space)
|
void |
viewSpacePermissions(String spaceKey)
Deprecated. since 3.5 use viewSpacePermissions(com.atlassian.confluence.it.Space) instead |
void |
viewSpaceSummary()
|
void |
viewSpaceSummary(String spaceKey)
|
ViewContentBean |
viewTodaysBlog(String spaceKey,
String title)
|
void |
viewTrash()
|
void |
viewUser(String name)
|
ViewContentBean |
watchPage(String spaceKey,
String pageTitle)
|
void |
watchSpace(Space space)
|
void |
watchSpace(String spaceKey)
|
protected String |
withParagraph(String value)
|
Object |
xmlRpcExecute(String method,
Vector params)
Deprecated. call ConfluenceRpc.execute(String, Object...) or ConfluenceRpc.executeFuncTest(String, Object...) instead. |
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.slf4j.Logger log
public static final String context
protected static final DirectoryConfiguration DIRECTORY_CONFIG
protected static final boolean CROWD_MODE
public static final User TEST_ADMIN
public static final String TEST_ADMIN_USERNAME
public static final String TEST_ADMIN_PASSWORD
public static final String TEST_ADMIN_FULLNAME
public static final String TEST_ADMIN_EMAIL
public static final User TEST_USER1
public static final String TEST_GEN_USERNAME1
public static final String TEST_GEN_PASSWORD1
public static final String TEST_GEN_FULLNAME1
public static final String TEST_GEN_EMAIL1
public static final User TEST_USER2
public static final String TEST_GEN_USERNAME2
public static final String TEST_GEN_PASSWORD2
public static final String TEST_GEN_FULLNAME2
public static final String TEST_GEN_EMAIL2
public static final String ANONYMOUS_USER
public static final String CONFLUENCE_USERS_GROUP
public static final String CONFLUENCE_ADMIN_GROUP
protected static final String TEST_GROUP1
public static final Space TEST_SPACE
public static final String TESTSPACE_TITLE
public static final String TESTSPACE_KEY
public static final String TESTSPACE_DESCRIPTION
public static final Space TEST_SPACE2
public static final String TESTSPACE2_TITLE
public static final String TESTSPACE2_KEY
public static final String TESTSPACE2_DESCRIPTION
public static final String TESTPAGE_TITLE
public static final String TESTPAGE_CONTENT
public static final String TESTPAGE_COMMENT
public static final String TESTBLOG_TITLE
public static final String TESTBLOG_CONTENT
public Page TEST_PAGE
public BlogPost TEST_BLOG
public Comment TEST_COMMENT
public static final String TESTMAILSERVER_NAME
public static final String TESTMAILSERVER_HOSTNAME
public static final RandomnessHandler RANDOM
protected static final SimpleDateFormat BLOG_DATE_FORMAT
protected static final String BROWSE_MENU_LINK_ID
protected static final String SMTP_SUBJECT_PREFIX
@Deprecated protected org.apache.xmlrpc.XmlRpcClient xmlrpc
rpc
instead.protected ConfluenceRpc wikiMarkupRpc
protected ConfluenceRpc rpc
protected String adminToken
protected String testUserToken
protected String testUser2Token
protected List<File> filesToDelete
protected UserManagementHelper userHelper
protected MailServices mailServices
protected AdminConsole adminConsole
protected static final String VIEW_PERSONAL_SPACE_LINK
protected LogAdjuster logAdjuster
LogAdjuster.resetLogLevels()
is called in tearDown()
.
Constructor Detail |
---|
public AbstractConfluenceAcceptanceTest(String testName)
public AbstractConfluenceAcceptanceTest()
Method Detail |
---|
protected void setUp() throws Exception
setUp
in class junit.framework.TestCase
Exception
protected void setUpTestNG(Method method) throws Exception
Exception
protected void setUp(String beginAt) throws Exception
beginAt
- the initial path (relative to the context path) to begin at
Exception
- from superprotected PluginHelper getPluginHelper()
protected void tearDownTestNG(Method method) throws Exception
Exception
protected void tearDown() throws Exception
filesToDelete
list.
tearDown
in class ThreadLocalWebTestCase
Exception
protected String generateBaseUrl()
public 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.
public String getConfiguredBaseUrl()
public void shutdownQuartz()
public void rpcPauseJob(String jobName)
public void rpcResumeJob(String jobName)
public void rpcTriggerJob(String jobName)
protected void rpcFlushAllCaches(String token) throws IOException, org.apache.xmlrpc.XmlRpcException
ConfluenceRpc.flushAllCaches()
instead.
token
- of the user who is flushing the caches.
IOException
- e
org.apache.xmlrpc.XmlRpcException
- e@Deprecated public void rpcFlushIndexQueue()
ConfluenceRpc.flushIndexQueue()
instead.
public void logInAs(String username, String password)
public void loginAs(User user)
public void logInAsAtDashboard(String username, String password)
public void loginAsAtDashboard(User user)
public void logIn(User user)
user
- the user to log in as.public void logIn(User user, String destination)
user
- the user to log in as.destination
- where to go after logging in. Pass 'null' to go to the default homepage.public void logInAs(String username, String password, boolean rememberMe)
protected void loginViaForm(String username, String password, boolean rememberMe)
public void logInAsAdminAtDashboard()
public void loginAsTestUser()
public void loginAsTestUserAtDashboard()
public void loginAsTestUser2()
public void logout()
public void assertLoggedInAs(String username)
LoginHelper.isLoggedInAs(String)
and assertTrue.
public void assertLinkPresentWithExactTextAndClass(String linkText, String cls)
public String rpcGetUserToken(User user)
public String rpcGetUserToken(String username, String password)
username
- the usernamepassword
- the password
public String rpcGetLocalisedText(String messageKey)
ConfluenceActionSupport.getText(String)
.
messageKey
- the message key to internationalise.
FuncTestRpcHandler.getLocalisedText(String, String)
,
ConfluenceActionSupport.getText(String)
public int rpcGetMailQueueSize()
public String rpcGetAdminToken()
public void rpcLogOutAdmin()
public void rpcLogOut(String token)
public String rpcGetTestUserToken()
public String rpcGetTestUser2Token()
@Deprecated public static Vector<Object> makeParams(Object... params)
rpc
instead.
params
- the params.
@Deprecated public Hashtable rpcCreateSpace(String token, String key, String name, String description)
ConfluenceRpc.createSpace(com.atlassian.confluence.it.Space)
instead.
@Deprecated public Hashtable rpcCreateSpace(String token, String key, String name, String description, String spaceGroup)
ConfluenceRpc.createSpace(com.atlassian.confluence.it.Space)
instead.
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
public Hashtable rpcCreateSpaceGroup(String token, String key, String name)
public Hashtable rpcCreatePersonalSpace(String token, String name, String description, String username)
token
- the authentication tokenname
- the name of the Spacedescription
- the description of the Spaceusername
- name of the user to own the space
public Hashtable rpcCreateTestSpace(String token)
token
- the authentication token
public Hashtable rpcCreateTestSpace2(String token)
token
- the authentication token
public boolean rpcHasGroup(String token, String groupName)
public boolean rpcHasUser(String token, String username)
public void createSpaceViaWebUI(String key, String name, String description)
public void createSpaceViaWebUI(String key, String name, String description, String spaceGroupKey)
public void createSpaceViaWebUI(Space space)
public void createTestSpaceViaWebUI()
@Deprecated public void rpcRemoveSpace(String token, String spaceKey)
ConfluenceRpc.removeSpace(String)
instead.
token
- the authentication tokenspaceKey
- the space to removeprotected void rpcRemoveAllSpaceGroups(String token) throws IOException, org.apache.xmlrpc.XmlRpcException
IOException
org.apache.xmlrpc.XmlRpcException
@Deprecated public long rpcCreatePage(String token, String spaceKey, String title, String content)
ConfluenceRpc.createPage(String, String, String, long)
instead.
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
@Deprecated public long rpcCreatePage(String token, String spaceKey, String title, String content, long parentPageId)
ConfluenceRpc.createPage(String, String, String, long)
instead.
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.
public long rpcCreateXhtmlPage(String token, String spaceKey, String title, String content)
@Deprecated public void rpcRemovePage(String token, String spaceKey, long pageId)
ConfluenceRpc.removePage(long)
instead.
public void rpcRestoreAbstractPage(long id)
public void rpcRemoveAttachment(String token, String attachmentFileName, long contentId)
attachmentFileName
- The name of the attachmentcontentId
- the id of the page or blogpost to which the file is currently attachedpublic Vector rpcGetChildren(String token, long pageId)
token
- the authentication tokenpageId
- the page to find children for
public Vector rpcGetTopLevelPages(String token, String spaceKey)
token
- the authentication tokenspaceKey
- the key of the space to find top-level pages for
protected void rpcMovePage(String token, long sourcePageId, long targetPageId, 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
public void rpcMovePageToTopLevel(String token, long pageId, String targetSpaceKey)
token
- the authentication tokenpageId
- the id of the page being movedtargetSpaceKey
- the space to move the page topublic ViewContentBean createPage(String spaceKey, String title, String content, String parentPageTitle)
public ViewContentBean createPageWithViewRestrictions(String spaceKey, String title, String content, String parentPageTitle, String viewPermissionUsers)
public long rpcGetPageId(String token, String spaceKey, String pageTitle)
token
- the authentication tokenspaceKey
- the key of the Space the Page is located inpageTitle
- the title of the page
public int rpcGetVersionForPage(String token, long pageId)
public long getPageId(String spaceKey, String title)
protected long getCurrentPageId()
public ViewContentBean viewPage(String spaceKey, String pageTitle)
public void viewLabel(String spaceKey, String labelName)
public void rpcEditPage(String token, String spaceKey, String pageTitle, String newTitle, String newContent)
ConfluenceRpc.editPage(com.atlassian.confluence.it.Space, String, String, String)
instead
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)public EditContentBean editPage(String spaceKey, String pageTitle)
public void movePageToNewSpace(String spaceKey, String title, String newSpaceKey)
public void movePage(String spaceKey, String title, String newSpaceKey)
public void movePage(String title, Space oldSpace, Space newSpace)
public void movePageToNewParent(String spaceKey, String title, String newParentPage)
public void movePageToNewParent(String oldSpaceKey, String title, String newSpaceKey, String newParentPage)
public void rpcTrashPage(String token, String pageId)
token
- the authentication tokenpageId
- ID of the page to be trashedpublic void rpcTrashPage(String token, long pageId)
token
- the authentication tokenpageId
- ID of the page to be trashedpublic void rpcTrashPage(String token, String spaceKey, String pageTitle)
token
- the authentication tokenspaceKey
- key of the Space the page is inpageTitle
- title of the page to be trashedpublic void rpcRenderContent(String token, String spaceKey, long pageId, String newContent) throws org.apache.xmlrpc.XmlRpcException, IOException
org.apache.xmlrpc.XmlRpcException
IOException
public long rpcCreateBlogPost(String token, String spaceKey, String postTitle, 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
public long rpcCreateBlogPost(String token, String spaceKey, String postTitle, String postContent, Date lastModification)
public void createBlogInTestSpace(String title, String body)
public void createBlog(String spaceKey, String spaceTitle, String title, String body)
public void editBlog(String spaceKey, String title, String content)
public void rpcEditBlogPost(String token, long entryId, String newTitle, 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)public void viewEditBlogPostPage(long entryId)
entryId
- the ID of the blog postpublic long rpcGetBlogPostId(String token, String spaceKey, int dayOfMonth, 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
public ViewContentBean viewTodaysBlog(String spaceKey, String title)
public String getTodaysBlogPostDate()
public void viewBlog(String spaceKey, String datePath, String title)
public void createTemplate(String spaceName, String templateTitle, String templateDescription, String templateContent)
public Hashtable rpcAddComment(String token, long pageId, String comment)
token
- the authentication tokenpageId
- the ID of the page to add the comment tocomment
- the text of the comment
public Hashtable rpcAddComment(String token, long pageId, long parentCommentId, 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
public Hashtable rpcEditComment(String token, long pageId, long commentId, String comment)
public Vector rpcGetComments(String token, String pageId)
public Hashtable rpcStoreBlogEntry(String token, long pageId, String comment)
public String rpcAddTestComment(String token)
public Hashtable rpcAddComment(String token, String spaceKey, String pageTitle, 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(String token, long commentId) throws org.apache.xmlrpc.XmlRpcException, 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
IOException
protected void rpcRemoveComment(String token, String commentContent, String spaceKey, String pageTitle) throws org.apache.xmlrpc.XmlRpcException, 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
IOException
public void addCommentToBlogPost(String spaceKey, String newsTitle, String comment)
public void rpcAddLabelToPage(String token, String label, long pageId)
token
- the authentication tokenlabel
- the label to be added to the PagepageId
- the ID of the pagepublic void rpcAddLabelToBlog(String token, String label, long blogId)
token
- the authentication tokenlabel
- the label to be added to the PageblogId
- the ID of the pagepublic void rpcAddLabelToPage(String token, String label, String spaceKey, String pageTitle)
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 pagepublic void rpcAddLabelToSpace(String token, String label, String spaceKey)
token
- the token identifying the userlabel
- the label name (namespaces allowed)spaceKey
- the space keypublic List rpcGetPageLabels(String token, long pageId)
token
- the authentication tokenpageId
- the ID of the page
public List rpcGetPageLabels(String token, String spaceKey, String pageTitle)
token
- the authentication tokenspaceKey
- the key of the space the Page is located inpageTitle
- the title of the Page
public void rpcRemoveLabelFromPage(String token, String label, long pageId)
token
- the authentication tokenlabel
- the label name to be removedpageId
- the page ID of the page with the labelpublic void rpcRemoveLabelFromPage(String token, String label, String spaceKey, String pageTitle)
public void rpcRemoveLabelFromSpace(String token, String label, String spaceKey)
token
- the token identifying the userlabel
- the label name (namespaces allowed)spaceKey
- the space keypublic void createUserViaHelper(String token, String username, String password, String fullName, 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 userpublic void createUserViaHelper(User user)
public void viewUser(String name)
public void removePersonalSpace(String username)
public void removeUserViaHelper(String username)
username
- the username of the user to removepublic void removeTestUser1ViaHelper(String token)
token
- the authentication tokenpublic void removeUser(String username)
public void removeTestUser1()
public void createGroupViaHelper(String groupName)
groupName
- the name of the group to be createdpublic void createGroup(String group)
public void addUserToGroupViaHelper(String username, String groupname)
username
- the username of the user to be addedgroupname
- the group the user should be added topublic void removeUserFromGroupViaHelper(String username, String groupname)
username
- the username of the user to be removedgroupname
- the name of the group the user should be removed frompublic Vector rpcGetUserGroups(String token, String username)
public void rpcRemoveGroup(String groupname)
groupname
- the group to be removedpublic void removeGroup(String groupName)
public void viewPeopleDirectory()
public void viewGlobalAdmin()
public GlobalPermissions viewGlobalPermissions()
public void viewLanguages()
public SpaceAdmin viewSpaceAdmin()
public void viewSpaceSummary()
public void viewSpaceSummary(String spaceKey)
public void viewSpacePermissions(String spaceKey)
viewSpacePermissions(com.atlassian.confluence.it.Space)
instead
public SpacePermissions viewSpacePermissions(Space space)
public void viewHomepage()
public void viewSpaceContent()
public void viewTrash()
public void setThreadedComments(boolean enable)
public void setSharedMode(boolean enable)
public void grantGlobalBrowsePermissionToGroup(String groupName)
GlobalPermissions.grantPermission(GlobalPermission, Group)
instead
public void grantGlobalPermissionToGroup(String permissionType, String groupName)
GlobalPermissions.grantPermission(GlobalPermission, Group)
instead
public void grantGlobalPermissionToUser(String permissionType, String userName)
GlobalPermissions.grantPermission(GlobalPermission, User)
instead
public void revokeGlobalPermissionFromUser(String permissionType, User user)
GlobalPermissions.revokePermission(GlobalPermission, Entity)
instead
permissionType
- the permission type to removeuser
- who will lose the permissionpublic void revokeGlobalPermissionFromGroup(String permissionType, String groupName)
GlobalPermissions.revokePermission(GlobalPermission, Entity)
instead
permissionType
- the permissiont typegroupName
- the group to remove the permission frompublic void ensureTestUserCanViewTestSpace()
SpacePermissions.grantPermission(com.atlassian.confluence.it.SpacePermission, User)
(which already ensures that users can view a space before other permissions are granted)
public void editSpacePermsForm()
public void enableAnonymousAccess()
public void disableAnonymousAccess()
public void enableAnonymousAccessToSpace(String spaceKey)
public void disableAnonymousAccessToSpace(String spaceKey)
public void addAnonymousPermissionsToSpace(String spaceKey, Vector permissions)
public void removeAnonymousPermissionToSpace(String spaceKey, String permission)
public void rpcGrantSpacePermission(String token, String permission, String username, 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 inpublic void rpcGrantGlobalPermission(String token, String permission, String entityName)
token
- the authentication tokenpermission
- the String corresponding to the permissionentityName
- the username or group name to grant the permission topublic void rpcRemoveSpacePermission(String token, String permission, String username, 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 inpublic void rpcRemoveGlobalPermissions(String token, String permission, String username)
token
- the authentication tokenpermission
- the String corresponding to the permissionusername
- the user to remove the permission frompublic void rpcGrantViewSpacePermission(String token, String entityName, String spaceKey)
token
- the authentication tokenentityName
- the username or group namespaceKey
- the key of the Space to grant the permission inpublic void grantViewSpacePermissionToUser(String spaceKey, String username)
SpacePermissions.grantPermission(com.atlassian.confluence.it.SpacePermission, User)
instead
public void grantViewSpacePermissionToGroup(String spaceKey, String groupName)
SpacePermissions.grantPermission(com.atlassian.confluence.it.SpacePermission, Group)
instead
public void grantViewSpacePermissionToGroupAndDelegate(String spaceKey, String groupName)
public void grantSpacePermissionToGroup(String spaceKey, String permissionType, 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.public void grantSpacePermissionToGroupAndDelegate(String spaceKey, String permissionType, String groupName)
public void grantSpacePermissionToUser(String spaceKey, String permissionType, 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.public void grantSpacePermissionToUserAndDelegate(String spaceKey, String permissionType, String userName)
spaceKey
- to grant the space permission topermissionType
- to grantuserName
- the name of the user to grant the permission to.public void revokeSpacePermissionFromGroup(String spaceKey, String permissionType, 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.public void revokeSpacePermissionFromUser(String spaceKey, String permissionType, 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.public void rpcGrantAnonymousSpacePermission(String token, String permission, String spaceKey)
token
- the token identifying the current userpermission
- the permission to give the anonymous userspaceKey
- the space to grant the permission onpublic void rpcRemoveAnonymousSpacePermission(String token, String permission, String spaceKey)
token
- the token identifying the current userpermission
- the permission to removespaceKey
- the space to remove the permission on@Deprecated public Object xmlRpcExecute(String method, Vector params)
ConfluenceRpc.execute(String, Object...)
or ConfluenceRpc.executeFuncTest(String, Object...)
instead.
method
- the method Nameparams
- the method parameters
public void attachFile(File attachment)
attachment
- the file attachmentpublic void attachFile(File attachment, String comment)
attachment
- the file attachmentcomment
- the comment for the attachmentpublic void attachFileWithName(String fileName, InputStream in, String contentType, String comment)
fileName
- the filename to attachin
- the stream to read the filecontentType
- the content type of the attachmentcomment
- a comment for this attachmentpublic void createMail(File mail, String spaceKey)
public void setAttachmentMaxUploadSize(long max)
public void setMaxAttachmentsInUI(long max)
public void search(String query)
public String getAppContext()
public void importMailAndAssertNoRunningTask(String filePath, String spaceKey)
filePath
- the file path to the mailboxspaceKey
- the space key to import intopublic void importMail(String filePath, String spaceKey)
filePath
- the file path to the mailboxspaceKey
- the space key to import intopublic void addSpaceLabel(String labelName)
public void renamePage(String spaceKey, String originalPageTitle, String newPageTitle)
public void viewSpaceAdvanced()
public void grantAnonymousUseConfluencePermission()
public void revokeAnonymousUseConfluencePermission()
public void showAllUsers()
public ViewContentBean addWatchPage() throws Exception
Exception
public ViewContentBean watchPage(String spaceKey, String pageTitle)
public void watchSpace(String spaceKey)
public void watchSpace(Space space)
public File generateFile(String filename, String contents)
public int getCurrentMailQueueSize()
public void importGlobalBackup(String importZipLocation, boolean waitForSuccess) throws InterruptedException
Importer
instead.
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
InterruptedException
protected void importGlobalBackup(File backupFile, boolean waitForSuccess) throws InterruptedException
Importer
instead.
backupFile
- the backup file to import.waitForSuccess
- synchronously wait for the export to complete
InterruptedException
Importer.importGlobalBackup(File, TimePeriod, DirectoryConfiguration, AdminConsole)
protected void importSpaceBackup(String importZipLocation, boolean waitForSuccess) throws InterruptedException
Importer
instead.
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
InterruptedException
protected void rpclogCommandOutput(String commandString) throws InterruptedException, org.apache.xmlrpc.XmlRpcException
InterruptedException
org.apache.xmlrpc.XmlRpcException
public void setViewPermissionsForUsers(String spaceKey, String pageTitle, String users)
ConfluenceRpc.grantContentPermission(com.atlassian.confluence.it.content.security.ContentPermission, ContentEntity)
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.public void setViewPermissionsForGroups(String spaceKey, String pageTitle, String groups)
ConfluenceRpc.grantContentPermission(com.atlassian.confluence.it.content.security.ContentPermission, ContentEntity)
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.public void setEditPermissionsForUsers(String spaceKey, String pageTitle, String users)
ConfluenceRpc.grantContentPermission(com.atlassian.confluence.it.content.security.ContentPermission, ContentEntity)
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.public void setEditPermissionsForGroups(String spaceKey, String pageTitle, String groups)
ConfluenceRpc.grantContentPermission(com.atlassian.confluence.it.content.security.ContentPermission, ContentEntity)
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.public void removePageOrBlogById(long id)
public String getBaseUrl()
getConfiguredBaseUrl()
method.
@Deprecated public void addComment(String spaceKey, String pageTitle, String comment)
ViewContentBean.addComment()
instead.
public JSONObject setPageLabels(String spaceKey, String pageTitle, String labels) throws JSONException
spaceKey
- the space keypageTitle
- the page titlelabels
- the labels
JSONException
public JSONObject setBlogLabels(String spaceKey, String blogTitle, String labels) throws JSONException
spaceKey
- the space keyblogTitle
- the blog titlelabels
- the labels
JSONException
public void removePageLabel(String spaceKey, String pageTitle)
public void editPageContent(String content)
content
- public void editPageContentViaForm(String content)
content
- public void editBlogLabels(String labels)
public void editPageWithContent(String spaceKey, String title, String content)
public void gotoPageWithError(String url)
public void assertImageValid(String imgSrc, String imgAlt)
createUrl(String, URL)
assertImageValid
in class ThreadLocalWebTestCase
ThreadLocalWebTestCase.assertImageValidAndStore(String, String, java.io.File)
public void assertImagePresent(String imageName)
ThreadLocalWebTestCase.assertImagePresent(String, String)
that asserts the image name with
a contains check rather than equals.
public boolean isClustered()
public String getFriendlyRelativeDate(Date now, 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
public void forceViewGlobalAdmin()
protected void createTestMailServer() throws Exception
tearDown()
.
Exception
public void stopTestMailServer()
public void rpcFlushMailQueue()
ConfluenceRpc.flushMailQueue()
instead.
protected void assertNoMailReceived() throws InterruptedException
InterruptedException
protected void assertMailReceived() throws InterruptedException
InterruptedException
public void rpcClearIndex()
public void rpcClearQueue(String token, String queueName)
protected void rebuildIndex() throws InterruptedException
InterruptedException
public void editSpaceDescription(User user, String spaceKey, String newDescription)
public void setApplicationConfigProperty(String propertyKey, String propertyValue)
protected void setCheckbox(boolean check, String checkBox)
protected String withParagraph(String value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |