hudson.plugins.labeledgroupedtests
Class LabeledTestResultGroup

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.tasks.junit.TestObject
          extended by hudson.tasks.test.TestObject
              extended by hudson.tasks.test.TestResult
                  extended by hudson.tasks.test.TabulatedResult
                      extended by hudson.tasks.test.MetaTabulatedResult
                          extended by hudson.plugins.labeledgroupedtests.LabeledTestResultGroup
All Implemented Interfaces:
hudson.model.ModelObject, hudson.search.SearchableModelObject, hudson.search.SearchItem, java.io.Serializable

@ExportedBean
public class LabeledTestResultGroup
extends hudson.tasks.test.MetaTabulatedResult

Represents a list of several test results that share a common label. It is designed to be used for children of MetaLabeledTestResultGroup.

See Also:
Serialized Form

Field Summary
protected  boolean cacheDirty
           
protected  java.util.List<hudson.tasks.test.TestResult> children
          We expect a maximum of one AbstractTestResult per parser class.
protected  java.util.Map<java.lang.String,hudson.tasks.test.TestResult> childrenByName
           
protected  java.util.List<hudson.tasks.test.TestResult> childrenWithFailures
           
protected  java.lang.String description
           
protected  float duration
           
protected  int failCount
           
protected  java.lang.String label
           
protected  boolean namesHaveBeenSet
           
protected  java.util.Map<hudson.tasks.test.TestResult,java.lang.String> nameToChildMap
           
protected  hudson.tasks.test.TestResult parent
           
protected  int passCount
           
protected  java.util.List<hudson.tasks.test.TestResult> passedChildren
           
protected  int skipCount
           
protected  int totalCount
           
 
Constructor Summary
LabeledTestResultGroup()
           
