com.atlassian.confluence.it.plugin
Class WebTestPluginHelper

java.lang.Object
  extended by com.atlassian.confluence.it.plugin.WebTestPluginHelper
All Implemented Interfaces:
PluginHelper

public class WebTestPluginHelper
extends Object
implements PluginHelper

Uses its own WebTester to perform and test administrative actions on a server with a given base url. The possession of the WebTester implies that the Dialog between this helper and the server is separate to any other conversation, so the logged in user and response (ie currently viewed page) are also separate.


Constructor Summary
WebTestPluginHelper(String baseUrl)
          Opens a separate dialog with the server for the purpose of installing plugins.
WebTestPluginHelper(String baseUrl, User initialUser)
          Opens a separate dialog with the server for the purpose of installing plugins.
 
Method Summary
 void disablePlugin(Plugin plugin)
          Disable the plugin using its display name.
 void disablePluginModule(Plugin plugin, String moduleKey)
          Disable the plugin module using the plugin's key and the module's key.
 void enablePlugin(Plugin plugin)
          Enable the plugin.
 void enablePluginModule(Plugin plugin, String moduleKey)
           
 void installPlugin(UploadablePlugin plugin)
          Install the plugin as the currently logged in User.
 void installPluginIfNotInstalled(UploadablePlugin plugin)
          Equivalent of calling PluginHelper.isPluginInstalled(Plugin) and PluginHelper.installPlugin(UploadablePlugin).
 boolean isPluginEnabled(Plugin plugin)
          Returns true if the given plugin is currently enabled, otherwise false.
 boolean isPluginInstalled(Plugin plugin)
          Returns true if the given plugin is currently installed, otherwise false.
 boolean isPluginInstalled(String pluginName)
           
 void loginIfUserIsNew(User user)
           
 void uninstallPlugin(Plugin plugin)
          Uninstall the plugin as the currently logged in User.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebTestPluginHelper

public WebTestPluginHelper(String baseUrl)
Opens a separate dialog with the server for the purpose of installing plugins. It does this to not interface with any ongoing dialog in the calling code.

Parameters:
baseUrl - base URL of the Confluence instance to talk to

WebTestPluginHelper

public WebTestPluginHelper(String baseUrl,
                           User initialUser)
Opens a separate dialog with the server for the purpose of installing plugins. It does this to not interface with any ongoing dialog in the calling code.

Parameters:
baseUrl - base URL of the Confluence instance to talk to
initialUser - the user to login as initially
Method Detail

loginIfUserIsNew

public void loginIfUserIsNew(User user)

installPluginIfNotInstalled

public void installPluginIfNotInstalled(UploadablePlugin plugin)
                                 throws FileNotFoundException
Description copied from interface: PluginHelper
Equivalent of calling PluginHelper.isPluginInstalled(Plugin) and PluginHelper.installPlugin(UploadablePlugin).

Specified by:
installPluginIfNotInstalled in interface PluginHelper
Throws:
FileNotFoundException

installPlugin

public void installPlugin(UploadablePlugin plugin)
                   throws FileNotFoundException
Description copied from interface: PluginHelper
Install the plugin as the currently logged in User.

Specified by:
installPlugin in interface PluginHelper
Throws:
FileNotFoundException - if the plugin file does not exist locally
See Also:
PluginHelper.isPluginInstalled(Plugin)

uninstallPlugin

public void uninstallPlugin(Plugin plugin)
Description copied from interface: PluginHelper
Uninstall the plugin as the currently logged in User.

Specified by:
uninstallPlugin in interface PluginHelper
See Also:
PluginHelper.isPluginInstalled(Plugin)

isPluginInstalled

public boolean isPluginInstalled(Plugin plugin)
Description copied from interface: PluginHelper
Returns true if the given plugin is currently installed, otherwise false. Requires the logged in user to have admin access.

Specified by:
isPluginInstalled in interface PluginHelper

isPluginInstalled

public boolean isPluginInstalled(String pluginName)

enablePlugin

public void enablePlugin(Plugin plugin)
Description copied from interface: PluginHelper
Enable the plugin. Requires the logged in user to have admin access.

Specified by:
enablePlugin in interface PluginHelper
See Also:
PluginHelper.isPluginEnabled(Plugin)

enablePluginModule

public void enablePluginModule(Plugin plugin,
                               String moduleKey)
Specified by:
enablePluginModule in interface PluginHelper

disablePluginModule

public void disablePluginModule(Plugin plugin,
                                String moduleKey)
Disable the plugin module using the plugin's key and the module's key.

Specified by:
disablePluginModule in interface PluginHelper

disablePlugin

public void disablePlugin(Plugin plugin)
Disable the plugin using its display name.

Specified by:
disablePlugin in interface PluginHelper
See Also:
PluginHelper.isPluginEnabled(Plugin)

isPluginEnabled

public boolean isPluginEnabled(Plugin plugin)
Description copied from interface: PluginHelper
Returns true if the given plugin is currently enabled, otherwise false.

Specified by:
isPluginEnabled in interface PluginHelper


Copyright © 2003-2011 Atlassian. All Rights Reserved.