com.atlassian.confluence
Class AbstractConfluenceAcceptanceTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.atlassian.confluence.junit3.JUnit3TimingTestCase
              extended by com.atlassian.confluence.AbstractConfluenceAcceptanceTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractActiveObjectsAcceptanceTest, com.atlassian.confluence.notifications.visualregression.AbstractEmailAcceptanceTest, AbstractLdapAcceptanceTest, AbstractMultimediaMacroAcceptanceTest, AbstractRpcAcceptanceTest, ActionAutowireSecurityAcceptanceTest, ActionMenuAcceptanceTest, AddPageAcceptanceTest, AddPageSecurityAcceptanceTest, AddPageWithRequestParamsAcceptanceTest, AddUserAcceptanceTest, AdminAcceptanceTest, AdminConsoleAcceptanceTest, AdminForceUpgradeAcceptanceTest, AdminTasklistAcceptanceTest, AlreadySetupAcceptanceTest, AntiXSSAcceptanceTest, AtlassianSecurityAcceptanceTest, AttachedImagesJsonAcceptanceTest, AttachmentAcceptanceTest, AttachmentEditXsrfAcceptanceTest, AttachmentMigrationAcceptanceTest, AttachmentUploadAcceptanceTest, AttachmentUploadXsrfAcceptanceTest, BasicSoapAcceptanceTest, BigAcceptanceTest, BlogAcceptanceTest, BlogPermissionsAcceptanceTest, BlogSlowAcceptanceTest, BrowseMenuAcceptanceTest, BrowserLanguageAcceptanceTest, BrowseSpaceAcceptanceTest, BundledPluginsAcceptanceTest, CacheNamesAcceptanceTest, CaptchaAcceptanceTest, ClasspathAcceptanceTest, CodeMacroAcceptanceTest, ColourSchemeAcceptanceTest, ColourSchemeXsrfAcceptanceTest, CommentsAcceptanceTest, CommentXsrfAcceptanceTest, ComplexPagePermissionsAcceptanceTest, ConcurrentIndexingAcceptanceTest, ConfigureLoggingAcceptanceTest, ContentNameSearchAcceptanceTest, ContentPropertiesAcceptanceTest, CopyPageAcceptanceTest, CreateContentXsrfAcceptanceTest, CreateDialogXsrfAcceptanceTest, CreateSpaceAcceptanceTest, CreateSpaceXsrfAcceptanceTest, CrowdUsersUserMappingUpgradeTaskAcceptanceTest, CustomHtmlAcceptanceTest, CustomHtmlXsrfAcceptanceTest, CustomizeLogoAcceptanceTest, CustomizeSiteLogoAcceptanceTest, CustomStylesheetXsrfAcceptanceTest, DailyReportNotificationsAcceptanceTest, DarkFeaturesAcceptanceTest, DashboardRecentlyUpdatedContentMacroAcceptanceTest, DateFormatAcceptanceTest, DecoratorAcceptanceTest, DefaultSpaceLogoXsrfAcceptanceTest, DiffPagesAcceptanceTest, DocThemeAcceptanceTest, DraftsAcceptanceTest, DraftsXsrfAcceptanceTest, EditGlobalPermissionsAcceptanceTest, EditLayoutsAcceptanceTest, EditPageAcceptanceTest, EditSpaceAcceptanceTest, EditSpacePermissionsAcceptanceTest, EmailAndLinkExternalizationAcceptanceTest, EmailToContentAcceptanceTest, EmbeddedObjectAcceptanceTest, ErrorPageAcceptanceTest, EventsAcceptanceTest, ExcerptMacroAcceptanceTest, ExternalGadgetDirectoryAcceptanceTest, ExternalLinkAcceptanceTest, FavouritePageXsrfAcceptanceTest, FavouriteSpaceXsrfAcceptanceTest, FileHandleTestingSuite.FileHandleTest, FiveHundredPageSecurityAcceptanceTest, FlashScopeAcceptanceTest, FlushIndexingQueueAcceptanceTest, FuncTestPermissionAcceptanceTest, GadgetWhiteListAcceptanceTest, GadgetXsrfAcceptanceTest, GalleryAcceptanceTest, GeneralConfigurationAcceptanceTest, GetStartedAcceptanceTest, GlobalAdminAcceptanceTest, GlobalAdminXsrfAcceptanceTest, GlobalEntitiesAcceptanceTest, GlobalPermissionsXsrfAcceptanceTest, GlobalReportsAcceptanceTest, GroupManagementReadOnlyAcceptanceTest, GroupMembersAcceptanceTest, GroupPickerAcceptanceTest, GzipFilterAcceptanceTest, HeartbeatAcceptanceTest, HeartbeatXsrfAcceptanceTest, HistoricalPageViewAcceptanceTest, HtmlExportAcceptanceTest, HtmlMacrosAcceptanceTest, HttpHeadersAcceptanceTest, HttpMethodValidationAcceptanceTest, I18nModeAcceptanceTest, I18nResourceAcceptanceTest, ImportPagesFromDiskAcceptanceTest, ImportPagesXsrfAcceptanceTest, IncludeMacroAcceptanceTest, IncomingLinkAcceptanceTest, IndexingAcceptanceTest, InheritedPagePermissionsAcceptanceTest, InviteUsersAcceptanceTest, JiraIssueMacroServerParamsUpgradeTaskAcceptanceTest, JobPluginAcceptanceTest, JohnsonFilterAcceptanceTest, KnownBugsAcceptanceTest, LabelsAcceptanceTest, LabelSearchAcceptanceTest, LabelsFuncRpcAcceptanceTest, LanguageAcceptanceTest, LargeImportAcceptanceTest, LicensingAcceptanceTest, LinkTypeAcceptanceTest, LinkTypeIncludingMailAcceptanceTest, ListPageAlternativesAcceptanceTest, LoggingAndProfilingXsrfAcceptanceTest, LoginAcceptanceTest, LogoutAcceptanceTest, MacroDiffAcceptanceTest, MacroPluginAcceptanceTest, MacrosAcceptanceTest, MacrosRespectPagePermissionsAcceptanceTest, MailArchivingAcceptanceTest, MailQueueXsrfAcceptanceTest, MailSpaceAdminXsrfAcceptanceTest, ManageUsersAndGroupsXsrfAcceptanceTest, MoveBlogPostAcceptanceTest, MovePageAcceptanceTest, MovePageReferencesAcceptanceTest, MultipleAttachmentsAcceptanceTest, NetworkTabAcceptanceTest, Node, NodeIdentifierAcceptanceTest, NonClusterLicensingAcceptanceTest, NotificationImportAcceptanceTest, NotificationsXsrfAcceptanceTest, OnDemandSpacePermissionsDefaultUpgradeTaskAcceptanceTest, OpenSearchAcceptanceTest, OrphanedPagesAcceptanceTest, PageDestinationSearchAcceptanceTest, PageExportAcceptanceTest, PageHistoryAcceptanceTest, PageHistoryXsrfAcceptanceTest, PageInfoAcceptanceTest, PageListingAcceptanceTest, PageNotFoundAcceptanceTest, PageOperationsAcceptanceTest, PagePermissionsAcceptanceTest, PagePermissionsWithCommentAttachmentAcceptanceTest, PagePropertiesReportAcceptanceTest, PageTemplateAdminXsrfAcceptanceTest, PageTemplatesAcceptanceTest, PageTitlesAcceptanceTest, PageTreeMovePageAcceptanceTest, PageXsrfAcceptanceTest, PaginationAcceptanceTest, PdfPageExportAcceptanceTest, PeopleDirectoryAcceptanceTest, PermissionsRpcAcceptanceTest, PersonalLabelsAcceptanceTest, PersonalSpaceAcceptanceTest, PlatformCtkAcceptanceTest, PluginAcceptanceTest, PluginAdminXsrfAcceptanceTest, PluginDecorationAcceptanceTest, PluginsVelocityConfigurationAcceptanceTest, PopularLabelsMacroAcceptanceTest, PostRestoreConstraintsUpgradeTest, RaiseSupportRequestXsrfAcceptanceTest, RecentlyUpdatedContentMacroAcceptanceTest, RecentlyUsedLabelsMacroAcceptanceTest, RefactoringAcceptanceTest, RelatedLabelsMacroAcceptanceTest, RemovePageRestrictionsXsrfAcceptanceTest, RemoveSpaceAcceptanceTest, RenderContentXsrfAcceptanceTest, ReportsAcceptanceTest, ResetPasswordAcceptanceTest, RestAcceptanceTest, RestrictedPageAcceptanceTest, RevertPageAcceptanceTest, RpcVersion1AcceptanceTest, RpcVersion2AcceptanceTest, RssAcceptanceTest, RssFeedBuilderAcceptanceTest, ScheduleJobAdminXsrfAcceptanceTest, SearchAcceptanceTest, SearchMacroAcceptanceTest, SecurityAcceptanceTest, SecurityConfigurationAcceptanceTest, ServletPluginAcceptanceTest, SignupAcceptanceTest, SiteExportAcceptanceTest, SiteImportAcceptanceTest, SiteSupportAcceptanceTest, SpaceAdminAcceptanceTest, SpaceAdminPermissionsAcceptanceTest, SpaceAdminXsrfAcceptanceTest, SpaceAdvancedAcceptanceTest, SpaceDetailsAcceptanceTest, SpaceExportXsrfAcceptanceTest, SpaceImportAcceptanceTest, SpaceKeyDirectoryTraversalAcceptanceTest, SpaceLabelsAcceptanceTest, SpaceLogoXsrfAcceptanceTest, SpacePermissionDefaultsAcceptanceTest, SpacePermissionsAcceptanceTest, SpacePermissionsXsrfAcceptanceTest, SpacesListMacroAcceptanceTest, SpacesListMacroAcceptanceTest, SpaceTemplateAcceptanceTest, SpaceXmlExportAcceptanceTest, SpringPluginUploadAcceptanceTest, StylesheetAcceptanceTest, SummaryEmailAcceptanceFailingTest, SuperbatchAcceptanceTest, SupportToolsPluginAcceptanceTest, SystemInformationAcceptanceTest, TestEnvironmentAcceptanceTest, TestRequestLicenseFromMac, TestUpgradeRecoveryFile, ThemeChangeAcceptanceTest, ThemesXsrfAcceptanceTest, ThreadedCommentAcceptanceTest, ThumbnailAcceptanceTest, TimeAcceptanceTest, TimeZoneAcceptanceTest, TrackbackAcceptanceTest, TrashCanAcceptanceTest, TrustedApplicationAcceptanceTest, TrustedApplicationXsrfAcceptanceTest, UndefinedPagesAcceptanceTest, UniqueHeadingIdAcceptanceTest, UpdateLicenseDetailsXsrfAcceptanceTest, UpdateStatusXsrfAcceptanceTest, UPMAcceptanceTest, UserFollowAcceptanceTest, UserHoverAcceptanceTest, UserMacrosAcceptanceTest, UserManagementAcceptanceTest, UserManagementReadOnlyAcceptanceTest, UserMenuAcceptanceTest, UserPickerAcceptanceTest, UserPreferencesAcceptanceTest, UserProfileAcceptanceTest, UserProfileXsrfAcceptanceTest, UserRenameAcceptanceTest, UserStatusAcceptanceTest, UserStatusPermissionsAcceptanceTest, VelocityDeprecationAcceptanceTest, ViewSourceAcceptanceTest, WatchAcceptanceTest, WatchesResourceAcceptanceTest, WebDavAcceptanceTest, WebItemPluginAcceptanceTest, WebPanelAcceptanceTest, WebResourceTransformerAcceptanceTest, WebSudoAcceptanceTest, WelcomeMessageAcceptanceTest, WikiMarkupLinkAcceptanceTest, WordExportAcceptanceTest, XworkAcceptanceTest

