Class TestLauncher
java.lang.Object
org.jdrupes.builder.core.LauncherBase
org.jdrupes.builder.startup.AbstractLauncher
org.jdrupes.builder.startup.BuildProjectLauncher
org.jdrupes.builder.startup.TestLauncher
- All Implemented Interfaces:
AutoCloseable, Launcher
An implementation of a
Launcher that launches a build configuration.
It expects that the JDrupes Builder project has already been compiled
and its classes are available on the classpath. It can be used to
launch a build configuration from a unit test where the context is
already is bound. This is only needed when jdbld runs unit tests
for jdbld.-
Field Summary
Fields inherited from class BuildProjectLauncher
commandLine, jdbldPropsFields inherited from class LauncherBase
scopedBuildContext -
Constructor Summary
ConstructorsConstructorDescriptionTestLauncher(ClassLoader classloader, Path buildRoot, String[] args) Initializes a new test launcher. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoConfigureLogging(Path buildRoot, Properties jdbldProps) CallsAbstractLauncher.configureLogging(java.nio.file.Path,java.util.Properties)withBuildProjectLauncher.buildRootandBuildProjectLauncher.jdbldProps.resources(Stream<Project> projects, ResourceRequest<T> request) Provide the requested resources from the given projects, using the context from the root project.Methods inherited from class BuildProjectLauncher
close, main, regenerateRootProject, rootProject, runCommandsMethods inherited from class AbstractLauncher
addCliProperties, baseOptions, configureLogging, findProjects, formatter, propertiesFromFiles, reportBuildExceptionMethods inherited from class LauncherBase
context, createProjects
-
Constructor Details
-
TestLauncher
Initializes a new test launcher.- Parameters:
classloader- the classloaderbuildRoot- the build rootargs- the args
-
-
Method Details
-
doConfigureLogging
Description copied from class:BuildProjectLauncherCallsAbstractLauncher.configureLogging(java.nio.file.Path,java.util.Properties)withBuildProjectLauncher.buildRootandBuildProjectLauncher.jdbldProps. Can be overridden by a derived class (usually with a noop) to avoid the reconfiguration when launching a build from jdbld.- Overrides:
doConfigureLoggingin classBuildProjectLauncher- Parameters:
buildRoot- the build rootjdbldProps- the jdbld props
-
resources
public <T extends Resource> Stream<T> resources(Stream<Project> projects, ResourceRequest<T> request) Description copied from interface:LauncherProvide the requested resources from the given projects, using the context from the root project. The launcher must automatically regenerate the root project ifCleanlinesswas requested.- Specified by:
resourcesin interfaceLauncher- Overrides:
resourcesin classAbstractLauncher- Type Parameters:
T- the requested type- Parameters:
projects- the projectsrequest- the request- Returns:
- the results
-