com.atlassian.confluence
Class AbstractConfluenceAcceptanceTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.atlassian.confluence.ThreadLocalWebTestCase
              extended by com.atlassian.confluence.AbstractAtlassianWebTestCase
                  extended by com.atlassian.confluence.AbstractConfluenceAcceptanceTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractAdminAcceptanceTest, AbstractBundledThemesAcceptanceTest, AbstractLdapAcceptanceTest, AbstractMultimediaMacroAcceptanceTest, AbstractNotificationsAcceptanceTest, AbstractPermissionsAcceptanceTest, AbstractRpcAcceptanceTest, AbstractSoapRpcAcceptanceTest, ActionAutowireSecurityAcceptanceTest, AddPageAcceptanceTest, AddPageSecurityAcceptanceTest, AdminForceUpgradeAcceptanceTest, AntiXSSAcceptanceTest, AtlassianSecurityAcceptanceTest, AtlassianUserUpgradeAcceptanceTest, AttachedImagesJsonAcceptanceTest, AttachmentAcceptanceTest, AttachmentUploadAcceptanceTest, BackupAndRestoreXsrfAcceptanceTest, BackupImportAcceptanceTODOTest, BasicSoapAcceptanceTest, BigAcceptanceTest, BlogAcceptanceTest, BlogSlowAcceptanceTest, BrowseMenuAcceptanceTest, BrowserLanguageAcceptanceTest, BrowseSpaceAcceptanceTest, BundledPluginsAcceptanceTest, CacheSizeChangeAcceptanceTest, CaptchaAcceptanceTest, ClasspathAcceptanceTest, ColourSchemeAcceptanceTest, ColourSchemeXsrfAcceptanceTest, CommentsAcceptanceTest, CommentXsrfAcceptanceTest, ConfigureLoggingAcceptanceTest, ContentNameSearchAcceptanceTest, ContentPermissionImportAcceptanceTest, CreateContentXsrfAcceptanceTest, CreateSpaceAcceptanceTest, CreateSpaceXsrfAcceptanceTest, CustomHtmlAcceptanceTest, CustomHtmlXsrfAcceptanceTest, CustomizeLogoAcceptanceTest, CustomLogoMigrationAcceptanceTest, CustomStylesheetXsrfAcceptanceTest, DarkFeaturesAcceptanceTest, DashboardActionsSpacesAcceptanceTest, DashboardActionTemplatesAcceptanceTest, DashboardRecentlyUpdatedContentMacroAcceptanceTest, DateFormatAcceptanceTest, DecoratorAcceptanceTest, DiffPagesAcceptanceTest, DraftsAcceptanceTest, DraftsXsrfAcceptanceTest, EditDefaultSpaceContentAcceptanceTest, EditLayoutsAcceptanceTest, EditSpaceAcceptanceTest, EmailAndLinkExternalizationAcceptanceTest, EmbeddedCrowdUpgradeAcceptanceTest, EmbeddedObjectAcceptanceTest, EventsAcceptanceTest, ExcerptMacroAcceptanceTest, ExternalGadgetDirectoryAcceptanceTest, FavouritePageXsrfAcceptanceTest, FavouriteSpaceXsrfAcceptanceTest, FileHandleTestingSuite.FileHandleTest, FiveHundredPageSecurityAcceptanceTest, FlushCacheAcceptanceTest, FuncTestPermissionAcceptanceTest, GadgetCustomWhitelistAcceptanceTest, GadgetWhiteListAcceptanceTest, GalleryAcceptanceTest, GeneralConfigurationAcceptanceTest, GlobalAdminAcceptanceTest, GlobalAdminXsrfAcceptanceTest, GlobalEntitiesAcceptanceTest, GlobalLogoXsrfAcceptanceTest, GlobalPermissionsXsrfAcceptanceTest, GlobalReportsAcceptanceTest, GroupMembersAcceptanceTest, GroupPickerAcceptanceTest, GzipFilterAcceptanceTest, HistoricalPageViewAcceptanceTest, HtmlExportAcceptanceTest, HttpHeadersAcceptanceTest, I18nResourceAcceptanceTest, ImportPagesFromDiskAcceptanceTest, ImportPagesXsrfAcceptanceTest, IncomingLinkAcceptanceTest, IndexingAcceptanceTest, JobPluginAcceptanceTest, JohnsonFilterAcceptanceTest, KnownBugsAcceptanceTest, LabelsAcceptanceTest, LanguageAcceptanceTest, LargeImportAcceptanceTest, LicensingAcceptanceTest, LinkTypeAcceptanceTest, ListPageAlternativesAcceptanceTest, LoggingAndProfilingXsrfAcceptanceTest, LoginAcceptanceTest, LogoutAcceptanceTest, MacroDiffAcceptanceTest, MacroMigrationAcceptanceTest, MacroPluginAcceptanceTest, MacrosAcceptanceTest, MailAcceptanceTest, MailQueueXsrfAcceptanceTest, ManageUsersAndGroupsXsrfAcceptanceTest, MovePageAcceptanceTest, MultipleAttachmentsAcceptanceTest, NetworkTabAcceptanceTest, Node, NonClusterLicensingAcceptanceTest, NotificationImportAcceptanceTest, NotificationsXsrfAcceptanceTest, OpenSearchAcceptanceTest, OrphanedPagesAcceptanceTest, PackageTemplateAcceptanceTest, PageDestinationSearchAcceptanceTest, PageEditAcceptanceTest, PageExportAcceptanceTest, PageHistoryAcceptanceTest, PageHistoryXsrfAcceptanceTest, PageInfoAcceptanceTest, PageListingAcceptanceTest, PageNotFoundAcceptanceTest, PageOperationsAcceptanceTest, PageTemplatesAcceptanceTest, PageTitlesAcceptanceTest, PageTreeMovePageAcceptanceTest, PageXsrfAcceptanceTest, PaginationAcceptanceTest, PasswordResetAcceptanceTest, PeopleDirectoryAcceptanceTest, PersonalSpaceAcceptanceTest, PlatformCtkAcceptanceTest, PluginAcceptanceTest, PluginAdminXsrfAcceptanceTest, PluginDecorationAcceptanceTest, PopularLabelsMacroAcceptanceTest, RaiseSupportRequestXsrfAcceptanceTest, RecentlyUpdatedContentMacroAcceptanceTest, RecentlyUsedLabelsMacroAcceptanceTest, RefactoringAcceptanceTest, RelatedContentRefactorerAcceptanceTest, RemoveClassicThemeAcceptanceTest, RemovePageRestrictionsXsrfAcceptanceTest, RemoveSpaceAcceptanceTest, ReportsAcceptanceTest, RestAcceptanceTest, RpcVersion1AcceptanceTest, RpcVersion2AcceptanceTest, RssAcceptanceTest, RssFeedBuilderAcceptanceTest, ScheduleJobAdminXsrfAcceptanceTest, SearchAcceptanceTest, SearchSuggestionsAcceptanceTest, SecurityAcceptanceTest, SecurityConfigurationAcceptanceTest, ServletPluginAcceptanceTest, SignupAcceptanceTest, SiteExportAcceptanceTest, SiteImportAcceptanceTest, SiteSupportAcceptanceTest, SpaceAdminAcceptanceTest, SpaceAdminXsrfAcceptanceTest, SpaceAdvancedAcceptanceTest, SpaceDetailsAcceptanceTest, SpaceExportAcceptanceTest, SpaceExportXsrfAcceptanceTest, SpaceImportAcceptanceTest, SpaceKeyDirectoryTraversalAcceptanceTest, SpaceLabelsAcceptanceTest, SpaceLogoXsrfAcceptanceTest, SpacePermissionsXsrfAcceptanceTest, SpacesListMacroAcceptanceTest, SpacesListMacroAcceptanceTest, SpaceTemplateAcceptanceTest, SpringPluginUploadAcceptanceTest, StylesheetAcceptanceTest, SuperbatchAcceptanceTest, SupportRequestAcceptanceTest, SupportToolsPluginAcceptanceTest, SupportUtilityAcceptanceTest, SystemInformationAcceptanceTest, TestRequestLicenseFromMac, ThemeChangeAcceptanceTest, ThemesXsrfAcceptanceTest, ThreadedCommentAcceptanceTest, ThumbnailAcceptanceTest, TimeZoneAcceptanceTest, TrackbackAcceptanceTest, TrashCanAcceptanceTest, TrustedApplicationAcceptanceTest, TrustedApplicationXsrfAcceptanceTest, UndefinedPagesAcceptanceTest, UpdateLicenseDetailsXsrfAcceptanceTest, UpdateStatusXsrfAcceptanceTest, UPMAcceptanceTest, UserFollowAcceptanceTest, UserFollowXsrfAcceptanceTest, UserHoverAcceptanceTest, UserMacrosAcceptanceTest, UserManagementAcceptanceTest, UserMenuAcceptanceTest, UserPickerAcceptanceTest, UserPreferencesAcceptanceTest, UserProfileAcceptanceTest, UserProfilePictureXsrfAcceptanceTest, UserProfileXsrfAcceptanceTest, UserStatusAcceptanceTest, ViewSourceAcceptanceTest, WebItemPluginAcceptanceTest, WebPanelAcceptanceTest, WebResourceTransformerAcceptanceTest, WebSudoAcceptanceTest, WelcomeMessageAcceptanceTest, WordExportAcceptanceTest

