Class FailureReader
- java.lang.Object
-
- com.sonyericsson.jenkins.plugins.bfa.model.FailureReader
-
- Direct Known Subclasses:
BuildLogFailureReader
,MultilineBuildLogFailureReader
public abstract class FailureReader extends Object
Reader used to find indications of a failure cause.- Author:
- Tomas Westling <tomas.westling@sonymobile.com>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FailureReader.InterruptibleCharSequence
CharSequence that notices thread interrupts -- as might be necessary to recover from a loose regex on unexpected challenging input.
-
Field Summary
Fields Modifier and Type Field Description protected Indication
indication
The indication we are looking for.
-
Constructor Summary
Constructors Constructor Description FailureReader(Indication indication)
Standard constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description FoundIndication
scan(AbstractBuild build)
Deprecated.FoundIndication
scan(AbstractBuild build, PrintStream buildLog)
Deprecated.FoundIndication
scan(Run build)
Scans a build log.FoundIndication
scan(Run build, PrintStream buildLog)
Scans for indications of a failure cause.protected FoundIndication
scanMultiLineOneFile(Run build, LineNumberReader reader, String currentFile)
Scans one file for the required multi-line pattern.static List<FoundFailureCause>
scanSingleLinePatterns(List<FailureCause> causes, Run build, BufferedReader reader, String currentFile)
Checks all patterns one-by-one for entire file.
-
-
-
Field Detail
-
indication
protected Indication indication
The indication we are looking for.
-
-
Constructor Detail
-
FailureReader
public FailureReader(Indication indication)
Standard constructor.- Parameters:
indication
- the indication to look for.
-
-
Method Detail
-
scan
@Deprecated public FoundIndication scan(AbstractBuild build) throws IOException
Deprecated.Scans a build log.- Parameters:
build
- - the build whose log should be scanned.- Returns:
- a FoundIndication if the pattern given by this FailureReader is found in the log of the given build; return null otherwise.
- Throws:
IOException
- if so.
-
scan
public FoundIndication scan(Run build) throws IOException
Scans a build log.- Parameters:
build
- - the build whose log should be scanned.- Returns:
- a FoundIndication if the pattern given by this FailureReader is found in the log of the given build; return null otherwise.
- Throws:
IOException
- if so.
-
scan
@Deprecated public FoundIndication scan(AbstractBuild build, PrintStream buildLog)
Deprecated.Scans for indications of a failure cause.- Parameters:
build
- the build to scan for indications.buildLog
- the log of the build.- Returns:
- a FoundIndication if something was found, null if not.
-
scan
public FoundIndication scan(Run build, PrintStream buildLog)
Scans for indications of a failure cause.- Parameters:
build
- the build to scan for indications.buildLog
- the log of the build.- Returns:
- a FoundIndication if something was found, null if not.
-
scanSingleLinePatterns
public static List<FoundFailureCause> scanSingleLinePatterns(List<FailureCause> causes, Run build, BufferedReader reader, String currentFile) throws IOException
Checks all patterns one-by-one for entire file.- Parameters:
causes
- list of failure causes that we a looking for.build
- current build.reader
- file reader.currentFile
- file name.- Returns:
- found indications.
- Throws:
IOException
- Exception.
-
scanMultiLineOneFile
protected FoundIndication scanMultiLineOneFile(Run build, LineNumberReader reader, String currentFile) throws IOException
Scans one file for the required multi-line pattern.- Parameters:
build
- the build we are processing.reader
- the reader to read from.currentFile
- the file path of the file we want to scan.- Returns:
- a FoundIndication if we find the pattern, null if not.
- Throws:
IOException
- if problems occur in the reader handling.
-
-