com.atlassian.confluence
Class AbstractLdapAcceptanceTest

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
                      extended by com.atlassian.confluence.AbstractLdapAcceptanceTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractDefaultPropertiesLdapAcceptanceTest, LdapAnonymousBindAcceptanceTest

public abstract class AbstractLdapAcceptanceTest
extends AbstractConfluenceAcceptanceTest

Sets up an embedded LDAP server and associated directory in Confluence.


Field Summary
protected  UserDirectories.ConfigurationCallback configurationCallBack
           
protected  UserDirectory internalDirectory
           
protected  UserDirectory ldapDirectory
           
protected  LdapUserManagementHelper ldapHelper
           
protected  UserDirectories userDirectories
           
 
Fields inherited from class com.atlassian.confluence.AbstractConfluenceAcceptanceTest
adminConsole, ANONYMOUS_USER, BLOG_DATE_FORMAT, BROWSE_MENU_LINK_ID, context, CROWD_MODE, DIRECTORY_CONFIG, filesToDelete, log, logAdjuster, mailServices, RANDOM, rpc, serverStateManager, SMTP_SUBJECT_PREFIX, TEST_ADMIN, TEST_ADMIN_EMAIL, TEST_ADMIN_FULLNAME, TEST_ADMIN_PASSWORD, TEST_ADMIN_USERNAME, TEST_BLOG, TEST_COMMENT, TEST_GEN_EMAIL1, TEST_GEN_EMAIL2, TEST_GEN_FULLNAME1, TEST_GEN_FULLNAME2, TEST_GEN_PASSWORD1, TEST_GEN_PASSWORD2, TEST_GEN_USERNAME1, TEST_GEN_USERNAME2, TEST_GROUP1, TEST_PAGE, TEST_SPACE, TEST_SPACE2, TEST_USER1, TEST_USER2, TESTBLOG_CONTENT, TESTBLOG_TITLE, testData, TESTMAILSERVER_HOSTNAME, TESTMAILSERVER_NAME, TESTPAGE_COMMENT, TESTPAGE_CONTENT, TESTPAGE_TITLE, TESTSPACE_KEY, TESTSPACE_TITLE, TESTSPACE2_KEY, TESTSPACE2_TITLE, userHelper, VIEW_PERSONAL_SPACE_LINK, wikiMarkupRpc
 
Constructor Summary
AbstractLdapAcceptanceTest()
           
 
Method Summary
protected  UserDirectory addLdapDirectory()
           
protected  void beforeAddLdapDirectory()
          Default implementation does nothing.
protected  UserDirectory editLdapDirectory(LdapDirectoryPermission ldapPermission, Map<String,String> ldapProperties)
           
protected  LdapDirectoryPermission getLdapDirectoryPermission()
          Override to change the permission setting for the LDAP directory.
protected  Map<String,String> getLdapProperties()
           
protected  void initialiseLdapData(LdapService service)
          Subclasses can override to install custom LDIF files, or initialise the LDAP server in other ways.
protected  void initLdapFromDefaultLdif(LdapService service)
           
protected abstract  String ldapPropertiesFile()
          Overridden by subclasses to override ldap properties
protected  void onSetUp()
          Override to execute custom set-up code.
protected  void onTearDown()
          Override to execute custom tear-down code.
protected  void postProcessConfiguration()
          Override to modify the LDAP configuration before it is saved.
 void runBare()
          Clean up unused memory.
protected  void setUp()
           
protected  void tearDown()
          Default tearDown method.
 