public abstract class AbstractConfluenceAcceptanceTest
extends AbstractAtlassianWebTestCase

This super class provides Confluence specific functions useful in acceptance tests.


Field Summary
protected  AdminConsole adminConsole
           
protected  String adminToken
           
static String ANONYMOUS_USER
           
protected static SimpleDateFormat BLOG_DATE_FORMAT
           
protected static String BROWSE_MENU_LINK_ID
           
static String CONFLUENCE_ADMIN_GROUP
           
static String CONFLUENCE_USERS_GROUP
           
static String context
           
protected static boolean CROWD_MODE
           
protected static DirectoryConfiguration DIRECTORY_CONFIG
           
protected  List<File> filesToDelete
           
protected  org.slf4j.Logger log
           
protected  LogAdjuster logAdjuster
          Can be used by subclasses to turn logging on the server up or down for just one test.
protected  MailServices mailServices
           
static RandomnessHandler RANDOM
           
protected  ConfluenceRpc rpc
           
protected static String SMTP_SUBJECT_PREFIX
           
static User TEST_ADMIN
           
static String TEST_ADMIN_EMAIL
           
static String TEST_ADMIN_FULLNAME
           
static String TEST_ADMIN_PASSWORD
           
static String TEST_ADMIN_USERNAME
           
 BlogPost TEST_BLOG
           
 Comment TEST_COMMENT
           
static String TEST_GEN_EMAIL1
           
static String TEST_GEN_EMAIL2
           
static String TEST_GEN_FULLNAME1
           
static String TEST_GEN_FULLNAME2
           
static String TEST_GEN_PASSWORD1
           
static String TEST_GEN_PASSWORD2
           
static String TEST_GEN_USERNAME1
           
static String TEST_GEN_USERNAME2
           
protected static String TEST_GROUP1
           
 Page TEST_PAGE
           
static Space TEST_SPACE
           
static Space TEST_SPACE2
           
static User TEST_USER1
           
static User TEST_USER2
           
static String TESTBLOG_CONTENT
           
static String TESTBLOG_TITLE
           
static String TESTMAILSERVER_HOSTNAME
           
static String TESTMAILSERVER_NAME
           
static String TESTPAGE_COMMENT
           
static String TESTPAGE_CONTENT
           
static String TESTPAGE_TITLE
           
static String TESTSPACE_DESCRIPTION
           
static String TESTSPACE_KEY
           
static String TESTSPACE_TITLE
           
static String TESTSPACE2_DESCRIPTION
           
static String TESTSPACE2_KEY
           
static String TESTSPACE2_TITLE
           
protected  String testUser2Token
           
protected  String testUserToken
           
protected  UserManagementHelper userHelper
           
protected static String VIEW_PERSONAL_SPACE_LINK
           
protected  ConfluenceRpc wikiMarkupRpc
          Use this for tests where you want to create pages/comments/blogs using wikimarkup.
protected  org.apache.xmlrpc.XmlRpcClient xmlrpc
          Deprecated. use rpc instead.
 
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 com.atlassian.confluence.AbstractAtlassianWebTestCase
assertCollectionContainsKeyWithValue, assertContains, assertContainsRegex, assertDoesNotContain, assertEndsWith, assertLinkNotPresentWithHrefContaining, assertLinkPresentWithHref, assertLinkPresentWithHrefContaining, assertLinkPresentWithTextAndHref, assertPageTitleEquals, assertServerResponseContains, assertServerResponseDoesNotContain, assertStartsWith, assertStatusCode, assertTextPresentInPageSource, assertTextsPresentInOrder, assertTextsPresentInOrder, assertTitleEquals, assertTitleEquals, getGroupFromResponse, setTextFieldUnlessBlank
 
Methods inherited from class com.atlassian.confluence.ThreadLocalWebTestCase
assertButtonNotPresent, assertButtonNotPresentWithText, assertButtonPresent, assertButtonPresentWithText, assertCheckboxNotPresent, assertCheckboxNotPresent, assertCheckboxNotSelected, assertCheckboxNotSelected, assertCheckboxPresent, assertCheckboxPresent, assertCheckboxSelected, assertCheckboxSelected, assertCookiePresent, assertCookieValueEquals, assertCookieValueMatch, assertDownloadedFileEquals, assertElementNotPresent, assertElementNotPresentByXPath, assertElementPresent, assertElementPresentByXPath, 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, assertLinkPresent, assertLinkPresentWithExactText, assertLinkPresentWithExactText, assertLinkPresentWithImage, assertLinkPresentWithText, 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, assertTextNotPresent, 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, removeThreadLocal, reset, runBare, saveAs, selectOption, selectOptionByValue, selectOptions, selectOptionsByValues, setDialog, setExpectedJavaScriptAlert, setExpectedJavaScriptAlert, setExpectedJavaScriptConfirm, setExpectedJavaScriptConfirm, setExpectedJavaScriptPrompt, setExpectedJavaScriptPrompt, setFormElement, setScriptingEnabled, setTestContext, setTester, setTestingEngineKey, setTextField, setWorkingForm, setWorkingForm, setWorkingForm, submit, submit, submit, uncheckCheckbox, uncheckCheckbox, wrapWithPageSourceOnError
 
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

log

protected final transient org.slf4j.Logger log

context

public static final String context

DIRECTORY_CONFIG

