Package aQute.bnd.gradle
Class TestOSGi
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
aQute.bnd.gradle.AbstractBndrun
aQute.bnd.gradle.TestOSGi
- All Implemented Interfaces:
Comparable<org.gradle.api.Task>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.TaskInternal,org.gradle.api.plugins.ExtensionAware,org.gradle.api.Task,org.gradle.util.Configurable<org.gradle.api.Task>
OSGi Test task type for Gradle.
This task type can be used to execute tests in a bndrun file.
Here is examples of using the TestOSGi task type:
import aQute.bnd.gradle.TestOSGi
tasks.register("testOSGi", TestOSGi) {
bndrun = resolveTask.flatMap { it.outputBndrun }
}
Properties:
- bndrun - This is the bndrun file to be tested. This property must be set.
- bundles - The bundles to added to a FileSetRepository for non-Bnd Workspace builds. The default is "sourceSets.main.runtimeClasspath" plus "configurations.archives.artifacts.files". This must not be used for Bnd Workspace builds.
- ignoreFailures - If true the task will not fail if the any test cases fail. Otherwise, the task will fail if any test case fails. The default is false.
- workingDirectory - This is the directory for the test case execution. The default for workingDir is temporaryDir.
- properties - Properties that are available for evaluation of the bnd instructions for non-Bnd Workspace builds. The default is the properties of the task and project objects. This must not be used for Bnd Workspace builds.
- javaLauncher - Configures the default java executable to be used for execution.
- resultsDirectory - This is the directory where the test case results are placed. The default is project.java.testResultsDir/name.
- tests - The test class names to be run. If not set, all test classes are run. Use a colon (:) to specify a test method to run on the specified test class.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Task
org.gradle.api.Task.Namer -
Field Summary
FieldsFields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.gradle.api.provider.Property<org.gradle.jvm.toolchain.JavaLauncher>Configures the default java executable to be used for execution.org.gradle.api.file.DirectoryPropertyThe directory where the test case results are placed.getTests()Return the test class names to be run.voidConfigures the test class names to be run.protected voidworker(aQute.bnd.build.Project run) Test the Project object.Methods inherited from class aQute.bnd.gradle.AbstractBndrun
bndrunAction, bundles, createBndrun, getBndrun, getBundles, getIgnoreFailures, getProperties, getWorkingDirectory, inferRunEE, inferRunRequires, isIgnoreFailures, setBundles, setIgnoreFailuresMethods inherited from class org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceMethods inherited from class org.gradle.api.internal.AbstractTask
appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getOnlyIf, getReasonNotToTrackState, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, prependParallelSafeAction, setImpliesSubProjectsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.Task
doNotTrackState, getConvention
-
Field Details
-
OPTION_TESTS
Option to specify test names.- See Also:
-
-
Constructor Details
-
TestOSGi
public TestOSGi()Create a TestOSGi task.
-
-
Method Details
-
getResultsDirectory
@OutputDirectory public org.gradle.api.file.DirectoryProperty getResultsDirectory()The directory where the test case results are placed.The default for resultsDirectory is "${project.java.testResultsDir}/${task.name}"
- Returns:
- The directory where the test case results are placed.
-
getTests
Return the test class names to be run.- Returns:
- The test class names to be run.
-
setTests
Configures the test class names to be run.- Parameters:
tests- The test class names to be run.
-
getJavaLauncher
@Optional public org.gradle.api.provider.Property<org.gradle.jvm.toolchain.JavaLauncher> getJavaLauncher()Configures the default java executable to be used for execution.This java launcher is used if the bndrun does not specify the
javaproperty or specifies it with the default valuejava.- Returns:
- The JavaLauncher property.
-
worker
Test the Project object.- Specified by:
workerin classAbstractBndrun- Parameters:
run- The Project object.- Throws:
Exception- If the worker action has an exception.
-