Methods inherited from class com.atlassian.confluence.AbstractConfluenceAcceptanceTest
addComment, addUserToGroupViaHelper, addWatchPage, assertImagePresent, assertImageValid, assertLinkPresentWithExactTextAndClass, assertMailReceived, assertNoMailReceived, attachFile, attachFile, attachFileWithName, createGroup, createGroupViaHelper, createMail, createPage, createPageWithViewRestrictions, createSpaceViaWebUI, createTestMailServer, createTestSpaceViaWebUI, createUserViaHelper, createUserViaHelper, disableAnonymousAccess, editPage, editPageContent, editPageContentViaForm, editPageWithContent, editSpaceDescription, editSpacePermsForm, enableAnonymousAccess, ensureTestUserCanViewTestSpace, forceViewGlobalAdmin, generateBaseUrl, generateFile, getAppContext, getBaseUrl, getConfiguredBaseUrl, getCurrentMailQueueSize, getCurrentPageId, getFriendlyRelativeDate, getLoginButtonId, getPageId, getPluginHelper, getTodaysBlogPostDate, gotoPageWithError, grantViewSpacePermissionToGroup, grantViewSpacePermissionToUser, importGlobalBackup, importMail, importMailAndAssertNoRunningTask, isClustered, logIn, logIn, logInAs, logInAs, logInAs, logInAsAdminAtHomepage, logInAsAtHomepage, logInAsAtHomepage, loginAsTestUser, loginAsTestUser2, loginAsTestUserAtHomepage, loginViaForm, logout, makeParams, movePage, movePage, movePageToNewParent, movePageToNewParent, movePageToNewSpace, rebuildIndex, removeGroup, removePageLabel, removePageOrBlogById, removeTestUser1ViaHelper, removeUserViaHelper, renamePage, rpcClearTokens, rpcGetAdminToken, rpcGetTestUserToken, search, setAttachmentMaxUploadSize, setBlogLabels, setEditPermissionsForGroups, setEditPermissionsForUsers, setMaxAttachmentsInUI, setPageLabels, setThreadedComments, setUp, setUpTestNG, setViewPermissionsForGroups, setViewPermissionsForUsers, stopTestMailServer, tearDownTestNG, viewBlog, viewGlobalPermissions, viewHomepage, viewLabel, viewLanguages, viewPage, viewPage, viewPeopleDirectory, viewSpaceAdmin, viewSpaceAdvanced, viewSpaceContent, viewSpacePermissions, viewSpaceSummary, viewSpaceSummary, viewTrash, viewUser, watchPage, watchSpace, watchSpace
 
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, 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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ldapDirectory

protected UserDirectory ldapDirectory

internalDirectory

protected UserDirectory internalDirectory

ldapHelper

protected LdapUserManagementHelper ldapHelper

userDirectories

protected UserDirectories userDirectories

configurationCallBack

protected final UserDirectories.ConfigurationCallback configurationCallBack
Constructor Detail

AbstractLdapAcceptanceTest

public AbstractLdapAcceptanceTest()
Method Detail

runBare

public final void runBare()
                   throws Throwable
Description copied from class: ThreadLocalWebTestCase
Clean up unused memory. Using setUp and tearDown is not an option for this requires the subclasses of this class to call the respective super methods. Also wrap any exceptions and include the URL and HTML for the current page.

Overrides:
runBare in class ThreadLocalWebTestCase
Throws:
Throwable

setUp

protected final void setUp()
                    throws Exception
Overrides:
setUp in class AbstractConfluenceAcceptanceTest
Throws:
Exception

beforeAddLdapDirectory

protected void beforeAddLdapDirectory()
                               throws Exception
Default implementation does nothing. Overridden by subclasses that do things (e.g. site import) before the directory is added

Throws:
Exception

ldapPropertiesFile

protected abstract String ldapPropertiesFile()
Overridden by subclasses to override ldap properties


addLdapDirectory

protected UserDirectory addLdapDirectory()

editLdapDirectory

protected UserDirectory editLdapDirectory(LdapDirectoryPermission ldapPermission,
                                          Map<String,String> ldapProperties)

getLdapProperties

protected Map<String,String> getLdapProperties()

getLdapDirectoryPermission

protected LdapDirectoryPermission getLdapDirectoryPermission()
Override to change the permission setting for the LDAP directory. Default is LdapDirectoryPermission.READ_WRITE.


onSetUp

protected void onSetUp()
                throws Exception
Override to execute custom set-up code.

Throws:
Exception

onTearDown

protected void onTearDown()
                   throws Exception
Override to execute custom tear-down code.

Throws:
Exception

postProcessConfiguration

protected void postProcessConfiguration()
Override to modify the LDAP configuration before it is saved. Use the webTester to set form values, etc.


initialiseLdapData

protected void initialiseLdapData(LdapService service)
                           throws Exception
Subclasses can override to install custom LDIF files, or initialise the LDAP server in other ways.

Parameters:
service - the LDAP service
Throws:
Exception

initLdapFromDefaultLdif

protected final void initLdapFromDefaultLdif(LdapService service)
                                      throws Exception
Throws:
Exception

tearDown

protected final void tearDown()
                       throws Exception
Description copied from class: AbstractConfluenceAcceptanceTest
Default tearDown method. Removes any files which were added to the AbstractConfluenceAcceptanceTest.filesToDelete list.

Overrides:
tearDown in class AbstractConfluenceAcceptanceTest
Throws:
Exception


Copyright © 2003-2012 Atlassian. All Rights Reserved.