protected static final DirectoryConfiguration DIRECTORY_CONFIG

CROWD_MODE

protected static final boolean CROWD_MODE

TEST_ADMIN

public static final User TEST_ADMIN

TEST_ADMIN_USERNAME

public static final String TEST_ADMIN_USERNAME

TEST_ADMIN_PASSWORD

public static final String TEST_ADMIN_PASSWORD

TEST_ADMIN_FULLNAME

public static final String TEST_ADMIN_FULLNAME

TEST_ADMIN_EMAIL

public static final String TEST_ADMIN_EMAIL

TEST_USER1

public static final User TEST_USER1

TEST_GEN_USERNAME1

public static final String TEST_GEN_USERNAME1

TEST_GEN_PASSWORD1

public static final String TEST_GEN_PASSWORD1

TEST_GEN_FULLNAME1

public static final String TEST_GEN_FULLNAME1

TEST_GEN_EMAIL1

public static final String TEST_GEN_EMAIL1

TEST_USER2

public static final User TEST_USER2

TEST_GEN_USERNAME2

public static final String TEST_GEN_USERNAME2

TEST_GEN_PASSWORD2

public static final String TEST_GEN_PASSWORD2

TEST_GEN_FULLNAME2

public static final String TEST_GEN_FULLNAME2

TEST_GEN_EMAIL2

public static final String TEST_GEN_EMAIL2

ANONYMOUS_USER

public static final String ANONYMOUS_USER
See Also:
Constant Field Values

CONFLUENCE_USERS_GROUP

public static final String CONFLUENCE_USERS_GROUP

CONFLUENCE_ADMIN_GROUP

public static final String CONFLUENCE_ADMIN_GROUP

TEST_GROUP1

protected static final String TEST_GROUP1
See Also:
Constant Field Values

TEST_SPACE

public static final Space TEST_SPACE

TESTSPACE_TITLE

public static final String TESTSPACE_TITLE

TESTSPACE_KEY

public static final String TESTSPACE_KEY

TESTSPACE_DESCRIPTION

public static final String TESTSPACE_DESCRIPTION

TEST_SPACE2

public static final Space TEST_SPACE2

TESTSPACE2_TITLE

public static final String TESTSPACE2_TITLE

TESTSPACE2_KEY

public static final String TESTSPACE2_KEY

TESTSPACE2_DESCRIPTION

public static final String TESTSPACE2_DESCRIPTION

TESTPAGE_TITLE

public static final String TESTPAGE_TITLE
See Also:
Constant Field Values

TESTPAGE_CONTENT

public static final String TESTPAGE_CONTENT
See Also:
Constant Field Values

TESTPAGE_COMMENT

public static final String TESTPAGE_COMMENT
See Also:
Constant Field Values

TESTBLOG_TITLE

public static final String TESTBLOG_TITLE
See Also:
Constant Field Values

TESTBLOG_CONTENT

public static final String TESTBLOG_CONTENT
See Also:
Constant Field Values

TEST_PAGE

public Page TEST_PAGE

TEST_BLOG

public BlogPost TEST_BLOG

TEST_COMMENT

public Comment TEST_COMMENT

TESTMAILSERVER_NAME

public static final String TESTMAILSERVER_NAME
See Also:
Constant Field Values

TESTMAILSERVER_HOSTNAME

public static final String TESTMAILSERVER_HOSTNAME

RANDOM

public static final RandomnessHandler RANDOM

BLOG_DATE_FORMAT

protected static final SimpleDateFormat BLOG_DATE_FORMAT

BROWSE_MENU_LINK_ID

protected static final String BROWSE_MENU_LINK_ID
See Also:
Constant Field Values

SMTP_SUBJECT_PREFIX

protected static final String SMTP_SUBJECT_PREFIX
See Also:
Constant Field Values

xmlrpc

@Deprecated
protected org.apache.xmlrpc.XmlRpcClient xmlrpc
Deprecated. use rpc instead.

wikiMarkupRpc

protected ConfluenceRpc wikiMarkupRpc
Use this for tests where you want to create pages/comments/blogs using wikimarkup.


rpc

protected ConfluenceRpc rpc

adminToken

protected String adminToken

testUserToken

protected String testUserToken

testUser2Token

protected String testUser2Token

filesToDelete

protected List<File> filesToDelete

userHelper

protected UserManagementHelper userHelper

mailServices

protected MailServices mailServices

adminConsole

protected AdminConsole adminConsole

VIEW_PERSONAL_SPACE_LINK

protected static final String VIEW_PERSONAL_SPACE_LINK
See Also:
Constant Field Values

logAdjuster

protected LogAdjuster logAdjuster
Can be used by subclasses to turn logging on the server up or down for just one test. LogAdjuster.resetLogLevels() is called in tearDown().

Constructor Detail

AbstractConfluenceAcceptanceTest

public AbstractConfluenceAcceptanceTest(String testName)

AbstractConfluenceAcceptanceTest

public AbstractConfluenceAcceptanceTest()
Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

setUpTestNG

protected void setUpTestNG(Method method)
                    throws Exception
Called by TestNG, calls setUp() on the current class, prevents the need to put this annotation everywhere, and sets the test name properly.

Throws:
Exception

setUp

protected void setUp(String beginAt)
              throws Exception
Default setUp method. Establishes XML-RPC connection and sets the base URL. Also configures LDAP repository.

Parameters:
beginAt - the initial path (relative to the context path) to begin at
Throws:
Exception - from super

getPluginHelper

protected PluginHelper getPluginHelper()

tearDownTestNG

protected void tearDownTestNG(Method method)
                       throws Exception
Called by TestNG, calls tearDown() on the current class, prevents the need to put this annotation everywhere, and sets the test name properly.

Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Default tearDown method. Removes any files which were added to the filesToDelete list.

Overrides:
tearDown in class ThreadLocalWebTestCase
Throws:
Exception

generateBaseUrl

protected String generateBaseUrl()
Returns:
a random base URL selected from the nodes in the cluster. Used for switching between nodes for cluster testing.

chooseRandomBaseUrl

public String chooseRandomBaseUrl()
Selects a baseurl from the available specified base urls. Base urls are specified by properties of the form baseurl, baseurl2 etc. The randomness is introduced by 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.

Returns:
a randomly selected baseurl or null if no baseurls are specified.

getConfiguredBaseUrl

public String getConfiguredBaseUrl()
Returns the configured base URL in the Confluence app. This is the same as the base URL of node #1 in a cluster.

Returns:
it

shutdownQuartz

public void shutdownQuartz()

rpcPauseJob

public void rpcPauseJob(String jobName)

rpcResumeJob

public void rpcResumeJob(String jobName)

rpcTriggerJob

public void rpcTriggerJob(String jobName)

rpcFlushAllCaches

protected void rpcFlushAllCaches(String token)
                          throws IOException,
                                 org.apache.xmlrpc.XmlRpcException
Deprecated. use ConfluenceRpc.flushAllCaches() instead.

Flush all the caches via rpc. Note that this clears all the cached rpc tokens.

Parameters:
token - of the user who is flushing the caches.
Throws:
IOException - e
org.apache.xmlrpc.XmlRpcException - e

rpcFlushIndexQueue

@Deprecated
public void rpcFlushIndexQueue()
Deprecated. use ConfluenceRpc.flushIndexQueue() instead.


logInAs