public abstract class AbstractConfluenceAcceptanceTest
extends com.atlassian.confluence.junit3.JUnit3TimingTestCase

This superclass provides Confluence specific functions useful in acceptance tests.


Field Summary
static String DASHBOARD_RECENT_UPDATES_URL
           
protected  LogAdjuster logAdjuster
          Can be used by subclasses to turn logging on the server up or down for just one test.
protected  ConfluenceRpc rpc
           
protected static User TEST_ADMIN
          Deprecated. since 5.6 Use User.ADMIN
 BlogPost TEST_BLOG
           
 Comment TEST_COMMENT
           
protected static String TEST_GROUP1
           
protected static String TEST_GROUP2
           
 Page TEST_PAGE
           
 Space TEST_SPACE
           
 Space TEST_SPACE2
           
protected static User TEST_USER1
          Deprecated. since 5.6 Use createTestUser()
protected static User TEST_USER2
          Deprecated. since 5.6 Use User.ADMIN
static String TESTBLOG_CONTENT
           
static String TESTBLOG_TITLE
           
protected  TestData testData
           
static String TESTPAGE_COMMENT
           
static String TESTPAGE_CONTENT
           
static String TESTPAGE_TITLE
           
static String TESTSPACE_KEY
           
static String TESTSPACE_TITLE
           
