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, AbstractAdminAcceptanceTest, AbstractLdapAcceptanceTest, AbstractMultimediaMacroAcceptanceTest, AbstractPermissionsAcceptanceTest, AbstractRpcAcceptanceTest, ActionAutowireSecurityAcceptanceTest, ActionMenuAcceptanceTest, AddPageAcceptanceTest, AddPageSecurityAcceptanceTest, AddPageWithRequestParamsAcceptanceTest, AddUserAcceptanceTest, AdminForceUpgradeAcceptanceTest, AlreadySetupAcceptanceTest, AntiXSSAcceptanceTest, AtlassianSecurityAcceptanceTest, AttachedImagesJsonAcceptanceTest, AttachmentAcceptanceTest, AttachmentEditXsrfAcceptanceTest, AttachmentMigrationAcceptanceTest, AttachmentUploadAcceptanceTest, AttachmentUploadXsrfAcceptanceTest, BasicSoapAcceptanceTest, BigAcceptanceTest, BlogAcceptanceTest, BlogSlowAcceptanceTest, BrowseMenuAcceptanceTest, BrowserLanguageAcceptanceTest, BrowseSpaceAcceptanceTest, BundledPluginsAcceptanceTest, CacheNamesAcceptanceTest, CaptchaAcceptanceTest, ClasspathAcceptanceTest, CodeMacroAcceptanceTest, ColourSchemeAcceptanceTest, ColourSchemeXsrfAcceptanceTest, CommentsAcceptanceTest, CommentXsrfAcceptanceTest, ComplexPagePermissionsAcceptanceTest, ConcurrentIndexingAcceptanceTest, ConfigureLoggingAcceptanceTest, ContentNameSearchAcceptanceTest, CopyPageAcceptanceTest, CreateContentXsrfAcceptanceTest, CreateDialogXsrfAcceptanceTest, CreateSpaceAcceptanceTest, CreateSpaceXsrfAcceptanceTest, CrowdUsersUserMappingUpgradeTaskAcceptanceTest, CustomHtmlAcceptanceTest, CustomHtmlXsrfAcceptanceTest, CustomizeLogoAcceptanceTest, CustomizeSiteLogoAcceptanceTest, CustomStylesheetXsrfAcceptanceTest, DailyReportNotificationsAcceptanceTest, DarkFeaturesAcceptanceTest, DashboardRecentlyUpdatedContentMacroAcceptanceTest, DateFormatAcceptanceTest, DecoratorAcceptanceTest, DefaultSpaceLogoXsrfAcceptanceTest, DiffPagesAcceptanceTest, DocThemeAcceptanceTest, DomainRestrictedSignupAcceptanceTest, DraftsAcceptanceTest, DraftsXsrfAcceptanceTest, EditLayoutsAcceptanceTest, EditPageAcceptanceTest, EditSpaceAcceptanceTest, 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, 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, NonClusterLicensingAcceptanceTest, NotificationImportAcceptanceTest, NotificationsXsrfAcceptanceTest, OnDemandSpacePermissionsDefaultUpgradeTaskAcceptanceTest, OpenSearchAcceptanceTest, OrphanedPagesAcceptanceTest, PageDestinationSearchAcceptanceTest, PageExportAcceptanceTest, PageHistoryAcceptanceTest, PageHistoryXsrfAcceptanceTest, PageInfoAcceptanceTest, PageListingAcceptanceTest, PageNotFoundAcceptanceTest, PageOperationsAcceptanceTest, PagePermissionsWithCommentAttachmentAcceptanceTest, PagePropertiesReportAcceptanceTest, PageTemplateAdminXsrfAcceptanceTest, PageTemplatesAcceptanceTest, PageTitlesAcceptanceTest, PageTreeMovePageAcceptanceTest, PageXsrfAcceptanceTest, PaginationAcceptanceTest, PeopleDirectoryAcceptanceTest, PersonalLabelsAcceptanceTest, PersonalSpaceAcceptanceTest, PlatformCtkAcceptanceTest, PluginAcceptanceTest, PluginAdminXsrfAcceptanceTest, PluginDecorationAcceptanceTest, PluginsVelocityConfigurationAcceptanceTest, PopularLabelsMacroAcceptanceTest, 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, SpaceAdminXsrfAcceptanceTest, SpaceAdvancedAcceptanceTest, SpaceDetailsAcceptanceTest, SpaceExportAcceptanceTest, SpaceExportXsrfAcceptanceTest, SpaceImportAcceptanceTest, SpaceKeyDirectoryTraversalAcceptanceTest, SpaceLabelsAcceptanceTest, SpaceLogoXsrfAcceptanceTest, SpacePermissionDefaultsAcceptanceTest, SpacePermissionsXsrfAcceptanceTest, SpacesListMacroAcceptanceTest, SpacesListMacroAcceptanceTest, SpaceTemplateAcceptanceTest, SpringPluginUploadAcceptanceTest, StylesheetAcceptanceTest, SummaryEmailAcceptanceFailingTest, SuperbatchAcceptanceTest, SupportToolsPluginAcceptanceTest, SystemInformationAcceptanceTest, 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, UserProfilePictureXsrfAcceptanceTest, UserProfileXsrfAcceptanceTest, UserRenameAcceptanceTest, UserStatusAcceptanceTest, UserStatusPermissionsAcceptanceTest, VelocityDeprecationAcceptanceTest, ViewSourceAcceptanceTest, WatchAcceptanceTest, WatchesResourceAcceptanceTest, WebDavAcceptanceTest, WebItemPluginAcceptanceTest, WebPanelAcceptanceTest, WebResourceTransformerAcceptanceTest, WebSudoAcceptanceTest, WelcomeMessageAcceptanceTest, 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 java.lang.String DASHBOARD_RECENT_UPDATES_URL
           
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.
static RandomnessHandler RANDOM
           