public void logInAs(String username,
                    String password)

loginAs

public void loginAs(User user)

logInAsAtDashboard

public void logInAsAtDashboard(String username,
                               String password)

loginAsAtDashboard

public void loginAsAtDashboard(User user)

logIn

public void logIn(User user)
Log in as the specified user, going to the default start page.

Parameters:
user - the user to log in as.

logIn

public 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.

Parameters:
user - the user to log in as.
destination - where to go after logging in. Pass 'null' to go to the default homepage.

logInAs

public void logInAs(String username,
                    String password,
                    boolean rememberMe)

loginViaForm

protected void loginViaForm(String username,
                            String password,
                            boolean rememberMe)

logInAsAdminAtDashboard

public void logInAsAdminAtDashboard()

loginAsTestUser

public void loginAsTestUser()

loginAsTestUserAtDashboard

public void loginAsTestUserAtDashboard()

loginAsTestUser2

public void loginAsTestUser2()

logout

public void logout()

assertLoggedInAs

public void assertLoggedInAs(String username)
Deprecated. since 4.0. Use LoginHelper.isLoggedInAs(String) and assertTrue.


assertLinkPresentWithExactTextAndClass

public void assertLinkPresentWithExactTextAndClass(String linkText,
                                                   String cls)

rpcGetUserToken

public String rpcGetUserToken(User user)

rpcGetUserToken

public String rpcGetUserToken(String username,
                              String password)
Retrieves the user token for the given details, for use with the XML-RPC interface

Parameters:
username - the username
password - the password
Returns:
Token for the logged in user

rpcGetLocalisedText

public String rpcGetLocalisedText(String messageKey)
Returns the localised message text for the given key, retrieved from the application via RPC. The message will be localised to the administrator's locale.

If the key is not found, the key itself will be returned, as per ConfluenceActionSupport.getText(String).

Parameters:
messageKey - the message key to internationalise.
Returns:
a localised message in the administrator's locale
See Also:
FuncTestRpcHandler.getLocalisedText(String, String), ConfluenceActionSupport.getText(String)

rpcGetMailQueueSize

public int rpcGetMailQueueSize()

rpcGetAdminToken

public String rpcGetAdminToken()
Retrieves a token for the admin user

Returns:
Token for the admin user

rpcLogOutAdmin

public void rpcLogOutAdmin()

rpcLogOut

public void rpcLogOut(String token)

rpcGetTestUserToken

public String rpcGetTestUserToken()
Retrieves a token for the test user

Returns:
Token for the test user

rpcGetTestUser2Token

public String rpcGetTestUser2Token()
Retrieves a token for the test user 2

Returns:
Token for the test user

makeParams

@Deprecated
public static Vector<Object> makeParams(Object... params)
Deprecated. Use rpc instead.

Convert the given params into a Vector.

Parameters:
params - the params.
Returns:
the vector.

rpcCreateSpace

@Deprecated
public Hashtable rpcCreateSpace(String token,
                                           String key,
                                           String name,
                                           String description)
Deprecated. Use ConfluenceRpc.createSpace(com.atlassian.confluence.it.Space) instead.


rpcCreateSpace

@Deprecated
public Hashtable rpcCreateSpace(String token,
                                           String key,
                                           String name,
                                           String description,
                                           String spaceGroup)
Deprecated. Use ConfluenceRpc.createSpace(com.atlassian.confluence.it.Space) instead.

Creates a space via the XML-RPC interface

Parameters:
token - the authentication token
key - the key of the Space
name - the name of the Space
description - the description of the Space
spaceGroup - the space group key, can be null
Returns:
the space as a hashtable

rpcCreateSpaceGroup

public Hashtable rpcCreateSpaceGroup(String token,
                                     String key,
                                     String name)

rpcCreatePersonalSpace

public Hashtable rpcCreatePersonalSpace(String token,
                                        String name,
                                        String description,
                                        String username)
Creates a personal space via the XML-RPC interface

Parameters:
token - the authentication token
name - the name of the Space
description - the description of the Space
username - name of the user to own the space
Returns:
the space as a hashtable

rpcCreateTestSpace

public 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

Parameters:
token - the authentication token
Returns:
the space as a hash table

rpcCreateTestSpace2

public 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

Parameters:
token - the authentication token
Returns:
the space as a hashtable

rpcHasGroup

public boolean rpcHasGroup(String token,
                           String groupName)

rpcHasUser

public boolean rpcHasUser(String token,
                          String username)

createSpaceViaWebUI

public void createSpaceViaWebUI(String key,
                                String name,
                                String description)

createSpaceViaWebUI

public void createSpaceViaWebUI(String key,
                                String name,
                                String description,
                                String spaceGroupKey)

createSpaceViaWebUI

public void createSpaceViaWebUI(Space space)

createTestSpaceViaWebUI

public 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)


rpcRemoveSpace

@Deprecated
public void rpcRemoveSpace(String token,
                                      String spaceKey)
Deprecated. use ConfluenceRpc.removeSpace(String) instead.

Remove a space with the given key via the XML-RPC interface

Parameters:
token - the authentication token
spaceKey - the space to remove

rpcRemoveAllSpaceGroups

protected void rpcRemoveAllSpaceGroups(String token)
                                throws IOException,
                                       org.apache.xmlrpc.XmlRpcException
Throws:
IOException
org.apache.xmlrpc.XmlRpcException

rpcCreatePage

@Deprecated
public long rpcCreatePage(String token,
                                     String spaceKey,
                                     String title,
                                     String content)
Deprecated. use ConfluenceRpc.createPage(String, String, String, long) instead.

Creates a page via the XML-RPC interface

Parameters:
token - the authentication token
spaceKey - the key for the space the page will be created in
title - the title of the new page
content - the content of the new page
Returns:
the page id

rpcCreatePage

@Deprecated
public long rpcCreatePage(String token,
                                     String spaceKey,
                                     String title,
                                     String content,
                                     long parentPageId)
Deprecated. use ConfluenceRpc.createPage(String, String, String, long) instead.

Creates a page via the XML-RPC interface

Parameters:
token - the authentication token
spaceKey - the key for the space the page will be created in
title - the title of the new page
content - the content of the new page
parentPageId - the id of the parent page, 0 if none.
Returns:
the page id

rpcCreateXhtmlPage

public long rpcCreateXhtmlPage(String token,
                               String spaceKey,
                               String title,
                               String content)

rpcRemovePage

@Deprecated
public void rpcRemovePage(String token,
                                     String spaceKey,
                                     long pageId)
Deprecated. use ConfluenceRpc.removePage(long) instead.


rpcRestoreAbstractPage

public void rpcRestoreAbstractPage(long id)

rpcRemoveAttachment

public void rpcRemoveAttachment(String token,
                                String attachmentFileName,
                                long contentId)
Remove an attachment from a page or blog.

Parameters:
attachmentFileName - The name of the attachment
contentId - the id of the page or blogpost to which the file is currently attached

rpcGetChildren

public Vector rpcGetChildren(String token,
                             long pageId)
Returns the ordered id list of pages that are direct children of a given page.

Parameters:
token - the authentication token
pageId - the page to find children for
Returns:
List of page id Longs

rpcGetTopLevelPages

public Vector rpcGetTopLevelPages(String token,
                                  String spaceKey)
Returns the ordered id list of top-level pages in a given space.

