Class PluginManager

    • Field Detail

      • jenkins

        public final Jenkins jenkins
      • uploadPlugins

        public boolean uploadPlugins
        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

        public boolean forceRestart
    • Constructor Detail

      • PluginManager

        public PluginManager​(Jenkins jenkins)
    • Method Detail

      • checkForUpdates

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

        public boolean isInstalled​(String... specs)
      • isInstalled

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

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

        public void installPlugin​(File localFile)
                           throws IOException
        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.
      • enablePlugin

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