static String TESTSPACE2_KEY
           
static String TESTSPACE2_TITLE
           
protected  net.sourceforge.jwebunit.junit.WebTester webTester
           
protected  ConfluenceRpc wikiMarkupRpc
          Use this for tests where you want to create pages/comments/blogs using wikimarkup.
 
Constructor Summary
AbstractConfluenceAcceptanceTest()
           
AbstractConfluenceAcceptanceTest(String testName)
           
 
Method Summary
 AdminConsole adminConsole()
           
 AttachmentsTester attachments()
           
 BaseUrlSelector baseUrlSelector()
           
 void createSpaceViaWebUI(Space space)
           
 void createTestSpaceViaWebUI()
          For those times we need to ensure a space was created via the web UI (For example if the web UI may behave differently to RPC)
protected  User createTestUser()
          Creates a user with a pseudo-random username.
protected  DarkFeaturesHelper darkFeatures()
           
static DirectoryConfiguration directoryConfig()
           
 File generateFile(String filename, String contents)
           
 String getAppContext()
           
protected  String getBaseUrl()
           
 String getConfiguredBaseUrl()
          Returns the configured base URL in the Confluence app.
protected  PluginHelper getPluginHelper()
          Deprecated. since 5.6 Use plugins()
protected  ServerStateManager getServerStateManager()
           
 void goToBlogCollector(String spaceKey)
           
 LoginHelper logins()
           
 void logout()
          Log out by going straight to the regular logout.action and then starting a new conversation at the start location, usually noop.jsp.
 PageAcceptanceTester pages()
           