Parameters:
token - the authentication token
spaceKey - the key of the space to find top-level pages for
Returns:
List of page id Longs

rpcMovePage

protected void rpcMovePage(String token,
                           long sourcePageId,
                           long targetPageId,
                           String position)
                    throws org.apache.xmlrpc.XmlRpcException
Moves a page to a location relative to another page.

Parameters:
token - the authentication token
sourcePageId - the id of the page being moved
targetPageId - the id of the page the source page is moved in relation to
position - the relative position to move to, see MovePageCommand
Throws:
org.apache.xmlrpc.XmlRpcException

rpcMovePageToTopLevel

public void rpcMovePageToTopLevel(String token,
                                  long pageId,
                                  String targetSpaceKey)
Moves a page to the top of a given space.

Parameters:
token - the authentication token
pageId - the id of the page being moved
targetSpaceKey - the space to move the page to

createPage

public ViewContentBean createPage(String spaceKey,
                                  String title,
                                  String content,
                                  String parentPageTitle)

createPageWithViewRestrictions

public ViewContentBean createPageWithViewRestrictions(String spaceKey,
                                                      String title,
                                                      String content,
                                                      String parentPageTitle,
                                                      String viewPermissionUsers)

rpcGetPageId

public long rpcGetPageId(String token,
                         String spaceKey,
                         String pageTitle)
Retrieves the page ID for a page with the given details

Parameters:
token - the authentication token
spaceKey - the key of the Space the Page is located in
pageTitle - the title of the page
Returns:
The ID of the page

rpcGetVersionForPage

public int rpcGetVersionForPage(String token,
                                long pageId)

getPageId

public long getPageId(String spaceKey,
                      String title)

getCurrentPageId

protected long getCurrentPageId()

viewPage

public ViewContentBean viewPage(String spaceKey,
                                String pageTitle)

viewLabel

public void viewLabel(String spaceKey,
                      String labelName)

rpcEditPage

public 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

Modifies the page with the given details via the XML-RPC interface

Parameters:
token - the authentication token
spaceKey - the key of the Space the Page is in
pageTitle - the current title of the Page
newTitle - the new title of the Page (null if the same)
newContent - the new content of the Page (null if the same)

editPage

public EditContentBean editPage(String spaceKey,
                                String pageTitle)

movePageToNewSpace

public void movePageToNewSpace(String spaceKey,
                               String title,
                               String newSpaceKey)

movePage

public void movePage(String spaceKey,
                     String title,
                     String newSpaceKey)

movePage

public void movePage(String title,
                     Space oldSpace,
                     Space newSpace)

movePageToNewParent

public void movePageToNewParent(String spaceKey,
                                String title,
                                String newParentPage)

movePageToNewParent

public void movePageToNewParent(String oldSpaceKey,
                                String title,
                                String newSpaceKey,
                                String newParentPage)

rpcTrashPage

public void rpcTrashPage(String token,
                         String pageId)
Trashes (removes) a page with the given ID

Parameters:
token - the authentication token
pageId - ID of the page to be trashed

rpcTrashPage

public 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

Parameters:
token - the authentication token
pageId - ID of the page to be trashed

rpcTrashPage

public 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

Parameters:
token - the authentication token
spaceKey - key of the Space the page is in
pageTitle - title of the page to be trashed

rpcRenderContent

public void rpcRenderContent(String token,
                             String spaceKey,
                             long pageId,
                             String newContent)
                      throws org.apache.xmlrpc.XmlRpcException,
                             IOException
Throws:
org.apache.xmlrpc.XmlRpcException
IOException

rpcCreateBlogPost

public long rpcCreateBlogPost(String token,
                              String spaceKey,
                              String postTitle,
                              String postContent)
Creates a new blog entry via the XML-RPC interface

Parameters:
token - the authentication token
spaceKey - the key of the Space the blog entry will be created in
postTitle - the title of the post to be created
postContent - the content of the post to be created
Returns:
returns the id of the new blogpost

rpcCreateBlogPost

public long rpcCreateBlogPost(String token,
                              String spaceKey,
                              String postTitle,
                              String postContent,
                              Date lastModification)

createBlogInTestSpace

public void createBlogInTestSpace(String title,
                                  String body)

createBlog

public void createBlog(String spaceKey,
                       String spaceTitle,
                       String title,
                       String body)

editBlog

public void editBlog(String spaceKey,
                     String title,
                     String content)

rpcEditBlogPost

public void rpcEditBlogPost(String token,
                            long entryId,
                            String newTitle,
                            String newContent)
Modifies the page with the given details via the XML-RPC interface

Parameters:
token - the authentication token
entryId - the ID of the blog entry
newTitle - the new title of the Blog Post (null if the same)
newContent - the new content of the Blog Post (null if the same)

viewEditBlogPostPage

public void viewEditBlogPostPage(long entryId)
Views the edit blog post page for the post with the given ID

Parameters:
entryId - the ID of the blog post

rpcGetBlogPostId

public long rpcGetBlogPostId(String token,
                             String spaceKey,
                             int dayOfMonth,
                             String postTitle)
Retrieves the ID of a blog post with the given details

Parameters:
token - the authentication token
spaceKey - the key of the Space the blog post is located int
dayOfMonth - the day of the month the blog post was made
postTitle - the title of the blog post
Returns:
ID of the post

viewTodaysBlog

public ViewContentBean viewTodaysBlog(String spaceKey,
                                      String title)

getTodaysBlogPostDate

public String getTodaysBlogPostDate()

viewBlog

public void viewBlog(String spaceKey,
                     String datePath,
                     String title)

createTemplate

public void createTemplate(String spaceName,
                           String templateTitle,
                           String templateDescription,
                           String templateContent)

rpcAddComment

public Hashtable rpcAddComment(String token,
                               long pageId,
                               String comment)
Adds a comment to a page via the XML-RPC interface

Parameters:
token - the authentication token
pageId - the ID of the page to add the comment to
comment - the text of the comment
Returns:
the comment as a hash table

rpcAddComment

public Hashtable rpcAddComment(String token,
                               long pageId,
                               long parentCommentId,
                               String comment)
Adds a comment to a page via the XML-RPC interface

Parameters:
token - the authentication token
pageId - the ID of the page to add the comment to
parentCommentId - the ID of the parent comment to add the comment to
comment - the text of the comment
Returns:
the comment as a hash table

rpcEditComment

public Hashtable rpcEditComment(String token,
                                long pageId,
                                long commentId,
                                String comment)

rpcGetComments

public Vector rpcGetComments(String token,
                             String pageId)

rpcStoreBlogEntry

public Hashtable rpcStoreBlogEntry(String token,
                                   long pageId,
                                   String comment)

rpcAddTestComment

public String rpcAddTestComment(String token)

rpcAddComment

public Hashtable rpcAddComment(String token,
                               String spaceKey,
                               String pageTitle,
                               String comment)
Adds a comment to a page via the XML-RPC interface

Parameters:
token - the authentication token
spaceKey - the space key of the page
pageTitle - the title of the page
comment - the text of the comment
Returns:
the comment as a hash table

rpcRemoveComment

protected void rpcRemoveComment(String token,
                                long commentId)
                         throws org.apache.xmlrpc.XmlRpcException,
                                IOException
Remove a comment, identified by its id.

