Class PluginManager

All Implemented Interfaces:
CapybaraPortingLayer

public class PluginManager extends ContainerPageObject
Page object for plugin manager.
Author:
Kohsuke Kawaguchi
  • Field Details

    • jenkins

      public final Jenkins jenkins
    • uploadPlugins

      @Inject(optional=true) @Named("uploadPlugins") @Deprecated public boolean uploadPlugins
      Deprecated.
      Blocks use of MockUpdateCenter.
      Optional configuration value that selects whether to resolve plugins locally and upload to Jenkins (better performing when Jenkins is closer to the test execution), or install plugins from within Jenkins (more accurate testing.)
    • forceRestart

      @Inject(optional=true) @Named("forceRestartAfterPluginInstallation") public boolean forceRestart
    • mockUpdateCenter

      @Inject public MockUpdateCenter mockUpdateCenter
  • Constructor Details

    • PluginManager

      public PluginManager(Jenkins jenkins)
  • Method Details

    • checkForUpdates

      public void checkForUpdates()
      Force update the plugin update center metadata.
    • installationStatus

      public PluginManager.InstallationStatus installationStatus(String spec)
    • installationStatus

      public PluginManager.InstallationStatus installationStatus(PluginSpec spec)
      Returns:
      whether the plugin (in version greater or equal than specified) is installed
    • isInstalled

      @Deprecated public boolean isInstalled(String... specs)
      Deprecated.
    • isInstalled

      public boolean isInstalled(PluginSpec... specs)
      Parameters:
      specs - plugin ids with optional version (e.g. "ldap" or "ldap@1.8")
      Returns:
      true, if plugin (in version greater or equal than specified) is installed
    • installPlugins

      @Deprecated public boolean installPlugins(PluginSpec... specs) throws UpdateCenterMetadata.UnableToResolveDependencies, IOException
      Deprecated.
      Please be encouraged to use WithPlugins annotations to statically declare the required plugins you need. If you really do need to install plugins in the middle of a test, as opposed to be in the beginning, then this is the right method.

      The deprecation marker is to call attention to WithPlugins. This method is not really deprecated.

      Installs specified plugins.
      Returns:
      Always false.
      Throws:
      UpdateCenterMetadata.UnableToResolveDependencies
      IOException
    • getAvailableVersionForPlugin

      public hudson.util.VersionNumber getAvailableVersionForPlugin(String pluginName)
    • installPlugin

      @Deprecated public void installPlugin(File localFile) throws IOException
      Deprecated.
      Not used when running MockUpdateCenter.
      Installs a plugin by uploading the *.jpi image. Can be use for corner cases to verify some behavior when very specific plugin versions are needed, for example to verify that a warning message is displayed when a risky and outdated plugin is installed on Jenkins.
      Throws:
      IOException
    • enablePlugin

      public void enablePlugin(String pluginName, boolean state)
      Enable oder disable the specified plugin.
      Parameters:
      pluginName - plugin id (e.g. "ldap")
      state - enable plugin if true, disable plugin if false