Class 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:
    HudsonTestCase.useLocalPluginManager
    • 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
    • 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void installDetachedPlugin​(String shortName)
      Dynamically load a detached plugin that would not otherwise get loaded.
      protected Collection<String> loadBundledPlugins()  
      • Methods inherited from class hudson.PluginManager

        addDependencies, copyBundledPlugin, createCache, createDefault, createPluginStrategy, disablePlugins, discover, doCheckPluginUrl, doCheckUpdatesServer, doInstall, doInstallNecessaryPlugins, doInstallPlugins, doInstallPluginsDone, doPlugins, doPluginsSearch, doPrevalidateConfig, doProxyConfigure, doSiteConfigure, doUpdateSources, doUploadPlugin, dynamicLoad, dynamicLoad, getApi, getBundledPluginManifest, getDisplayName, getFailedPlugins, getLastErrorCheckUpdateCenters, getOverrides, getPlugin, getPlugin, getPlugins, getPlugins, getPluginStrategy, getProxyDescriptor, getSearchUrl, getTarget, getWorkDir, hasAdoptThisPluginLabel, hasAdoptThisPluginLabel, hasLatestVersionNewerThanOffered, 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
    • Constructor Detail

      • UnitTestSupportingPluginManager

        public UnitTestSupportingPluginManager​(File rootDir)
    • Method Detail

      • 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