Parameters:
token - authentication token of user
commentId - the id of the comment to remove
Throws:
junit.framework.AssertionFailedError - if the comment cannot be found or removed.
org.apache.xmlrpc.XmlRpcException
IOException

rpcRemoveComment

protected void rpcRemoveComment(String token,
                                String commentContent,
                                String spaceKey,
                                String pageTitle)
                         throws org.apache.xmlrpc.XmlRpcException,
                                IOException
Remove a comment, identified by its location and content, from a page.

Parameters:
token - authentication token of user
commentContent - content of the comment to remove. This is used to identify the comment
spaceKey - identifies the space containing the comment
pageTitle - identifies the page
Throws:
junit.framework.AssertionFailedError - if the comment cannot be found or removed.
org.apache.xmlrpc.XmlRpcException
IOException

addCommentToBlogPost

public void addCommentToBlogPost(String spaceKey,
                                 String newsTitle,
                                 String comment)

rpcAddLabelToPage

public void rpcAddLabelToPage(String token,
                              String label,
                              long pageId)
Adds a label to the Page with the given page ID

Parameters:
token - the authentication token
label - the label to be added to the Page
pageId - the ID of the page

rpcAddLabelToBlog

public void rpcAddLabelToBlog(String token,
                              String label,
                              long blogId)
Adds a label to the blogpost with the given page ID

Parameters:
token - the authentication token
label - the label to be added to the Page
blogId - the ID of the page

rpcAddLabelToPage

public 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

Parameters:
token - the authentication token
spaceKey - the key of the Space the page is located in
pageTitle - the title of the Page
label - the label to be added to the page

rpcAddLabelToSpace

public void rpcAddLabelToSpace(String token,
                               String label,
                               String spaceKey)
Adds a label to a space

Parameters:
token - the token identifying the user
label - the label name (namespaces allowed)
spaceKey - the space key

rpcGetPageLabels

public List rpcGetPageLabels(String token,
                             long pageId)
Retrieves the labels assigned to a Page with the given page ID

Parameters:
token - the authentication token
pageId - the ID of the page
Returns:
A list of label names as Strings

rpcGetPageLabels

public 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

Parameters:
token - the authentication token
spaceKey - the key of the space the Page is located in
pageTitle - the title of the Page
Returns:
A list of label names as Strings

rpcRemoveLabelFromPage

public void rpcRemoveLabelFromPage(String token,
                                   String label,
                                   long pageId)
Removes the given label from the page with the given page ID

Parameters:
token - the authentication token
label - the label name to be removed
pageId - the page ID of the page with the label

rpcRemoveLabelFromPage

public void rpcRemoveLabelFromPage(String token,
                                   String label,
                                   String spaceKey,
                                   String pageTitle)

rpcRemoveLabelFromSpace

public void rpcRemoveLabelFromSpace(String token,
                                    String label,
                                    String spaceKey)
Removes a label from a space

Parameters:
token - the token identifying the user
label - the label name (namespaces allowed)
spaceKey - the space key

createUserViaHelper

public void createUserViaHelper(String token,
                                String username,
                                String password,
                                String fullName,
                                String email)
Creates a new user with the given details. Depending on the value of the ldapMode test property the user is created in an ldap repository or via the XML-RPC interface.

Parameters:
token - the authentication token
username - the username of the new user
password - the password of the new user
fullName - the full name of the new user
email - the email of the new user

createUserViaHelper

public void createUserViaHelper(User user)

viewUser

public void viewUser(String name)

removePersonalSpace

public void removePersonalSpace(String username)

removeUserViaHelper

public void removeUserViaHelper(String username)
Removes a user with the given username

Parameters:
username - the username of the user to remove

removeTestUser1ViaHelper

public void removeTestUser1ViaHelper(String token)
Removes the test user

Parameters:
token - the authentication token

removeUser

public void removeUser(String username)
Remove a user via the Web Interface. This should only be used where the web interface itself is being tested. It cannot be used when the UserRepository being tested is unmodifiable.


removeTestUser1

public void removeTestUser1()
Remove testUser1 via the Web Interface. This should only be used where the web interface itself is being tested. It cannot be used when the UserRepository being tested is unmodifiable.


createGroupViaHelper

public void createGroupViaHelper(String groupName)
Creates a group with the given name

Parameters:
groupName - the name of the group to be created

createGroup

public void createGroup(String group)
Create a group via the Web Interface. This should only be used where the web interface itself is being tested. It cannot be used when the UserRepository being tested is unmodifiable.


addUserToGroupViaHelper

public void addUserToGroupViaHelper(String username,
                                    String groupname)
Adds the given user to a groupname

Parameters:
username - the username of the user to be added
groupname - the group the user should be added to

removeUserFromGroupViaHelper

public void removeUserFromGroupViaHelper(String username,
                                         String groupname)
Removes the given user from the group

Parameters:
username - the username of the user to be removed
groupname - the name of the group the user should be removed from

rpcGetUserGroups

public Vector rpcGetUserGroups(String token,
                               String username)

rpcRemoveGroup

public void rpcRemoveGroup(String groupname)
Removes the given group

Parameters:
groupname - the group to be removed

removeGroup

public void removeGroup(String groupName)
Delete a group via the Web Interface. This should only be used where the web interface itself is being tested. It cannot be used when the UserRepository being tested is unmodifiable.


viewPeopleDirectory

public void viewPeopleDirectory()

viewGlobalAdmin

public void viewGlobalAdmin()

viewGlobalPermissions

public GlobalPermissions viewGlobalPermissions()

viewLanguages

public void viewLanguages()

viewSpaceAdmin

public SpaceAdmin viewSpaceAdmin()

viewSpaceSummary

public void viewSpaceSummary()

viewSpaceSummary

public void viewSpaceSummary(String spaceKey)

viewSpacePermissions

public void viewSpacePermissions(String spaceKey)
Deprecated. since 3.5 use viewSpacePermissions(com.atlassian.confluence.it.Space) instead


viewSpacePermissions

public SpacePermissions viewSpacePermissions(Space space)

viewHomepage

public void viewHomepage()

viewSpaceContent

public void viewSpaceContent()

viewTrash

public void viewTrash()

setThreadedComments

public void setThreadedComments(boolean enable)

setSharedMode

public void setSharedMode(boolean enable)

grantGlobalBrowsePermissionToGroup

public void grantGlobalBrowsePermissionToGroup(String groupName)
Deprecated. since 3.5 use GlobalPermissions.grantPermission(GlobalPermission, Group) instead


grantGlobalPermissionToGroup

public void grantGlobalPermissionToGroup(String permissionType,
                                         String groupName)
Deprecated. since 3.5 use GlobalPermissions.grantPermission(GlobalPermission, Group) instead


grantGlobalPermissionToUser

public void grantGlobalPermissionToUser(String permissionType,
                                        String userName)
Deprecated. since 3.5 use GlobalPermissions.grantPermission(GlobalPermission, User) instead


revokeGlobalPermissionFromUser

public void revokeGlobalPermissionFromUser(String permissionType,
                                           User user)
Deprecated. since 3.5 use GlobalPermissions.revokePermission(GlobalPermission, Entity) instead

Removes the specified global permission (from SpacePermission) from the given group name

Parameters:
permissionType - the permission type to remove
user - who will lose the permission

revokeGlobalPermissionFromGroup

public void revokeGlobalPermissionFromGroup(String permissionType,
                                            String groupName)
