Class PooledJenkinsController
- java.lang.Object
-
- org.jenkinsci.test.acceptance.controller.JenkinsController
-
- org.jenkinsci.test.acceptance.server.PooledJenkinsController
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,IJenkinsController
,AutoCleaned
,LogListenable
public class PooledJenkinsController extends JenkinsController implements LogListenable
JenkinsController
that talks toJenkinsControllerPoolProcess
over Unix domain socket.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PooledJenkinsController.FactoryImpl
-
Field Summary
-
Fields inherited from class org.jenkinsci.test.acceptance.controller.JenkinsController
injector, isQuite, STARTUP_TIMEOUT, WORKSPACE
-
-
Constructor Summary
Constructors Constructor Description PooledJenkinsController(com.google.inject.Injector i, File socket)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLogListener(LogListener l)
void
diagnose(Throwable cause)
Perform controller specific diagnostics for test failure.URL
getUrl()
Gives URL where Jenkins is listening.void
populateJenkinsHome(byte[] template, boolean clean)
Populates the Jenkins Home with the specified ZIP template.void
removeLogListener(LogListener l)
void
startNow()
Synchronously start Jenkins instance until it starts responding to the specified URL.void
stopNow()
Synchronously shutdown Jenkins instance.void
tearDown()
Assuming the instance had already stopped, destroy JENKINS_HOME and release resources used by Jenkins.-
Methods inherited from class org.jenkinsci.test.acceptance.controller.JenkinsController
close, getInitialCredentials, getLogId, getLogPrinter, isRunning, postConstruct, restart, start, stop
-
-
-
-
Constructor Detail
-
PooledJenkinsController
public PooledJenkinsController(com.google.inject.Injector i, File socket)
-
-
Method Detail
-
addLogListener
public void addLogListener(LogListener l)
- Specified by:
addLogListener
in interfaceLogListenable
-
removeLogListener
public void removeLogListener(LogListener l)
- Specified by:
removeLogListener
in interfaceLogListenable
-
startNow
public void startNow() throws IOException
Description copied from class:JenkinsController
Synchronously start Jenkins instance until it starts responding to the specified URL.- Specified by:
startNow
in classJenkinsController
- Throws:
IOException
-
stopNow
public void stopNow() throws IOException
Description copied from class:JenkinsController
Synchronously shutdown Jenkins instance.This method must leave JENKINS_HOME intact so that it can be started later. To really delete the data and clean up, see
JenkinsController.tearDown()
.- Specified by:
stopNow
in classJenkinsController
- Throws:
IOException
-
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 interfaceIJenkinsController
- Parameters:
template
- The template (ZIP format).clean
- iftrue
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
-
getUrl
public URL getUrl()
Description copied from class:JenkinsController
Gives URL where Jenkins is listening. Must end with "/"- Specified by:
getUrl
in interfaceIJenkinsController
- Specified by:
getUrl
in classJenkinsController
-
tearDown
public void tearDown() throws IOException
Description copied from class:JenkinsController
Assuming the instance had already stopped, destroy JENKINS_HOME and release resources used by Jenkins.- Specified by:
tearDown
in classJenkinsController
- 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 classJenkinsController
- Parameters:
cause
- Failure cause
-
-