protected  ConfluenceRpc rpc
           
static User TEST_ADMIN
           
 BlogPost TEST_BLOG
           
 Comment TEST_COMMENT
           
protected static java.lang.String TEST_GROUP1
           
protected static java.lang.String TEST_GROUP2
           
 Page TEST_PAGE
           
 Space TEST_SPACE
           
 Space TEST_SPACE2
           
static User TEST_USER1
           
static User TEST_USER2
           
static java.lang.String TESTBLOG_CONTENT
           
static java.lang.String TESTBLOG_TITLE
           
protected  TestData testData
           
static java.lang.String TESTPAGE_COMMENT
           
static java.lang.String TESTPAGE_CONTENT
           
static java.lang.String TESTPAGE_TITLE
           
static java.lang.String TESTSPACE_KEY
           
static java.lang.String TESTSPACE_TITLE
           
static java.lang.String TESTSPACE2_KEY
           
static java.lang.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(java.lang.String testName)
           
 
Method Summary
 AdminConsole adminConsole()
           
 AttachmentsTester attachments()
           
 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)
static DirectoryConfiguration directoryConfig()
           
protected  java.lang.String generateBaseUrl()
           
 java.io.File generateFile(java.lang.String filename, java.lang.String contents)
           
 java.lang.String getAppContext()
           
 java.lang.String getBaseUrl()
           
 java.lang.String getConfiguredBaseUrl()
          Returns the configured base URL in the Confluence app.
protected  PluginHelper getPluginHelper()
           
protected  ServerStateManager getServerStateManager()
           
 void goToBlogCollector(java.lang.String spaceKey)
           
 void logInAsAdminAtHomepage()
           
 void loginAsTestUser()
           
 void loginAsTestUser2()
           
 void loginAsTestUserAtHomepage()
           
 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  void rebuildIndex()
           
protected  void setUp()
          Default setUp method.
