Class LocalController

    • Field Detail

      • war

        @Inject
        @Named("jenkins.war")
        protected File war
        jenkins.war. Subject under test.
      • jenkinsHome

        protected final File jenkinsHome
        JENKINS_HOME directory for jenkins.war to be launched.
      • process

        protected org.jenkinsci.utils.process.ProcessInputStream process
    • Constructor Detail

      • LocalController

        protected LocalController​(com.google.inject.Injector i)
    • Method Detail

      • getSlaveJarPath

        @Deprecated
        public File getSlaveJarPath()
        Deprecated.
        Will not work correctly in Jenkins 2.33 and later. Apparently unused anyway.
      • getJenkinsHome

        public File getJenkinsHome()
      • populateJenkinsHome

        public void populateJenkinsHome​(byte[] _template,
                                        boolean clean)
                                 throws IOException
        Description copied from interface: IJenkinsController
        Populates the Jenkins Home with the specified ZIP template. Jenkins will not be restarted, so if the content would require a restart you have to do this yourself.
        Specified by:
        populateJenkinsHome in interface IJenkinsController
        Parameters:
        _template - The template (ZIP format).
        clean - if true then the home will be wiped clean before the template is applied. If false then the template will simply overwrite the existing (if any) home.
        Throws:
        IOException
      • getJavaHome

        public File getJavaHome()
      • startProcess

        public abstract org.jenkinsci.utils.process.ProcessInputStream startProcess()
                                                                             throws IOException
        Throws:
        IOException
      • onReady

        protected void onReady()
                        throws IOException
        Called when the Jenkins instance is ready to be used.
        Throws:
        IOException
      • diagnose

        public void diagnose​(Throwable cause)
        Description copied from class: JenkinsController
        Perform controller specific diagnostics for test failure. Defaults to no-op.
        Overrides:
        diagnose in class JenkinsController
        Parameters:
        cause - Failure cause
      • commonLaunchEnv

        @NonNull
        protected Map<String,​String> commonLaunchEnv()
        Common environment variables to put to CommandBuilder when launching Jenkins.
      • getSutHostName

        protected String getSutHostName()
        Hostname to use when accessing Jenkins.

        Useful to override with public hostname/IP when external clients needs to talk back to Jenkins.

        Returns:
        "127.0.0.1" unless overridden via JENKINS_LOCAL_HOSTNAME env var.
      • isRunInstallWizard

        public boolean isRunInstallWizard()
        Returns:
        true if the install wizard is going to be run
      • setRunInstallWizard

        public void setRunInstallWizard​(boolean runInstallWizard)
        Set the flag to run the install wizard.
        Parameters:
        runInstallWizard - - true to run the install wizard