Deprecated. since 3.5 use GlobalPermissions.revokePermission(GlobalPermission, Entity) instead

Removes the specified global permission (from SpacePermission) from the given group name

Parameters:
permissionType - the permissiont type
groupName - the group to remove the permission from

ensureTestUserCanViewTestSpace

public 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)


editSpacePermsForm

public void editSpacePermsForm()

enableAnonymousAccess

public void enableAnonymousAccess()

disableAnonymousAccess

public void disableAnonymousAccess()

enableAnonymousAccessToSpace

public void enableAnonymousAccessToSpace(String spaceKey)

disableAnonymousAccessToSpace

public void disableAnonymousAccessToSpace(String spaceKey)

addAnonymousPermissionsToSpace

public void addAnonymousPermissionsToSpace(String spaceKey,
                                           Vector permissions)

removeAnonymousPermissionToSpace

public void removeAnonymousPermissionToSpace(String spaceKey,
                                             String permission)

rpcGrantSpacePermission

public void rpcGrantSpacePermission(String token,
                                    String permission,
                                    String username,
                                    String spaceKey)
Grants the given permission to a user for a particular Space

Parameters:
token - the authentication token
permission - the String corresponding to the permission
username - the user to grant the permission to
spaceKey - the key of the Space to grant the permission in

rpcGrantGlobalPermission

public void rpcGrantGlobalPermission(String token,
                                     String permission,
                                     String entityName)
Grants the given global permission to a user.

Parameters:
token - the authentication token
permission - the String corresponding to the permission
entityName - the username or group name to grant the permission to

rpcRemoveSpacePermission

public void rpcRemoveSpacePermission(String token,
                                     String permission,
                                     String username,
                                     String spaceKey)
Removes the given permission for a user for a particular Space

Parameters:
token - the authentication token
permission - the String corresponding to the permission
username - the user to remove the permission from
spaceKey - the key of the Space to grant the permission in

rpcRemoveGlobalPermissions

public void rpcRemoveGlobalPermissions(String token,
                                       String permission,
                                       String username)
Removes the given global permission for a user

Parameters:
token - the authentication token
permission - the String corresponding to the permission
username - the user to remove the permission from

rpcGrantViewSpacePermission

public void rpcGrantViewSpacePermission(String token,
                                        String entityName,
                                        String spaceKey)
Convenience method for granting VIEWSPACE permission to a particular user

Parameters:
token - the authentication token
entityName - the username or group name
spaceKey - the key of the Space to grant the permission in

grantViewSpacePermissionToUser

public void grantViewSpacePermissionToUser(String spaceKey,
                                           String username)
Deprecated. since 3.5 use SpacePermissions.grantPermission(com.atlassian.confluence.it.SpacePermission, User) instead


grantViewSpacePermissionToGroup

public void grantViewSpacePermissionToGroup(String spaceKey,
                                            String groupName)
Deprecated. since 3.5 use SpacePermissions.grantPermission(com.atlassian.confluence.it.SpacePermission, Group) instead


grantViewSpacePermissionToGroupAndDelegate

public void grantViewSpacePermissionToGroupAndDelegate(String spaceKey,
                                                       String groupName)

grantSpacePermissionToGroup

public void grantSpacePermissionToGroup(String spaceKey,
                                        String permissionType,
                                        String groupName)
Grant view space permissions and one other space permission to a specified group. Grants the permission via the web interface. Must already be logged in as a user with permission to set permissions on the space. Group must not already have view space permissions for the space.

Parameters:
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.

grantSpacePermissionToGroupAndDelegate

public void grantSpacePermissionToGroupAndDelegate(String spaceKey,
                                                   String permissionType,
                                                   String groupName)

grantSpacePermissionToUser

public void grantSpacePermissionToUser(String spaceKey,
                                       String permissionType,
                                       String userName)
Grant view space permissions and one other space permission to a specified user. Grants the permission via the web interface. Must already be logged in as a user with permission to set permissions on the space. User must not already have view space permissions for the space.

Parameters:
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.

grantSpacePermissionToUserAndDelegate

public void grantSpacePermissionToUserAndDelegate(String spaceKey,
                                                  String permissionType,
                                                  String userName)
Grants space permissions to the user by delegating to the rpc equivalent. Used to minify the amount of changes required for many existing calls.

Parameters:
spaceKey - to grant the space permission to
permissionType - to grant
userName - the name of the user to grant the permission to.

revokeSpacePermissionFromGroup

public void revokeSpacePermissionFromGroup(String spaceKey,
                                           String permissionType,
                                           String groupName)
Remove a space permission from a specified group. Removes the permission via the web interface. Must already be logged in as a group with permission to set permissions on the space.

Parameters:
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.

revokeSpacePermissionFromUser

public void revokeSpacePermissionFromUser(String spaceKey,
                                          String permissionType,
                                          String userName)
Remove a space permission from a specified user. Removes the permission via the web interface. Must already be logged in as a user with permission to set permissions on the space.

Parameters:
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.

rpcGrantAnonymousSpacePermission

public void rpcGrantAnonymousSpacePermission(String token,
                                             String permission,
                                             String spaceKey)
Grants the given permission to the anonymous user for the given space

Parameters:
token - the token identifying the current user
permission - the permission to give the anonymous user
spaceKey - the space to grant the permission on

rpcRemoveAnonymousSpacePermission

public void rpcRemoveAnonymousSpacePermission(String token,
                                              String permission,
                                              String spaceKey)
Removes the given permission for the anonymous user from the given space

Parameters:
token - the token identifying the current user
permission - the permission to remove
spaceKey - the space to remove the permission on

xmlRpcExecute

@Deprecated
public Object xmlRpcExecute(String method,
                                       Vector params)
Deprecated. call ConfluenceRpc.execute(String, Object...) or ConfluenceRpc.executeFuncTest(String, Object...) instead.

Wrapper for calling the xml rpc methods and handles the exceptions properly.

Parameters:
method - the method Name
params - the method parameters
Returns:
the result of the remote method call

attachFile

public void attachFile(File attachment)
Click the attach file link, attach a given file with a given comment and submit the attachment form.

Parameters:
attachment - the file attachment

attachFile

public void attachFile(File attachment,
                       String comment)
Click the attach file link, attach a given file with a given comment and submit the attachment form.

Parameters:
attachment - the file attachment
comment - the comment for the attachment

attachFileWithName

public 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.

Parameters:
fileName - the filename to attach
in - the stream to read the file
contentType - the content type of the attachment
comment - a comment for this attachment

createMail

public void createMail(File mail,
                       String spaceKey)

setAttachmentMaxUploadSize

public void setAttachmentMaxUploadSize(long max)

setMaxAttachmentsInUI

public void setMaxAttachmentsInUI(long max)

search

public void search(String query)

getAppContext

public String getAppContext()

importMailAndAssertNoRunningTask

public 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. Mail import can be done with an Mbox file or single mail.

Parameters:
filePath - the file path to the mailbox
spaceKey - the space key to import into

importMail

public void importMail(String filePath,
                       String spaceKey)
Creates mails in the specified space. Mail import can be done with an Mbox file or single mail. No explicit assertions are made by this method.

Parameters:
filePath - the file path to the mailbox
spaceKey - the space key to import into

addSpaceLabel

public void addSpaceLabel(String labelName)

renamePage

public void renamePage(String spaceKey,
                       String originalPageTitle,
                       String newPageTitle)

