Package hudson.tasks.junit
Class TestResultAction
- All Implemented Interfaces:
Action
,HealthReportingAction
,ModelObject
,RunAction2
,SimpleBuildStep.LastBuildAction
,org.kohsuke.stapler.StaplerProxy
public class TestResultAction
extends AbstractTestResultAction<TestResultAction>
implements org.kohsuke.stapler.StaplerProxy, SimpleBuildStep.LastBuildAction
Action
that displays the JUnit test result.
The actual test reports are isolated by WeakReference
so that it doesn't eat up too much memory.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.tasks.test.AbstractTestResultAction
AbstractTestResultAction.Summarizer
-
Field Summary
Fields inherited from class hudson.tasks.test.AbstractTestResultAction
owner, run
-
Constructor Summary
ConstructorDescriptionTestResultAction
(AbstractBuild owner, TestResult result, BuildListener listener) Deprecated.TestResultAction
(Run owner, TestResult result, TaskListener listener) TestResultAction
(TestResult result, BuildListener listener) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addData
(TestResultAction.Data data) Adds aTestResultAction.Data
to the test data associated with this action.getActions
(TestObject object) int
Gets the number of failed tests.A shortcut for summary.jellydouble
Returns how much to scale the test related health by.A shortcut for scriptingCollection<? extends Action>
Returns the object that represents the actual test result.int
Gets the number of skipped tests.A shortcut for scriptingint
Gets the total number of tests.void
mergeResult
(TestResult additionalResult, TaskListener listener) Merges an additional test result into this one.void
setData
(List<TestResultAction.Data> testData) Replaces to collection of test data associated with this action.void
setHealthScaleFactor
(double healthScaleFactor) void
setResult
(TestResult result, BuildListener listener) Deprecated.void
setResult
(TestResult result, TaskListener listener) Overwrites theTestResult
by a new data set.Methods inherited from class hudson.tasks.test.AbstractTestResultAction
doGraph, doGraphMap, findCorrespondingResult, findPreviousCorresponding, getApi, getBuildHealth, getDescription, getDisplayName, getFailureDiffString, getIconFileName, getPreviousResult, getPreviousResult, getTestResultPath, getUrlName, onAttached, onLoad, setDescription
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface hudson.model.Action
getDisplayName, getIconFileName, getUrlName
-
Constructor Details
-
TestResultAction
Deprecated. -
TestResultAction
- Since:
- 1.2-beta-1
-
TestResultAction
Deprecated.
-
-
Method Details
-
getProjectActions
- Specified by:
getProjectActions
in interfaceSimpleBuildStep.LastBuildAction
-
setResult
Overwrites theTestResult
by a new data set.- Since:
- 1.2-beta-1
-
setResult
Deprecated. -
getResult
Description copied from class:AbstractTestResultAction
Returns the object that represents the actual test result. This method is used by the remote API so that the XML/JSON that we are sending won't contain unnecessary indirection (that is,AbstractTestResultAction
in between.If such a concept doesn't make sense for a particular subtype, return
this
.- Specified by:
getResult
in classAbstractTestResultAction<TestResultAction>
-
getFailCount
public int getFailCount()Description copied from class:AbstractTestResultAction
Gets the number of failed tests.- Specified by:
getFailCount
in classAbstractTestResultAction<TestResultAction>
-
getSkipCount
public int getSkipCount()Description copied from class:AbstractTestResultAction
Gets the number of skipped tests.- Overrides:
getSkipCount
in classAbstractTestResultAction<TestResultAction>
-
getTotalCount
public int getTotalCount()Description copied from class:AbstractTestResultAction
Gets the total number of tests.- Specified by:
getTotalCount
in classAbstractTestResultAction<TestResultAction>
-
getHealthScaleFactor
public double getHealthScaleFactor()Description copied from class:AbstractTestResultAction
Returns how much to scale the test related health by.- Overrides:
getHealthScaleFactor
in classAbstractTestResultAction<TestResultAction>
- Returns:
- a factor of
1.0
to have the test health be the percentage of tests passing so 20% of tests failing will report as 80% health. A factor of2.0
will mean that 20% of tests failing will report as 60% health. A factor of2.5
will mean that 20% of test failing will report as 50% health. A factor of4.0
will mean that 20% of tests failing will report as 20% health. A factor of5.0
will mean that 20% (or more) of tests failing will report as 0% health. A factor of0.0
will disable test health reporting.
-
setHealthScaleFactor
public void setHealthScaleFactor(double healthScaleFactor) -
getFailedTests
Description copied from class:AbstractTestResultAction
A shortcut for summary.jelly- Overrides:
getFailedTests
in classAbstractTestResultAction<TestResultAction>
- Returns:
- List of failed tests from associated test result.
-
getPassedTests
Description copied from class:AbstractTestResultAction
A shortcut for scripting- Overrides:
getPassedTests
in classAbstractTestResultAction<TestResultAction>
- Returns:
- List of passed tests from associated test result.
-
getSkippedTests
Description copied from class:AbstractTestResultAction
A shortcut for scripting- Overrides:
getSkippedTests
in classAbstractTestResultAction<TestResultAction>
- Returns:
- List of skipped tests from associated test result.
-
getTarget
- Specified by:
getTarget
in interfaceorg.kohsuke.stapler.StaplerProxy
-
getActions
-
setData
Replaces to collection of test data associated with this action.This method will not automatically persist the data at the time of addition.
-
addData
Adds aTestResultAction.Data
to the test data associated with this action.This method will not automatically persist the data at the time of addition.
- Since:
- 1.21
-
mergeResult
Merges an additional test result into this one. -
readResolve
- Overrides:
readResolve
in classAbstractTestResultAction<TestResultAction>
-