Interface AutotestRunner
- All Known Implementing Classes:
SelfTest
@TestInstance(PER_CLASS)
public interface AutotestRunner
An interface that runs specified actions for stages:
beforeAll
, beforeEach
, tests
, afterEach
, and afterAll
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.slf4j.Logger
A logger to record the activity of this object. -
Method Summary
Modifier and TypeMethodDescriptioncom.github.dakusui.actionunit.visitors.ReportingActionPerformer
Creates a reporting action performer.default void
afterAll
(com.github.dakusui.actionunit.core.Action action, com.github.dakusui.actionunit.io.Writer writer) Performs a givenaction
for afterAll stage and writes a report of the activity towriter
default void
afterEach
(com.github.dakusui.actionunit.core.Action action, com.github.dakusui.actionunit.io.Writer writer) Performs a givenaction
for afterEach stage and writes a report of the activity towriter
default void
beforeAll
(com.github.dakusui.actionunit.core.Action action, com.github.dakusui.actionunit.io.Writer writer) Performs a givenaction
for beforeAll stage and writes a report of the activity towriter
default void
beforeEach
(com.github.dakusui.actionunit.core.Action action, com.github.dakusui.actionunit.io.Writer writer) Performs a givenaction
for beforeEach stage and writes a report of the activity towriter
static String
composeResultMessage
(Class<? extends AutotestRunner> aClass, String stageName, String testName, boolean succeeded) Composes a line in a report.default com.github.dakusui.actionunit.io.Writer
createWriter
(List<String> out) Creates a writer through which action activities are reported.default void
runTestAction
(String name, com.github.dakusui.actionunit.core.Action action) A template that defines the overall scenario of a test.
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGERA logger to record the activity of this object.
-
-
Method Details
-
beforeAll
default void beforeAll(com.github.dakusui.actionunit.core.Action action, com.github.dakusui.actionunit.io.Writer writer) Performs a givenaction
for beforeAll stage and writes a report of the activity towriter
- Parameters:
action
- An action to be performed asbeforeAll
stage.writer
- A writer through which report of theaction
will be written.
-
beforeEach
default void beforeEach(com.github.dakusui.actionunit.core.Action action, com.github.dakusui.actionunit.io.Writer writer) Performs a givenaction
for beforeEach stage and writes a report of the activity towriter
- Parameters:
action
- An action to be performed asbeforeEach
stage.writer
- A writer through which report of theaction
will be written.
-
runTestAction
@TestTemplate default void runTestAction(String name, com.github.dakusui.actionunit.core.Action action) A template that defines the overall scenario of a test.- Parameters:
name
- A name of a test.action
- An action executed as a test.
-
afterEach
default void afterEach(com.github.dakusui.actionunit.core.Action action, com.github.dakusui.actionunit.io.Writer writer) Performs a givenaction
for afterEach stage and writes a report of the activity towriter
- Parameters:
action
- An action to be performed.writer
- A writer through which a report is written.
-
afterAll
default void afterAll(com.github.dakusui.actionunit.core.Action action, com.github.dakusui.actionunit.io.Writer writer) Performs a givenaction
for afterAll stage and writes a report of the activity towriter
- Parameters:
action
- An action to be performed.writer
- A writer through which a report is written.
-
createWriter
-
actionPerformer
com.github.dakusui.actionunit.visitors.ReportingActionPerformer actionPerformer()Creates a reporting action performer. A class of reporting action performers is defined in actionunit library.- Returns:
- A reporting action performer.
-
composeResultMessage
static String composeResultMessage(Class<? extends AutotestRunner> aClass, String stageName, String testName, boolean succeeded) Composes a line in a report.- Parameters:
aClass
- A test class.stageName
- A name of a stage such asbeforeAll
,beforeEach
.testName
- A name of a test.succeeded
-true
- succeeded /false
- otherwise.- Returns:
- A composed result message.
-