LabeledTestResultGroup(hudson.tasks.test.TestResult parent, java.lang.String label, java.util.List<hudson.tasks.test.TestResult> children)
           
 
Method Summary
 void addAll(LabeledTestResultGroup group)
          Add the children from this group, unless we've already got them
 void addResult(hudson.tasks.test.TestResult result)
          Add the result, unless we've already got it
 hudson.tasks.test.TestResult findCorrespondingResult(java.lang.String id)
           
 hudson.tasks.test.TestResult getChildByIndex(int i)
           
 java.util.Collection<? extends hudson.tasks.test.TestResult> getChildren()
           
 java.lang.String getDisplayName()
           
 java.lang.String getDisplayNameForChild(hudson.tasks.test.TestResult c)
           
 float getDuration()
           
 java.lang.Object getDynamic(java.lang.String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
           
 int getFailCount()
           
 int getFailDiff()
           
 java.util.Collection<? extends hudson.tasks.test.TestResult> getFailedTests()
           
 java.lang.String getLabel()
           
 java.lang.String getName()
           
 hudson.model.AbstractBuild<?,?> getOwner()
           
 hudson.tasks.test.TestObject getParent()
           
 int getPassCount()
           
 int getPassDiff()
           
 hudson.tasks.test.TestResult getPreviousResult()
           
 hudson.tasks.test.TestResult getResultInBuild(hudson.model.AbstractBuild<?,?> build)
           
 int getSkipCount()
           
 int getSkipDiff()
           
 int getTotalDiff()
           
 boolean hasChildren()
           
protected  void lockInNames()
          Either this *or* setNameMap should be called.
 java.lang.Object readResolve()
          Allow the object to rebuild its internal data structures when it is deserialized.
 void setNameMap(java.util.HashMap<hudson.tasks.test.TestResult,java.lang.String> resultToNameMap)
          This method records a unique name for each child result.
 void setParentAction(hudson.tasks.test.AbstractTestResultAction action)
           
 void tally()
           
 java.lang.String toPrettyString()
           
protected  void updateCache()
           
 
Methods inherited from class hudson.tasks.test.TabulatedResult
getChildTitle
 
Methods inherited from class hudson.tasks.test.TestResult
annotate, getBuildResult, getErrorDetails, getErrorStackTrace, getFailedSince, getFailedSinceRun, getParentAction, getPassedTests, getSkippedTests, getStderr, getStdout, getTitle, isPassed, setParent
 
Methods inherited from class hudson.tasks.test.TestObject
doSubmitDescription, getApi, getDescription, getDurationString, getHistory, getId, getRelativePathFrom, getSafeName, getSearchUrl, getTestAction, getTestActions, getTestResult, getTestResultAction, getTopLevelTestResult, getTotalCount, getUrl, safe, setDescription, uniquifyName
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

children

protected java.util.List<hudson.tasks.test.TestResult> children
We expect a maximum of one AbstractTestResult per parser class.


childrenWithFailures

protected transient java.util.List<hudson.tasks.test.TestResult> childrenWithFailures

passedChildren

protected transient java.util.List<hudson.tasks.test.TestResult> passedChildren

label

protected java.lang.String label

failCount

protected int failCount

skipCount

protected int skipCount

passCount

protected int passCount

totalCount

protected int totalCount

duration

protected float duration

parent

protected hudson.tasks.test.TestResult parent

description

protected java.lang.String description

cacheDirty

protected transient boolean cacheDirty

childrenByName

protected java.util.Map<java.lang.String,hudson.tasks.test.TestResult> childrenByName

nameToChildMap

protected java.util.Map<hudson.tasks.test.TestResult,java.lang.String> nameToChildMap

namesHaveBeenSet

protected boolean namesHaveBeenSet
Constructor Detail

LabeledTestResultGroup

public LabeledTestResultGroup()

LabeledTestResultGroup

public LabeledTestResultGroup(hudson.tasks.test.TestResult parent,
                              java.lang.String label,
                              java.util.List<hudson.tasks.test.TestResult> children)
Method Detail

setParentAction

public void setParentAction(hudson.tasks.test.AbstractTestResultAction action)
Overrides:
setParentAction in class hudson.tasks.test.TestResult

getPassCount

@Exported(visibility=99)
public int getPassCount()
Overrides:
getPassCount in class hudson.tasks.test.TestResult

getSkipCount

@Exported(visibility=99)
public int getSkipCount()
Overrides:
getSkipCount in class hudson.tasks.test.TestResult

getFailCount

@Exported(visibility=99)
public int getFailCount()
Overrides:
getFailCount in class hudson.tasks.test.TestResult

getLabel

@Exported(visibility=99)
public java.lang.String getLabel()

getName

public java.lang.String getName()
Overrides:
getName in class hudson.tasks.test.TestObject

getDisplayNameForChild

public java.lang.String getDisplayNameForChild(hudson.tasks.test.TestResult c)

getChildByIndex

public hudson.tasks.test.TestResult getChildByIndex(int i)

getDynamic

public java.lang.Object getDynamic(java.lang.String token,
                                   org.kohsuke.stapler.StaplerRequest req,
                                   org.kohsuke.stapler.StaplerResponse rsp)
Overrides:
getDynamic in class hudson.tasks.test.TestObject

readResolve

public java.lang.Object readResolve()
Allow the object to rebuild its internal data structures when it is deserialized.


tally

public void tally()
Overrides:
tally in class hudson.tasks.test.TestResult

updateCache

protected void updateCache()

getFailedTests

public java.util.Collection<? extends hudson.tasks.test.TestResult> getFailedTests()
Specified by:
getFailedTests in class hudson.tasks.test.MetaTabulatedResult

getChildren

@Exported(visibility=99)
public java.util.Collection<? extends hudson.tasks.test.TestResult> getChildren()
Specified by:
getChildren in class hudson.tasks.test.TabulatedResult

hasChildren

public boolean hasChildren()
Specified by:
hasChildren in class hudson.tasks.test.TabulatedResult

getOwner

public hudson.model.AbstractBuild<?,?> getOwner()
Specified by:
getOwner in class hudson.tasks.test.TestObject

getParent

public hudson.tasks.test.TestObject getParent()
Overrides:
getParent in class hudson.tasks.test.TestObject

getDuration

public float getDuration()
Overrides:
getDuration in class hudson.tasks.test.TestResult

getDisplayName

@Exported(visibility=99)
public java.lang.String getDisplayName()

addResult

public void addResult(hudson.tasks.test.TestResult result)
Add the result, unless we've already got it

Parameters:
result -

addAll

public void addAll(LabeledTestResultGroup group)
Add the children from this group, unless we've already got them

Parameters:
group -

getPreviousResult

public hudson.tasks.test.TestResult getPreviousResult()
Overrides:
getPreviousResult in class hudson.tasks.test.TestResult

getResultInBuild

public hudson.tasks.test.TestResult getResultInBuild(hudson.model.AbstractBuild<?,?> build)
Overrides:
getResultInBuild in class hudson.tasks.test.TestResult

findCorrespondingResult

public hudson.tasks.test.TestResult findCorrespondingResult(java.lang.String id)
Specified by:
findCorrespondingResult in class hudson.tasks.test.TestObject

toPrettyString

public java.lang.String toPrettyString()
Overrides:
toPrettyString in class hudson.tasks.test.TestResult

getPassDiff

public int getPassDiff()

getSkipDiff

public int getSkipDiff()

getFailDiff

public int getFailDiff()

getTotalDiff

public int getTotalDiff()

setNameMap

public void setNameMap(java.util.HashMap<hudson.tasks.test.TestResult,java.lang.String> resultToNameMap)
This method records a unique name for each child result. Either this *or* lockInNames should be called. setNameMap is much better, This method allows the caller to provide meaningful names based on information that will not be available later. See $:peform


lockInNames

protected void lockInNames()
Either this *or* setNameMap should be called. Both record a unique name for each child result. This method generates names based only on the information it has available to it, while setNameMap can use additional information available outside this class. I don't expect that this will be called in the normal course of using the LabeledResultGroupArchiver, but I've implemented it so that we can still drill down to chilldren of the result group even if the name map was somehow lost or corrupted.



Copyright © 2015 Yahoo!, Inc.. All Rights Reserved.