Class TestValue
- java.lang.Object
-
- org.jenkinsci.plugins.benchmark.results.TestGroup
-
- org.jenkinsci.plugins.benchmark.results.TestValue
-
- Direct Known Subclasses:
BooleanValue
,NumeralValue
,StringValue
public class TestValue extends TestGroup
Holds the core information of a standard test result- Since:
- 5/10/2017
- Author:
- Daniel Mercier
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TestValue.ValueType
-
Nested classes/interfaces inherited from class org.jenkinsci.plugins.benchmark.results.TestGroup
TestGroup.ClassType
-
-
Field Summary
Fields Modifier and Type Field Description static String
FAILED_STATE_COLOR
protected String
group
static String
PASSED_STATE_COLOR
protected ConcurrentHashMap<Integer,TestProperty>
properties
protected TestValue.ValueType
type
protected String
unit
-
Fields inherited from class org.jenkinsci.plugins.benchmark.results.TestGroup
ctype, description, groupHash, groups, name, parent, thresholds
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkThresholdStatus(Double previous, Double average)
Check attached thresholds to verify result validity.protected static TestValue.ValueType
checkType(String type)
static void
convertCondensedParameterJsonObject(com.google.gson.JsonObject object, TestGroup rootGroup, Map<Integer,TestValue> entityList, ContentDetected detected)
Convert a JSON object containing a parameter to the plugin construct [DISPLAY LOADING]static void
convertCondensedResultJsonObject(com.google.gson.JsonObject object, TestGroup rootGroup, Map<Integer,TestGroup> fileList, Map<Integer,TestValue> entityList, ContentDetected detected)
Convert a JSON object containing a condensed result to the plugin construct [DISPLAY LOADING]static void
convertParameterJsonObject(int build, com.google.gson.JsonObject object, TestGroup rootGroup, Map<Integer,TestValue> entityList)
Convert result/parameter content to the plug-in construct [DISPLAY LOAD]static void
convertResultJsonObject(int build, com.google.gson.JsonObject object, TestGroup rootGroup, Map<Integer,TestGroup> fileList, Map<Integer,TestValue> entityList, Map<Integer,TestValue> paramList)
Convert result/parameter content to the plug-in construct [DISPLAY LOAD]protected String
getColor(Boolean failedState)
com.google.gson.JsonObject
getCondensedJsonObject(int build, int hash)
Create an JSON object with the condensed information of this result [EXPORT CONDENSED]String
getCSVCondensed(ContentDetected detected)
Assemble the CSV content to display the condensed table [CSV EXPORT]String
getCSVResult(TreeSet<Integer> builds, ContentDetected detected)
Generate the CSV table content for this result [CSV EXPORT]String
getCSVResultState(Integer key, ContentDetected detected, TreeSet<Integer> builds)
Generate the CSV state content to describe this result state [CSV EXPORT]com.google.gson.JsonArray
getDataAsJsonArray(TreeSet<Integer> buildNumbers)
Boolean
getFailedState()
Boolean
getFailedState(int build)
String
getGroup()
String
getHTMLCondensed(Integer key, ContentDetected detected, char decimalSeparator)
Assemble the HTML content to display the condensed table [TABLE PAGE]String
getHTMLCondensedDetail(ContentDetected detected, char decimalSeparator)
Assemble the HTML content to display the condensed table [DETAIL PAGE]String
getHTMLDetails(Integer build, char decimalSeparator)
Generate the HTML detail content for this result and for a determined build [DETAIL PAGE]String
getHTMLParameter(Integer number, Integer build, char decimalSeparator)
Generate the HTML content for this parameter [DETAIL PAGE]String
getHTMLParameters(Integer build, char decimalSeparator)
Generate the HTML content for all the parameters for this result at a determined build [DETAIL PAGE]String
getHTMLResult(Integer key, ContentDetected detected, TreeSet<Integer> builds, List<Integer> listNPassed, List<Integer> listNFailed, char decimalSeparator)
Generate the HTML raw table content for this result [TABLE PAGE]String
getHTMLResult(TreeSet<Integer> builds, char decimalSeparator)
Generate the HTML table content for this result [DETAIL PAGE]Integer
getId()
Integer
getId(int build)
com.google.gson.JsonObject
getJsonObject(int hash)
Export result property to Json object [EXPORT RAW] Works in combination with getJsonObject() from result specific formatsMap<String,String>
getMessages()
Map<String,String>
getMessages(int build)
int
getNumberOfProperties()
com.google.gson.JsonObject
getParameterJsonObject(int hash)
Create an JSON object from a parameter [EXPORT CONDENSED]List<TestValue>
getParameters()
List<TestValue>
getParameters(int build)
ConcurrentHashMap<Integer,TestProperty>
getProperties()
TestValue.ValueType
getType()
String
getUnit()
String
getValueAsLocaleString(int build, char decimalSeparator)
String
getValueAsString(int build)
Boolean
isNumeral()
Return whether the TestValue is based on numeral valuesprotected static String
outputType(TestValue.ValueType type)
void
setFailedState(int build, Boolean failed)
void
setFailedState(Boolean failed)
void
setGroup()
void
setGroup(String group)
void
setId(int build, Integer id)
void
setId(Integer id)
void
setMessage(int build, String title, String message)
void
setMessage(String title, String message)
void
setMessages(int build, Map<String,String> messages)
void
setMessages(Map<String,String> messages)
void
setParameter(int build, TestValue parameter)
void
setParameter(TestValue parameter)
void
setParameters(int build, List<TestValue> parameters)
void
setParameters(List<TestValue> parameters)
-
Methods inherited from class org.jenkinsci.plugins.benchmark.results.TestGroup
addGroup, addThreshold, convertCondensedFileJsonObject, getAllConnectedParameters, getAllConnectedThresholds, getClassType, getConnectedParameters, getConnectedParentParameters, getConnectedParentThresholds, getConnectedThresholds, getDescription, getDescriptions, getFileGroup, getFileHash, getFileSubGroupFullName, getFullName, getGroup, getGroupHash, getName, getNumberOfGroups, getNumberOfThresholds, getParent, getTestGroups, getThreshold, isArray, isParameterGrp, isThresholdGrp
-
-
-
-
Field Detail
-
FAILED_STATE_COLOR
public static final String FAILED_STATE_COLOR
- See Also:
- Constant Field Values
-
PASSED_STATE_COLOR
public static final String PASSED_STATE_COLOR
- See Also:
- Constant Field Values
-
type
protected final TestValue.ValueType type
-
group
protected String group
-
unit
protected String unit
-
properties
protected final ConcurrentHashMap<Integer,TestProperty> properties
-
-
Method Detail
-
convertCondensedResultJsonObject
public static void convertCondensedResultJsonObject(com.google.gson.JsonObject object, TestGroup rootGroup, Map<Integer,TestGroup> fileList, Map<Integer,TestValue> entityList, ContentDetected detected)
Convert a JSON object containing a condensed result to the plugin construct [DISPLAY LOADING]- Parameters:
object
- Json Object to convertrootGroup
- Root groupfileList
- List of filesentityList
- List of generated entitiesdetected
- Key characteristics fo results
-
convertCondensedParameterJsonObject
public static void convertCondensedParameterJsonObject(com.google.gson.JsonObject object, TestGroup rootGroup, Map<Integer,TestValue> entityList, ContentDetected detected)
Convert a JSON object containing a parameter to the plugin construct [DISPLAY LOADING]- Parameters:
object
- Json Object to convertrootGroup
- Root groupentityList
- List of generated entitiesdetected
- Key characteristics fo results
-
convertResultJsonObject
public static void convertResultJsonObject(int build, com.google.gson.JsonObject object, TestGroup rootGroup, Map<Integer,TestGroup> fileList, Map<Integer,TestValue> entityList, Map<Integer,TestValue> paramList)
Convert result/parameter content to the plug-in construct [DISPLAY LOAD]- Parameters:
build
- Build numberobject
- Object to convertrootGroup
- Root groupfileList
- List of filesentityList
- List of result/parameter entitiesparamList
- List of parameters
-
convertParameterJsonObject
public static void convertParameterJsonObject(int build, com.google.gson.JsonObject object, TestGroup rootGroup, Map<Integer,TestValue> entityList)
Convert result/parameter content to the plug-in construct [DISPLAY LOAD]- Parameters:
build
- Build numberobject
- Object to convertrootGroup
- Root groupentityList
- List of result/parameter entities
-
getHTMLResult
public String getHTMLResult(TreeSet<Integer> builds, char decimalSeparator)
Generate the HTML table content for this result [DETAIL PAGE]- Parameters:
builds
- List of build numbersdecimalSeparator
- Decimal Separator- Returns:
- HTML content for this result
-
getJsonObject
public com.google.gson.JsonObject getJsonObject(int hash)
Export result property to Json object [EXPORT RAW] Works in combination with getJsonObject() from result specific formats- Overrides:
getJsonObject
in classTestGroup
- Parameters:
hash
- Result hash- Returns:
- Json Object
-
getParameterJsonObject
public com.google.gson.JsonObject getParameterJsonObject(int hash)
Create an JSON object from a parameter [EXPORT CONDENSED]- Parameters:
hash
- Result hash- Returns:
- JSON object
-
getHTMLDetails
public String getHTMLDetails(Integer build, char decimalSeparator)
Generate the HTML detail content for this result and for a determined build [DETAIL PAGE]- Parameters:
build
- Build numberdecimalSeparator
- Decimal Separator- Returns:
- HTML detail for this result
-
getHTMLResult
public String getHTMLResult(Integer key, ContentDetected detected, TreeSet<Integer> builds, List<Integer> listNPassed, List<Integer> listNFailed, char decimalSeparator)
Generate the HTML raw table content for this result [TABLE PAGE]- Parameters:
key
- Result hash valuedetected
- Key characteristic of this set of resultsbuilds
- List of build numberslistNPassed
- Number of passed result test for each buildlistNFailed
- Number of passed result test for each builddecimalSeparator
- Decimal Separator- Returns:
- HTML table content for this result
-
getCSVResult
public String getCSVResult(TreeSet<Integer> builds, ContentDetected detected)
Generate the CSV table content for this result [CSV EXPORT]- Parameters:
builds
- List of build numbersdetected
- Key characteristic of this set of results- Returns:
- CSV table content for result
-
getCSVResultState
public String getCSVResultState(Integer key, ContentDetected detected, TreeSet<Integer> builds)
Generate the CSV state content to describe this result state [CSV EXPORT]- Parameters:
key
- Result hash valuedetected
- Key characteristic of this set of resultsbuilds
- List of build numbers- Returns:
- CSV table state content for result
-
getHTMLParameters
public String getHTMLParameters(Integer build, char decimalSeparator)
Generate the HTML content for all the parameters for this result at a determined build [DETAIL PAGE]- Parameters:
build
- Build numberdecimalSeparator
- Decimal Separator- Returns:
- HTML content for all parameters
-
getHTMLParameter
public String getHTMLParameter(Integer number, Integer build, char decimalSeparator)
Generate the HTML content for this parameter [DETAIL PAGE]- Parameters:
number
- Displayed parameter numberbuild
- Build numberdecimalSeparator
- Decimal Separator- Returns:
- HTML content for this parameter
-
getHTMLCondensed
public String getHTMLCondensed(Integer key, ContentDetected detected, char decimalSeparator)
Assemble the HTML content to display the condensed table [TABLE PAGE]- Parameters:
key
- Result keydetected
- Key characteristics of resultsdecimalSeparator
- Decimal separator- Returns:
- HTML content
-
getHTMLCondensedDetail
public String getHTMLCondensedDetail(ContentDetected detected, char decimalSeparator)
Assemble the HTML content to display the condensed table [DETAIL PAGE]- Parameters:
detected
- Key characteristics of resultsdecimalSeparator
- Decimal separator- Returns:
- HTML content
-
getCSVCondensed
public String getCSVCondensed(ContentDetected detected)
Assemble the CSV content to display the condensed table [CSV EXPORT]- Parameters:
detected
- Key characteristics of results- Returns:
- CSV content
-
getCondensedJsonObject
public com.google.gson.JsonObject getCondensedJsonObject(int build, int hash)
Create an JSON object with the condensed information of this result [EXPORT CONDENSED]- Parameters:
build
- Build numberhash
- Result hash- Returns:
- JSON object
-
isNumeral
public Boolean isNumeral()
Return whether the TestValue is based on numeral values- Returns:
- Whether class is numeral
-
checkThresholdStatus
public void checkThresholdStatus(Double previous, Double average)
Check attached thresholds to verify result validity.- Parameters:
previous
- Previous valueaverage
- Calculated average
-
setId
public void setId(Integer id)
-
setId
public void setId(int build, Integer id)
-
setFailedState
public void setFailedState(Boolean failed)
-
setFailedState
public void setFailedState(int build, Boolean failed)
-
setParameter
public void setParameter(TestValue parameter)
-
setParameter
public void setParameter(int build, TestValue parameter)
-
setGroup
public void setGroup()
-
setGroup
public void setGroup(String group)
-
getType
public TestValue.ValueType getType()
-
getGroup
public String getGroup()
-
getUnit
public String getUnit()
-
getProperties
public ConcurrentHashMap<Integer,TestProperty> getProperties()
-
getValueAsString
public String getValueAsString(int build)
-
getValueAsLocaleString
public String getValueAsLocaleString(int build, char decimalSeparator)
-
getFailedState
public Boolean getFailedState()
-
getFailedState
public Boolean getFailedState(int build)
-
getId
public Integer getId()
-
getId
public Integer getId(int build)
-
getNumberOfProperties
public int getNumberOfProperties()
-
checkType
protected static TestValue.ValueType checkType(String type)
-
outputType
protected static String outputType(TestValue.ValueType type)
-
getDataAsJsonArray
public com.google.gson.JsonArray getDataAsJsonArray(TreeSet<Integer> buildNumbers) throws InvalidClassException
- Throws:
InvalidClassException
-
-