protected  PluginHelper plugins()
           
protected  void rebuildIndex()
           
protected  void setUp()
          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.
protected  String substituteForNodeBaseUrl(String url)
           
protected  void tearDown()
          Default tearDown method.
protected  void tearDownTestNG()
          Called by TestNG, calls tearDown() on the current class, prevents the need to put this annotation everywhere, and sets the test name properly.
 UserManagementHelper users()
           
 void viewHomepage()
           
 SpaceAdmin viewSpaceAdmin(Space space)
           
 SpacePermissions viewSpacePermissions(Space space)
           
 void viewSpaceSummary(String spaceKey)
           
 void viewSpaceTools(String spaceKey)
           
 void viewTrash(String spaceKey, String spaceTitle)
           
 PagesCollectorBean watchSpace(String spaceKey)
           
static String webAppContextPath()
           
 
Methods inherited from class com.atlassian.confluence.junit3.JUnit3TimingTestCase
runBare, setExceptionTransformer
 
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

testData

protected TestData testData

TEST_GROUP1

protected static final String TEST_GROUP1
See Also:
Constant Field Values

TEST_GROUP2

protected static final String TEST_GROUP2
See Also:
Constant Field Values

TEST_SPACE

public Space TEST_SPACE

TEST_SPACE2

public Space TEST_SPACE2

