Package hudson.tasks.junit
Class TestResultAction
- All Implemented Interfaces:
Action,HealthReportingAction,ModelObject,Badgeable,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 ClassesNested 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
ConstructorsConstructorDescriptionTestResultAction(AbstractBuild owner, TestResult result, BuildListener listener) Deprecated.TestResultAction(Run owner, TestResult result, TaskListener listener) TestResultAction(TestResult result, BuildListener listener) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddData(TestResultAction.Data data) Adds aTestResultAction.Datato the test data associated with this action.getActions(TestObject object) intGets the number of failed tests.A shortcut for summary.jellydoubleReturns how much to scale the test related health by.A shortcut for scriptingCollection<? extends Action>Returns the object that represents the actual test result.intGets the number of skipped tests.A shortcut for scriptingintGets the total number of tests.voidmergeResult(TestResult additionalResult, TaskListener listener) Merges an additional test result into this one.voidsetData(List<TestResultAction.Data> testData) Replaces to collection of test data associated with this action.voidsetHealthScaleFactor(double healthScaleFactor) voidsetResult(TestResult result, BuildListener listener) Deprecated.voidsetResult(TestResult result, TaskListener listener) Overwrites theTestResultby a new data set.Methods inherited from class hudson.tasks.test.AbstractTestResultAction
doGraph, doGraphMap, findCorrespondingResult, findPreviousCorresponding, getApi, getBadge, getBuildHealth, getDescription, getDisplayName, getFailureDiffString, getIconFileName, getPreviousResult, getPreviousResult, getTestResultPath, getUrlName, onAttached, onLoad, setDescriptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
getProjectActionsin interfaceSimpleBuildStep.LastBuildAction
-
setResult
Overwrites theTestResultby a new data set.- Since:
- 1.2-beta-1
-
setResult
Deprecated. -
getResult
Description copied from class:AbstractTestResultActionReturns 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,AbstractTestResultActionin between.If such a concept doesn't make sense for a particular subtype, return
this.- Specified by:
getResultin classAbstractTestResultAction<TestResultAction>
-
getFailCount
public int getFailCount()Description copied from class:AbstractTestResultActionGets the number of failed tests.- Specified by:
getFailCountin classAbstractTestResultAction<TestResultAction>
-
getSkipCount
public int getSkipCount()Description copied from class:AbstractTestResultActionGets the number of skipped tests.- Overrides:
getSkipCountin classAbstractTestResultAction<TestResultAction>
-
getTotalCount
public int getTotalCount()Description copied from class:AbstractTestResultActionGets the total number of tests.- Specified by:
getTotalCountin classAbstractTestResultAction<TestResultAction>
-
getHealthScaleFactor
public double getHealthScaleFactor()Description copied from class:AbstractTestResultActionReturns how much to scale the test related health by.- Overrides:
getHealthScaleFactorin classAbstractTestResultAction<TestResultAction>- Returns:
- a factor of
1.0to have the test health be the percentage of tests passing so 20% of tests failing will report as 80% health. A factor of2.0will mean that 20% of tests failing will report as 60% health. A factor of2.5will mean that 20% of test failing will report as 50% health. A factor of4.0will mean that 20% of tests failing will report as 20% health. A factor of5.0will mean that 20% (or more) of tests failing will report as 0% health. A factor of0.0will disable test health reporting.
-
setHealthScaleFactor
public void setHealthScaleFactor(double healthScaleFactor) -
getFailedTests
Description copied from class:AbstractTestResultActionA shortcut for summary.jelly- Overrides:
getFailedTestsin classAbstractTestResultAction<TestResultAction>- Returns:
- List of failed tests from associated test result.
-
getPassedTests
Description copied from class:AbstractTestResultActionA shortcut for scripting- Overrides:
getPassedTestsin classAbstractTestResultAction<TestResultAction>- Returns:
- List of passed tests from associated test result.
-
getSkippedTests
Description copied from class:AbstractTestResultActionA shortcut for scripting- Overrides:
getSkippedTestsin classAbstractTestResultAction<TestResultAction>- Returns:
- List of skipped tests from associated test result.
-
getTarget
- Specified by:
getTargetin 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.Datato 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:
readResolvein classAbstractTestResultAction<TestResultAction>
-
getWidget
-