Package io.qameta.allure.junitplatform
Class AllureJunitPlatform
java.lang.Object
io.qameta.allure.junitplatform.AllureJunitPlatform
- All Implemented Interfaces:
org.junit.platform.launcher.TestExecutionListener
public class AllureJunitPlatform
extends Object
implements org.junit.platform.launcher.TestExecutionListener
Reports JUnit Platform execution to Allure.
Register this listener with the JUnit Platform launcher to translate test plan, container, test, fixture, report-entry, and failure events into Allure results. It is the core listener used by Platform-based Allure adapters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConfiguration key for allure fixture.static final StringConfiguration key for allure parameter.static final StringConfiguration key for allure parameter excluded key.static final StringConfiguration key for allure parameter mode key.static final StringConfiguration key for allure parameter value key.static final StringConfiguration key for allure report entry blank prefix.static final StringConstant value for event failure.static final StringConstant value for event start.static final StringConstant value for event stop.static final StringConstant value for junit platform unique id.static final StringConstant value for prepare.static final StringConstant value for tear down. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an Allure junit platform with default configuration.AllureJunitPlatform(io.qameta.allure.AllureLifecycle lifecycle) Creates an Allure junit platform with the supplied values. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecutionFinished(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult) voidexecutionSkipped(org.junit.platform.launcher.TestIdentifier testIdentifier, String reason) voidexecutionStarted(org.junit.platform.launcher.TestIdentifier testIdentifier) protected StringgetHistoryId(org.junit.platform.launcher.TestIdentifier testIdentifier) Returns the history id.io.qameta.allure.AllureLifecycleReturns the lifecycle.protected io.qameta.allure.model.StatusReturns the status.voidreportingEntryPublished(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.reporting.ReportEntry entry) voidtestPlanExecutionFinished(org.junit.platform.launcher.TestPlan testPlan) voidtestPlanExecutionStarted(org.junit.platform.launcher.TestPlan testPlan) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.junit.platform.launcher.TestExecutionListener
dynamicTestRegistered
-
Field Details
-
ALLURE_REPORT_ENTRY_BLANK_PREFIX
Configuration key for allure report entry blank prefix.- See Also:
-
ALLURE_PARAMETER
Configuration key for allure parameter.- See Also:
-
ALLURE_PARAMETER_VALUE_KEY
Configuration key for allure parameter value key.- See Also:
-
ALLURE_PARAMETER_MODE_KEY
Configuration key for allure parameter mode key.- See Also:
-
ALLURE_PARAMETER_EXCLUDED_KEY
Configuration key for allure parameter excluded key.- See Also:
-
ALLURE_FIXTURE
Configuration key for allure fixture.- See Also:
-
PREPARE
Constant value for prepare.- See Also:
-
TEAR_DOWN
Constant value for tear down.- See Also:
-
EVENT_START
Constant value for event start.- See Also:
-
EVENT_STOP
Constant value for event stop.- See Also:
-
EVENT_FAILURE
Constant value for event failure.- See Also:
-
JUNIT_PLATFORM_UNIQUE_ID
Constant value for junit platform unique id.- See Also:
-
-
Constructor Details
-
AllureJunitPlatform
public AllureJunitPlatform(io.qameta.allure.AllureLifecycle lifecycle) Creates an Allure junit platform with the supplied values.- Parameters:
lifecycle- the Allure lifecycle to use
-
AllureJunitPlatform
public AllureJunitPlatform()Creates an Allure junit platform with default configuration.
-
-
Method Details
-
getLifecycle
public io.qameta.allure.AllureLifecycle getLifecycle()Returns the lifecycle.- Returns:
- the Allure lifecycle used by this integration
-
testPlanExecutionStarted
public void testPlanExecutionStarted(org.junit.platform.launcher.TestPlan testPlan) - Specified by:
testPlanExecutionStartedin interfaceorg.junit.platform.launcher.TestExecutionListener
-
testPlanExecutionFinished
public void testPlanExecutionFinished(org.junit.platform.launcher.TestPlan testPlan) - Specified by:
testPlanExecutionFinishedin interfaceorg.junit.platform.launcher.TestExecutionListener
-
executionStarted
public void executionStarted(org.junit.platform.launcher.TestIdentifier testIdentifier) - Specified by:
executionStartedin interfaceorg.junit.platform.launcher.TestExecutionListener
-
executionFinished
public void executionFinished(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult) - Specified by:
executionFinishedin interfaceorg.junit.platform.launcher.TestExecutionListener
-
executionSkipped
public void executionSkipped(org.junit.platform.launcher.TestIdentifier testIdentifier, String reason) - Specified by:
executionSkippedin interfaceorg.junit.platform.launcher.TestExecutionListener
-
reportingEntryPublished
public void reportingEntryPublished(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.reporting.ReportEntry entry) - Specified by:
reportingEntryPublishedin interfaceorg.junit.platform.launcher.TestExecutionListener
-
getStatus
Returns the status.- Parameters:
throwable- the throwable- Returns:
- the status
-
getHistoryId
Returns the history id.- Parameters:
testIdentifier- the test identifier- Returns:
- the history id
-