Klasse CoverageViewModel
java.lang.Object
io.jenkins.plugins.datatables.DefaultAsyncTableContentProvider
io.jenkins.plugins.coverage.model.CoverageViewModel
- Alle implementierten Schnittstellen:
ModelObject,io.jenkins.plugins.datatables.AsyncTableContentProvider
- Bekannte direkte Unterklassen:
SourceViewModel
public class CoverageViewModel
extends io.jenkins.plugins.datatables.DefaultAsyncTableContentProvider
implements ModelObject
Server side model that provides the data for the details view of the coverage results. The layout of the associated
view is defined corresponding jelly view 'index.jelly'.
- Autor:
- Ullrich Hafner, Florian Orendi
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic classUI model for the coverage overview bar chart. -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCoverageViewModel(Run<?, ?> owner, CoverageNode node) Creates a new view model instance. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungedu.hm.hafner.echarts.TreeMapNodegetChangeCoverageTree(String coverageMetric) Returns the root of the filtered tree of change coverage nodes for the ECharts treemap.edu.hm.hafner.echarts.TreeMapNodegetCoverageChangesTree(String coverageMetric) Returns the root of the filtered tree of indirect coverage changes for the ECharts treemap.edu.hm.hafner.echarts.TreeMapNodegetCoverageTree(String coverageMetric) Returns the root of the tree of nodes for the ECharts treemap.getDynamic(String link, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) Returns a new sub-page for the selected link.static FilegetFileForBuildsWithOldVersion(File buildFolder, String fileName) Returns a file to the sources in release in the old format of the plugin versions less than 2.1.0.getId()Gets a set of color IDs which can be used to dynamically load the defined Jenkins colors.getNode()Run<?, ?> getOwner()getSourceCode(String fileHash, String tableId) Gets the source code of the file which is represented by the passed hash code.io.jenkins.plugins.datatables.TableModelgetTableModel(String tableId) Returns the table model that matches with the passed table ID and shows the files along with the branch and line coverage.getTrendChart(String configuration) Returns the trend chart configuration.getUrlForBuild(String selectedBuildDisplayName, String currentUrl) Returns the URL for coverage results of the selected build.booleanChecks whether change coverage exists.booleanChecks whether indirect coverage changes exist.booleanChecks whether source files are stored.booleanisSourceFileAvailable(CoverageNode coverageNode) Returns whether the source file is available in Jenkins build folder.booleanisSourceFileInNewFormatAvailable(CoverageNode coverageNode) Returns whether the source file is available in Jenkins build folder in the new format of the plugin versions greater or equal than 2.1.0.booleanisSourceFileInOldFormatAvailable(CoverageNode coverageNode) Returns whether the source file is available in Jenkins build folder in the old format of the plugin versions less than 2.1.0.voidsetJenkinsColors(String colors) Creates a newColorProviderbased on the passed color json string which contains the set Jenkins colors.Von Klasse geerbte Methoden io.jenkins.plugins.datatables.DefaultAsyncTableContentProvider
getTableRows
-
Konstruktordetails
-
CoverageViewModel
Creates a new view model instance.- Parameter:
owner- the owner of this viewnode- the coverage node to be shown
-
-
Methodendetails
-
getId
-
getOwner
-
getNode
-
getDisplayName
- Angegeben von:
getDisplayNamein SchnittstelleModelObject
-
getJenkinsColorIDs
Gets a set of color IDs which can be used to dynamically load the defined Jenkins colors.- Gibt zurück:
- the available color IDs
-
setJenkinsColors
Creates a newColorProviderbased on the passed color json string which contains the set Jenkins colors.- Parameter:
colors- The dynamically loaded Jenkins colors to be used for highlighting the coverage tree as json string
-
getOverview
-
getChangeCoverageOverview
-
getTrendChart
Returns the trend chart configuration.- Parameter:
configuration- JSON object to configure optional properties for the trend chart- Gibt zurück:
- the trend chart model (converted to a JSON string)
-
getCoverageTree
Returns the root of the tree of nodes for the ECharts treemap. This tree is used as model for the chart on the client side. The tree is available for line and branch coverage.- Parameter:
coverageMetric- The used coverage metric - the default is the line coverage- Gibt zurück:
- the tree of nodes for the ECharts treemap
-
getChangeCoverageTree
@JavaScriptMethod public edu.hm.hafner.echarts.TreeMapNode getChangeCoverageTree(String coverageMetric) Returns the root of the filtered tree of change coverage nodes for the ECharts treemap. This tree is used as model for the chart on the client side. The tree is available for line and branch coverage.- Parameter:
coverageMetric- The used coverage metric - the default is the line coverage- Gibt zurück:
- the tree of change coverage nodes for the ECharts treemap
-
getCoverageChangesTree
@JavaScriptMethod public edu.hm.hafner.echarts.TreeMapNode getCoverageChangesTree(String coverageMetric) Returns the root of the filtered tree of indirect coverage changes for the ECharts treemap. This tree is used as model for the chart on the client side. The tree is available for line and branch coverage.- Parameter:
coverageMetric- The used coverage metric - the default is the line coverage- Gibt zurück:
- the tree of indirect coverage changes nodes for the ECharts treemap
-
getTableModel
Returns the table model that matches with the passed table ID and shows the files along with the branch and line coverage.- Angegeben von:
getTableModelin Schnittstelleio.jenkins.plugins.datatables.AsyncTableContentProvider- Parameter:
tableId- ID of the table model- Gibt zurück:
- the table model with the specified ID
-
getUrlForBuild
Returns the URL for coverage results of the selected build. Based on the current URL, the new URL will be composed by replacing the current build number with the selected build number.- Parameter:
selectedBuildDisplayName- the selected build to open the new results forcurrentUrl- the absolute URL to this details view results- Gibt zurück:
- the URL to the results or an empty string if the results are not available
-
getSourceCode
Gets the source code of the file which is represented by the passed hash code. The coverage of the source code is highlighted by using HTML. Depending on the passed table ID, the source code is returned filtered with only the relevant lines of code.- Parameter:
fileHash- The hash code of the requested filetableId- The ID of the source file table- Gibt zurück:
- the highlighted source code
-
hasSourceCode
@JavaScriptMethod public boolean hasSourceCode()Checks whether source files are stored.- Gibt zurück:
truewhen source files are stored,falseotherwise- Seit:
- 3.0.0
-
hasChangeCoverage
public boolean hasChangeCoverage()Checks whether change coverage exists.- Gibt zurück:
truewhether change coverage exists, elsefalse
-
hasIndirectCoverageChanges
public boolean hasIndirectCoverageChanges()Checks whether indirect coverage changes exist.- Gibt zurück:
truewhether indirect coverage changes exist, elsefalse
-
isSourceFileAvailable
Returns whether the source file is available in Jenkins build folder.- Parameter:
coverageNode- TheCoverageNodewhich is checked if there is a source file available- Gibt zurück:
trueif the source file is available,falseotherwise
-
isSourceFileInOldFormatAvailable
Returns whether the source file is available in Jenkins build folder in the old format of the plugin versions less than 2.1.0.- Parameter:
coverageNode- TheCoverageNodewhich is checked if there is a source file available- Gibt zurück:
trueif the source file is available,falseotherwise
-
getFileForBuildsWithOldVersion
Returns a file to the sources in release in the old format of the plugin versions less than 2.1.0.- Parameter:
buildFolder- top-level folder of the build resultsfileName- base filename of the coverage node- Gibt zurück:
- the file
-
isSourceFileInNewFormatAvailable
Returns whether the source file is available in Jenkins build folder in the new format of the plugin versions greater or equal than 2.1.0.- Parameter:
coverageNode- TheCoverageNodewhich is checked if there is a source file available- Gibt zurück:
trueif the source file is available,falseotherwise
-
getDynamic
@CheckForNull public SourceViewModel getDynamic(String link, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) Returns a new sub-page for the selected link.- Parameter:
link- the link to identify the sub-page to showrequest- Stapler requestresponse- Stapler response- Gibt zurück:
- the new sub-page
-