Klasse SourceCodeFacade
java.lang.Object
io.jenkins.plugins.coverage.metrics.source.SourceCodeFacade
Facade to the source code file structure in Jenkins build folder. Access of those files should be done using an
instance of this class only.
- Autor:
- Ullrich Hafner, Florian Orendi
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcalculateIndirectCoverageChangesSourceCode
(String content, edu.hm.hafner.coverage.FileNode fileNode) Filters the sourcecode coverage highlighting for analyzing indirect coverage changes only.calculateModifiedLinesCoverageSourceCode
(String content, edu.hm.hafner.coverage.FileNode fileNode) Filters the sourcecode coverage highlighting for analyzing the modified lines coverage only.boolean
Returns whether the source code is available for the specified source file.boolean
hasStoredSourceCode
(File buildResults, String id) Checks whether any source files has been stored.Reads the contents of the source file of the given file into a String.
-
Konstruktordetails
-
SourceCodeFacade
public SourceCodeFacade()
-
-
Methodendetails
-
read
public String read(File buildResults, String id, String path) throws IOException, InterruptedException Reads the contents of the source file of the given file into a String.- Parameter:
buildResults
- Jenkins directory for build resultsid
- if of the coverage resultspath
- relative path to the coverage node base filename of the coverage node- Gibt zurück:
- the file content as String
- Löst aus:
IOException
InterruptedException
-
canRead
Returns whether the source code is available for the specified source file.- Parameter:
buildResults
- Jenkins directory for build resultsid
- if of the coverage resultspath
- relative path to the source code filename name- Gibt zurück:
- the file content as String
-
hasStoredSourceCode
Checks whether any source files has been stored. Even if it is wanted, there might have been errors which cause the absence of any source files.- Parameter:
buildResults
- Jenkins directory for build resultsid
- id of the coverage results- Gibt zurück:
true
whether source files has been stored, elsefalse
-
calculateModifiedLinesCoverageSourceCode
public String calculateModifiedLinesCoverageSourceCode(String content, edu.hm.hafner.coverage.FileNode fileNode) Filters the sourcecode coverage highlighting for analyzing the modified lines coverage only.- Parameter:
content
- The original HTML contentfileNode
- Thenode
which represents the coverage of the file- Gibt zurück:
- the filtered HTML sourcecode view
-
calculateIndirectCoverageChangesSourceCode
public String calculateIndirectCoverageChangesSourceCode(String content, edu.hm.hafner.coverage.FileNode fileNode) Filters the sourcecode coverage highlighting for analyzing indirect coverage changes only.- Parameter:
content
- The original HTML contentfileNode
- Thenode
which represents the coverage of the file- Gibt zurück:
- the filtered HTML sourcecode view
-