public abstract class JenkinsLauncher<T extends JenkinsLauncherCommand> extends JenkinsEmbedder
| Modifier and Type | Field and Description |
|---|---|
protected T |
command |
contextPath, env, homeLoader, jenkins, localPort, MIME_TYPES, NO_PROPERTIES, recipes, server, tearDowns| Constructor and Description |
|---|
JenkinsLauncher(T command) |
| Modifier and Type | Method and Description |
|---|---|
void |
after()
Override to tear down your specific external resource.
|
void |
before()
Override to set up your specific external resource.
|
protected org.eclipse.jetty.security.LoginService |
configureUserRealm()
Supply a dummy
LoginService that allows nobody. |
protected javax.servlet.ServletContext |
createWebServer()
Sets up Jetty without any actual TCP port serving HTTP.
|
protected abstract int |
doLaunch()
Launches the payload.
|
protected Class<?> |
getClassFromJar(String classname) |
protected String |
getThreadName() |
int |
launch()
Launches the Jenkins instance, without any time out or output message.
|
protected jenkins.model.Jenkins |
newJenkins()
Creates a new instance of
Jenkins. |
void |
recipe() |
protected void |
setupHome(File home)
Prepare the newly allocated home with additional files.
|
configureUpdateCenter, createLocalLauncher, createTaskListener, createUniqueProjectName, getDisplayName, getIconFileName, getInstance, getPluginManager, getURL, getUrlName, getWebAppRoot, interactiveBreak, isSomethingHappening, pause, setPluginManager, setQuietPeriod, waitUntilNoActivity, waitUntilNoActivityUpTo, with, with, withExistingHome, withNewHome, withPresetDataprotected final T extends JenkinsLauncherCommand command
public JenkinsLauncher(T command)
protected jenkins.model.Jenkins newJenkins()
throws Exception
JenkinsEmbedderJenkins. If the derived class wants to create it in a different way,
you can override it.newJenkins in class JenkinsEmbedderExceptionprotected javax.servlet.ServletContext createWebServer()
throws Exception
createWebServer in class JenkinsEmbedderExceptionpublic int launch()
throws Throwable
Throwableprotected abstract int doLaunch()
throws Exception
Exception - Any errorpublic void recipe()
recipe in class JenkinsEmbedderprotected org.eclipse.jetty.security.LoginService configureUserRealm()
LoginService that allows nobody.configureUserRealm in class JenkinsEmbedderpublic void before()
throws Throwable
JenkinsEmbedderbefore in class JenkinsEmbedderThrowable - if setup fails (which will disable afterpublic void after()
throws Exception
JenkinsEmbedderafter in class JenkinsEmbedderExceptionprotected void setupHome(File home) throws IOException
JenkinsEmbeddersetupHome in class JenkinsEmbedderhome - the target home directory (freshly allocated)IOException - any issue during the copy should interrupt the executionprotected Class<?> getClassFromJar(String classname) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionprotected String getThreadName()
Copyright © 2004–2021. All rights reserved.