viewSpaceAdvanced

public void viewSpaceAdvanced()

grantAnonymousUseConfluencePermission

public void grantAnonymousUseConfluencePermission()

revokeAnonymousUseConfluencePermission

public void revokeAnonymousUseConfluencePermission()

showAllUsers

public void showAllUsers()

addWatchPage

public ViewContentBean addWatchPage()
                             throws Exception
Throws:
Exception

watchPage

public ViewContentBean watchPage(String spaceKey,
                                 String pageTitle)

watchSpace

public void watchSpace(String spaceKey)

watchSpace

public void watchSpace(Space space)

generateFile

public File generateFile(String filename,
                         String contents)

getCurrentMailQueueSize

public int getCurrentMailQueueSize()

importGlobalBackup

public void importGlobalBackup(String importZipLocation,
                               boolean waitForSuccess)
                        throws InterruptedException
Deprecated. since 4.1 use an 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.

Parameters:
importZipLocation - zip file location relative to classpath
waitForSuccess - synchronously wait for the export to complete
Throws:
InterruptedException

importGlobalBackup

protected void importGlobalBackup(File backupFile,
                                  boolean waitForSuccess)
                           throws InterruptedException
Deprecated. since 4.1 use an Importer instead.

Import a global backup from a file. This differs from the method that takes a string as the file may not be in the classpath. For example it could be a tempfile we created in a previous backup during the same test. This method also overwrites any directory configuration contained in the backup.

Parameters:
backupFile - the backup file to import.
waitForSuccess - synchronously wait for the export to complete
Throws:
InterruptedException
See Also:
Importer.importGlobalBackup(File, TimePeriod, DirectoryConfiguration, AdminConsole)

importSpaceBackup

protected void importSpaceBackup(String importZipLocation,
                                 boolean waitForSuccess)
                          throws InterruptedException
Deprecated. since 4.1 use an 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.

Parameters:
importZipLocation - zip file location relative to classpath
waitForSuccess - synchronously wait for the export to complete
Throws:
InterruptedException

rpclogCommandOutput

protected void rpclogCommandOutput(String commandString)
                            throws InterruptedException,
                                   org.apache.xmlrpc.XmlRpcException
Throws:
InterruptedException
org.apache.xmlrpc.XmlRpcException

setViewPermissionsForUsers

public void setViewPermissionsForUsers(String spaceKey,
                                       String pageTitle,
                                       String users)
Deprecated. Use 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.

Parameters:
spaceKey - the space the page belongs to
pageTitle - the title of the page
users - the users to restrict view permissions to as a comma separated list of usernames.

setViewPermissionsForGroups

public void setViewPermissionsForGroups(String spaceKey,
                                        String pageTitle,
                                        String groups)
Deprecated. Use 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.

Parameters:
spaceKey - the space the page belongs to
pageTitle - the title of the page
groups - the groups to restrict view permissions to as a comma separated list of group names.

setEditPermissionsForUsers

public void setEditPermissionsForUsers(String spaceKey,
                                       String pageTitle,
                                       String users)
Deprecated. Use 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.

Parameters:
spaceKey - the space the page belongs to
pageTitle - the title of the page
users - the users to restrict edit permissions to as a comma separated list of usernames.

setEditPermissionsForGroups

public void setEditPermissionsForGroups(String spaceKey,
                                        String pageTitle,
                                        String groups)
Deprecated. Use 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.

Parameters:
spaceKey - the space the page belongs to
pageTitle - the title of the page
groups - the groups to restrict edit permissions to as a comma separated list of group names.

removePageOrBlogById

public void removePageOrBlogById(long id)

getBaseUrl

public String getBaseUrl()
Returns base url that is used in tests. Note that in case of cluster it will return a base url of the node that the current test is running against. For configured base url please use getConfiguredBaseUrl() method.

Returns:

addComment

@Deprecated
public void addComment(String spaceKey,
                                  String pageTitle,
                                  String comment)
Deprecated. Should use ViewContentBean.addComment() instead.


setPageLabels

public JSONObject setPageLabels(String spaceKey,
                                String pageTitle,
                                String labels)
                         throws JSONException
Add the specified labels to the page

Parameters:
spaceKey - the space key
pageTitle - the page title
labels - the labels
Returns:
a JSONObject with the server response
Throws:
JSONException

setBlogLabels

public JSONObject setBlogLabels(String spaceKey,
                                String blogTitle,
                                String labels)
                         throws JSONException
Add the specified labels to the blog

Parameters:
spaceKey - the space key
blogTitle - the blog title
labels - the labels
Returns:
a JSONObject with the server response
Throws:
JSONException

removePageLabel

public void removePageLabel(String spaceKey,
                            String pageTitle)

editPageContent

public void editPageContent(String content)
Sets content via RPC, as the admin user.

Parameters:
content -

editPageContentViaForm

public void editPageContentViaForm(String content)
Edits content on the form, and submits the form as the current user.

Parameters:
content -

editBlogLabels

public void editBlogLabels(String labels)

editPageWithContent

public void editPageWithContent(String spaceKey,
                                String title,
                                String content)

gotoPageWithError

public void gotoPageWithError(String url)

assertImageValid

public 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. The bug is in the method createUrl(String, URL)

Overrides:
assertImageValid in class ThreadLocalWebTestCase
See Also:
ThreadLocalWebTestCase.assertImageValidAndStore(String, String, java.io.File)

assertImagePresent

public 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.


isClustered

public boolean isClustered()
Returns:
true if testing against a clustered intance of Confluence, false otherwise.

getFriendlyRelativeDate

public String getFriendlyRelativeDate(Date now,
                                      Date date,
                                      TimeZone timeZone)
Use the FriendlyDateFormatter to format the date relative to the "now" time. Note that the output format varies greatly even from second to second -- see FriendlyDateFormatter.

Parameters:
now - the date which the relative time is calculated in relation to
date - the date of some event which is to be formatted
timeZone - the current time zone
Returns:
a formatted relative date-time
See Also:
FriendlyDateFormatter

forceViewGlobalAdmin

public void forceViewGlobalAdmin()

createTestMailServer

protected void createTestMailServer()
                             throws Exception
Starts up and configures a new mail server which will be pulled back down during tearDown().

Throws:
Exception

stopTestMailServer

public void stopTestMailServer()

rpcFlushMailQueue

public void rpcFlushMailQueue()
Deprecated. since 3.3

Use ConfluenceRpc.flushMailQueue() instead.


assertNoMailReceived

protected void assertNoMailReceived()
                             throws InterruptedException
Throws:
InterruptedException

assertMailReceived

protected void assertMailReceived()
                           throws InterruptedException
Throws:
InterruptedException

rpcClearIndex

public void rpcClearIndex()

rpcClearQueue

public void rpcClearQueue(String token,
                          String queueName)

rebuildIndex

protected void rebuildIndex()
                     throws InterruptedException
Throws:
InterruptedException

editSpaceDescription

public void editSpaceDescription(User user,
                                 String spaceKey,
                                 String newDescription)

setApplicationConfigProperty

public void setApplicationConfigProperty(String propertyKey,
                                         String propertyValue)

setCheckbox

protected void setCheckbox(boolean check,
                           String checkBox)

withParagraph

protected String withParagraph(String value)


Copyright © 2003-2011 Atlassian. All Rights Reserved.