TESTSPACE_TITLE

public static String TESTSPACE_TITLE

TESTSPACE_KEY

public static String TESTSPACE_KEY

TESTSPACE2_TITLE

public static String TESTSPACE2_TITLE

TESTSPACE2_KEY

public static String TESTSPACE2_KEY

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

TEST_ADMIN

@Deprecated
protected static final User TEST_ADMIN
Deprecated. since 5.6 Use User.ADMIN

TEST_USER1

@Deprecated
protected static final User TEST_USER1
Deprecated. since 5.6 Use createTestUser()

TEST_USER2

@Deprecated
protected static final User TEST_USER2
Deprecated. since 5.6 Use User.ADMIN

wikiMarkupRpc

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


rpc

protected ConfluenceRpc rpc

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().


DASHBOARD_RECENT_UPDATES_URL

public static final String DASHBOARD_RECENT_UPDATES_URL
See Also:
Constant Field Values

webTester

protected net.sourceforge.jwebunit.junit.WebTester webTester
Constructor Detail

AbstractConfluenceAcceptanceTest

public AbstractConfluenceAcceptanceTest(String testName)

AbstractConfluenceAcceptanceTest

public AbstractConfluenceAcceptanceTest()
Method Detail

webAppContextPath

public static String webAppContextPath()

directoryConfig

public static DirectoryConfiguration directoryConfig()

attachments

public AttachmentsTester attachments()

adminConsole

public AdminConsole adminConsole()

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.

Parameters:
method - The test method being called
Throws:
Exception - if setup fails

setUp

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

Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception - from super

getPluginHelper

@Deprecated
protected PluginHelper getPluginHelper()
Deprecated. since 5.6 Use plugins()


tearDownTestNG

protected void tearDownTestNG()
                       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 - if tear down fails

tearDown

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

Overrides:
tearDown in class junit.framework.TestCase
Throws:
Exception

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

logout

public void logout()
Log out by going straight to the regular logout.action and then starting a new conversation at the start location, usually noop.jsp. You probably want to call LoginHelper.logOutSlowly() instead if you're testing what logging out actually does, and LoginHelper.logout() if you just want to clean up the session as fast as possible.

See Also:
LoginHelper.logout(), LoginHelper.logOutSlowly()

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)


viewSpaceAdmin

public SpaceAdmin viewSpaceAdmin(Space space)

goToBlogCollector

public void goToBlogCollector(String spaceKey)

viewSpaceSummary

public void viewSpaceSummary(String spaceKey)

viewSpacePermissions

public SpacePermissions viewSpacePermissions(Space space)

viewHomepage

public void viewHomepage()

viewTrash

public void viewTrash(String spaceKey,
                      String spaceTitle)

getAppContext

public String getAppContext()

viewSpaceTools

public void viewSpaceTools(String spaceKey)

watchSpace

public PagesCollectorBean watchSpace(String spaceKey)

generateFile

public File generateFile(String filename,
                         String contents)

getBaseUrl

protected String getBaseUrl()
Returns:
The 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.

rebuildIndex

protected void rebuildIndex()
                     throws InterruptedException
Throws:
InterruptedException

pages

public PageAcceptanceTester pages()

users

public UserManagementHelper users()

createTestUser

protected User createTestUser()
Creates a user with a pseudo-random username. This should be used in preference to the predefined users such as User.TEST, User.TEST2 or User.APOSTROPHE


logins

public LoginHelper logins()

getServerStateManager

protected ServerStateManager getServerStateManager()

darkFeatures

protected DarkFeaturesHelper darkFeatures()

plugins

protected PluginHelper plugins()

substituteForNodeBaseUrl

protected String substituteForNodeBaseUrl(String url)

baseUrlSelector

public BaseUrlSelector baseUrlSelector()


Copyright © 2003–2015 Atlassian. All rights reserved.