Class MockCompilerIssues
- java.lang.Object
-
- net.officefloor.compile.test.issues.MockCompilerIssues
-
- All Implemented Interfaces:
CompilerIssues
public class MockCompilerIssues extends java.lang.Object implements CompilerIssues
MockCompilerIssues
.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description MockCompilerIssues(MockTestSupport mockTestSupport)
Initiate withMockTestSupport
.MockCompilerIssues(OfficeFrameTestCase testCase)
Initiate withOfficeFrameTestCase
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompileError
addIssue(Node node, java.lang.String issueDescription, java.lang.Throwable cause)
Adds an issue regarding a particularNode
.CompileError
addIssue(Node node, java.lang.String issueDescription, CompilerIssue... causes)
Adds an issue regarding a particularNode
.<R> IssueCapture<R>
captureIssues(java.util.function.Supplier<R> supplier)
CapturesCompilerIssue
instances.CompilerIssue[]
recordCaptureIssues(boolean isIssue)
Records the capturing theCompilerIssue
instances.void
recordCaptureIssues_repeated(int repetitions)
Records a number of capturing theCompilerIssue
instances.void
recordIssue(java.lang.String nodeName, java.lang.Class<? extends Node> nodeClass, java.lang.String issueDescription, java.lang.Throwable cause)
Records an issue against aNode
.void
recordIssue(java.lang.String nodeName, java.lang.Class<? extends Node> nodeClass, java.lang.String issueDescription, CompilerIssue... capturedIssues)
Records an issue against aNode
.void
recordIssue(java.lang.String issueDescription, java.lang.Throwable cause)
Records a top level issue.void
recordIssue(java.lang.String issueDescription, CompilerIssue... capturedIssues)
Records a top level issue.void
recordIssueRegex(java.lang.String nodeName, java.lang.Class<? extends Node> nodeClass, java.lang.String issueDescription, java.lang.Throwable cause)
Records an issue against aNode
.void
recordIssueRegex(java.lang.String nodeName, java.lang.Class<? extends Node> nodeClass, java.lang.String issueDescription, CompilerIssue... capturedIssues)
Records an issue against aNode
.
-
-
-
Constructor Detail
-
MockCompilerIssues
public MockCompilerIssues(OfficeFrameTestCase testCase)
Initiate withOfficeFrameTestCase
.- Parameters:
testCase
-OfficeFrameTestCase
.
-
MockCompilerIssues
public MockCompilerIssues(MockTestSupport mockTestSupport)
Initiate withMockTestSupport
.- Parameters:
mockTestSupport
-MockTestSupport
.
-
-
Method Detail
-
recordCaptureIssues
public CompilerIssue[] recordCaptureIssues(boolean isIssue)
Records the capturing theCompilerIssue
instances.- Parameters:
isIssue
- Flag indicating if there is aCompilerIssue
.- Returns:
- Captured
CompilerIssue
instances.
-
recordCaptureIssues_repeated
public void recordCaptureIssues_repeated(int repetitions)
Records a number of capturing theCompilerIssue
instances.- Parameters:
repetitions
- Number of repetitions.
-
recordIssue
public void recordIssue(java.lang.String nodeName, java.lang.Class<? extends Node> nodeClass, java.lang.String issueDescription, CompilerIssue... capturedIssues)
Records an issue against aNode
.- Parameters:
nodeName
- Name of theNode
.nodeClass
-Class
of theNode
reporting the issue.issueDescription
- Expected issue description.capturedIssues
- CapturedCompilerIssue
instances.
-
recordIssue
public void recordIssue(java.lang.String nodeName, java.lang.Class<? extends Node> nodeClass, java.lang.String issueDescription, java.lang.Throwable cause)
Records an issue against aNode
.
-
recordIssueRegex
public void recordIssueRegex(java.lang.String nodeName, java.lang.Class<? extends Node> nodeClass, java.lang.String issueDescription, CompilerIssue... capturedIssues)
Records an issue against aNode
.- Parameters:
nodeName
- Name of theNode
.nodeClass
-Class
of theNode
reporting the issue.issueDescription
- Expected issue description as regular expression.capturedIssues
- CapturedCompilerIssue
instances.
-
recordIssueRegex
public void recordIssueRegex(java.lang.String nodeName, java.lang.Class<? extends Node> nodeClass, java.lang.String issueDescription, java.lang.Throwable cause)
Records an issue against aNode
.
-
recordIssue
public void recordIssue(java.lang.String issueDescription, CompilerIssue... capturedIssues)
Records a top level issue.- Parameters:
issueDescription
- Expected issue description.capturedIssues
- CapturedCompilerIssue
instances.
-
recordIssue
public void recordIssue(java.lang.String issueDescription, java.lang.Throwable cause)
Records a top level issue.- Parameters:
issueDescription
- Expected issue description.cause
- Expected cause.
-
captureIssues
public <R> IssueCapture<R> captureIssues(java.util.function.Supplier<R> supplier)
Description copied from interface:CompilerIssues
CapturesCompilerIssue
instances.- Specified by:
captureIssues
in interfaceCompilerIssues
- Type Parameters:
R
- Return type ofSupplier
logic.- Parameters:
supplier
-Supplier
of code to captureCompilerIssue
within.- Returns:
IssueCapture
.
-
addIssue
public CompileError addIssue(Node node, java.lang.String issueDescription, CompilerIssue... causes)
Description copied from interface:CompilerIssues
Adds an issue regarding a particularNode
.- Specified by:
addIssue
in interfaceCompilerIssues
- Parameters:
node
-Node
.issueDescription
- Description of the issue.causes
- PossibleCompilerIssue
instances causing this issue.- Returns:
CompileError
to be used inthrow
statement when addingCompilerIssue
to avoid further compiling of theNode
.
-
addIssue
public CompileError addIssue(Node node, java.lang.String issueDescription, java.lang.Throwable cause)
Description copied from interface:CompilerIssues
Adds an issue regarding a particularNode
.- Specified by:
addIssue
in interfaceCompilerIssues
- Parameters:
node
-Node
.issueDescription
- Description of the issue.cause
- Cause of the issue.- Returns:
CompileError
to be used inthrow
statement when addingCompilerIssue
to avoid further compiling of theNode
.
-
-