Class UnitTestSupportingPluginManager

java.lang.Object
hudson.model.AbstractModelObject
hudson.PluginManager
org.jvnet.hudson.test.UnitTestSupportingPluginManager
All Implemented Interfaces:
hudson.model.ModelObject, hudson.search.SearchableModelObject, hudson.search.SearchItem, jenkins.util.io.OnMaster, org.kohsuke.stapler.StaplerOverridable, org.kohsuke.stapler.StaplerProxy
Direct Known Subclasses:
TestPluginManager

public class UnitTestSupportingPluginManager extends hudson.PluginManager
PluginManager that can work with unit tests where dependencies are just jars. PluginManager to speed up unit tests.

Instead of loading every plugin for every test case, this allows them to reuse a single plugin manager.

TODO: Plugin start/stop/postInitialize invocation semantics gets different. Perhaps

Author:
Kohsuke Kawaguchi
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class hudson.PluginManager

    hudson.PluginManager.FailedPlugin, hudson.PluginManager.MetadataCache, hudson.PluginManager.PluginCycleDependenciesMonitor, hudson.PluginManager.PluginDeprecationMonitor, hudson.PluginManager.PluginUpdateMonitor, hudson.PluginManager.UberClassLoader, hudson.PluginManager.UpdateCenterProxy
  • Field Summary

    Fields inherited from class hudson.PluginManager

    activePlugins, CONFIGURE_UPDATECENTER, context, CUSTOM_PLUGIN_MANAGER, failedPlugins, FAST_LOOKUP, plugins, pluginUploaded, rootDir, SKIP_PERMISSION_CHECK, uberClassLoader, UPLOAD_PLUGINS
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Dynamically load a detached plugin that would not otherwise get loaded.
    protected Collection<String>
     

    Methods inherited from class hudson.PluginManager

    addDependencies, copyBundledPlugin, createCache, createDefault, createPluginStrategy, disablePlugins, discover, doCheckPluginUrl, doCheckUpdateSiteUrl, doCheckUpdatesServer, doInstall, doInstallNecessaryPlugins, doInstallPlugins, doInstallPluginsDone, doPlugins, doPluginsSearch, doPrevalidateConfig, doProxyConfigure, doSiteConfigure, doUpdateSources, doUploadPlugin, dynamicLoad, dynamicLoad, getApi, getBundledPluginManifest, getDetachedLocation, getDisplayName, getFailedPlugins, getLastErrorCheckUpdateCenters, getOverrides, getPlugin, getPlugin, getPlugins, getPlugins, getPluginsSortedByTitle, getPluginStrategy, getProxyDescriptor, getSearchUrl, getTarget, getUpdates, getWorkDir, hasAdoptThisPluginLabel, hasAdoptThisPluginLabel, identifyPluginShortName, initTasks, install, isMetaLabel, isNonMetaLabel, isPluginUploaded, loadDetachedPlugins, loadPluginsFromWar, loadPluginsFromWar, parseRequestedPlugins, prevalidateConfig, resolveDependentPlugins, start, stop, unscientific, whichPlugin

    Methods inherited from class hudson.model.AbstractModelObject

    getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UnitTestSupportingPluginManager

      public UnitTestSupportingPluginManager(File rootDir)
  • Method Details

    • loadBundledPlugins

      protected Collection<String> loadBundledPlugins() throws Exception
      Specified by:
      loadBundledPlugins in class hudson.PluginManager
      Throws:
      Exception
      See Also:
      • LocalPluginManager.loadBundledPlugins()
    • installDetachedPlugin

      public void installDetachedPlugin(String shortName) throws Exception
      Dynamically load a detached plugin that would not otherwise get loaded. Will only work in Jenkins 2.x. May be called at any time after Jenkins starts up (do not use from loadBundledPlugins(). You may need to first install any transitive dependencies.
      Parameters:
      shortName - cvs for example
      Throws:
      Exception