protected  void setUpTestNG(java.lang.reflect.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  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(java.lang.String spaceKey)
           
 void viewSpaceTools(java.lang.String spaceKey)
           
 void viewTrash(java.lang.String spaceKey, java.lang.String spaceTitle)
           
 PagesCollectorBean watchSpace(java.lang.String spaceKey)
           
static java.lang.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

log

protected final transient org.slf4j.Logger log

testData

protected TestData testData

TEST_ADMIN

public static final User TEST_ADMIN

TEST_USER1

public static final User TEST_USER1

TEST_USER2

public static final User TEST_USER2

TEST_GROUP1

protected static final java.lang.String TEST_GROUP1
See Also:
Constant Field Values

TEST_GROUP2

protected static final java.lang.String TEST_GROUP2
See Also:
Constant Field Values

TEST_SPACE

public Space TEST_SPACE

TEST_SPACE2

public Space TEST_SPACE2

TESTSPACE_TITLE

public static java.lang.String TESTSPACE_TITLE

TESTSPACE_KEY

public static java.lang.String TESTSPACE_KEY

TESTSPACE2_TITLE

public static java.lang.String TESTSPACE2_TITLE

TESTSPACE2_KEY

public static java.lang.String TESTSPACE2_KEY

TESTPAGE_TITLE

public static final java.lang.String TESTPAGE_TITLE
See Also:
Constant Field Values

TESTPAGE_CONTENT

public static final java.lang.String TESTPAGE_CONTENT
See Also:
Constant Field Values

TESTPAGE_COMMENT

public static final java.lang.String TESTPAGE_COMMENT
See Also:
Constant Field Values

TESTBLOG_TITLE

public static final java.lang.String TESTBLOG_TITLE
See Also:
Constant Field Values

TESTBLOG_CONTENT

public static final java.lang.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

RANDOM

public static final RandomnessHandler RANDOM

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 java.lang.String DASHBOARD_RECENT_UPDATES_URL
See Also:
Constant Field Values

webTester

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

AbstractConfluenceAcceptanceTest

public AbstractConfluenceAcceptanceTest(java.lang.String testName)

AbstractConfluenceAcceptanceTest

public AbstractConfluenceAcceptanceTest()
Method Detail

webAppContextPath

public static java.lang.String webAppContextPath()

directoryConfig

public static DirectoryConfiguration directoryConfig()

attachments

public AttachmentsTester attachments()

adminConsole

public AdminConsole adminConsole()

setUpTestNG

protected void setUpTestNG(java.lang.reflect.Method method)
                    throws java.lang.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:
java.lang.Exception - if setup fails

setUp

protected void setUp()
              throws java.lang.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:
java.lang.Exception - from super

getPluginHelper

protected PluginHelper getPluginHelper()

tearDownTestNG

protected void tearDownTestNG()
                       throws java.lang.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:
java.lang.Exception - if tear down fails

tearDown

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

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

generateBaseUrl

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

getConfiguredBaseUrl

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

logInAsAdminAtHomepage

public void logInAsAdminAtHomepage()

loginAsTestUser

public void loginAsTestUser()

loginAsTestUserAtHomepage

public void loginAsTestUserAtHomepage()

loginAsTestUser2

public void loginAsTestUser2()

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(java.lang.String spaceKey)

viewSpaceSummary

public void viewSpaceSummary(java.lang.String spaceKey)

viewSpacePermissions

public SpacePermissions viewSpacePermissions(Space space)

viewHomepage

public void viewHomepage()

viewTrash

public void viewTrash(java.lang.String spaceKey,
                      java.lang.String spaceTitle)

getAppContext

public java.lang.String getAppContext()

viewSpaceTools

public void viewSpaceTools(java.lang.String spaceKey)

watchSpace

public PagesCollectorBean watchSpace(java.lang.String spaceKey)

generateFile

public java.io.File generateFile(java.lang.String filename,
                                 java.lang.String contents)

getBaseUrl

public java.lang.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 java.lang.InterruptedException
Throws:
java.lang.InterruptedException

pages

public PageAcceptanceTester pages()

users

public UserManagementHelper users()

logins

public LoginHelper logins()

getServerStateManager

protected ServerStateManager getServerStateManager()


Copyright © 2003-2014 Atlassian. All Rights Reserved.