Implement this interface when custom code needs to participate in the same integration flow as the built-in Allure adapter components.
- */ -public interface AttachmentContent { - - /** - * Returns the content. - * - * @return the content - */ - String getContent(); - - /** - * Returns the content type. - * - * @return the content type - */ - String getContentType(); - - /** - * Returns the file extension. - * - * @return the file extension - */ - String getFileExtension(); - -} diff --git a/allure-attachments/src/main/java/io/qameta/allure/attachment/AttachmentRenderException.java b/allure-attachments/src/main/java/io/qameta/allure/attachment/AttachmentRenderException.java deleted file mode 100644 index b097a0e16..000000000 --- a/allure-attachments/src/main/java/io/qameta/allure/attachment/AttachmentRenderException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2016-2026 Qameta Software Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.qameta.allure.attachment; - -/** - * Supports Allure attachment integration with Allure reporting. - * - *Use this type through the module that owns it when translating framework execution, result metadata, or attachments into Allure report data.
- */ -public class AttachmentRenderException extends RuntimeException { - - /** - * Creates an attachment render exception with the supplied values. - * - * @param message the message - * @param cause the failure cause reported by the framework - */ - public AttachmentRenderException(final String message, final Throwable cause) { - super(message, cause); - } -} diff --git a/allure-attachments/src/main/java/io/qameta/allure/attachment/DefaultAttachmentContent.java b/allure-attachments/src/main/java/io/qameta/allure/attachment/DefaultAttachmentContent.java deleted file mode 100644 index fb70c14f3..000000000 --- a/allure-attachments/src/main/java/io/qameta/allure/attachment/DefaultAttachmentContent.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2016-2026 Qameta Software Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.qameta.allure.attachment; - -/** - * Supports Allure attachment integration with Allure reporting. - * - *Use this type through the module that owns it when translating framework execution, result metadata, or attachments into Allure report data.
- */ -public class DefaultAttachmentContent implements AttachmentContent { - - private final String content; - - private final String contentType; - - private final String fileExtension; - - /** - * Creates a default attachment content with the supplied values. - * - * @param content the attachment content - * @param contentType the attachment content type - * @param fileExtension the attachment file extension - */ - public DefaultAttachmentContent(final String content, - final String contentType, - final String fileExtension) { - this.content = content; - this.contentType = contentType; - this.fileExtension = fileExtension; - } - - /** - * {@inheritDoc} - */ - @Override - public String getContent() { - return content; - } - - /** - * {@inheritDoc} - */ - @Override - public String getContentType() { - return contentType; - } - - /** - * {@inheritDoc} - */ - @Override - public String getFileExtension() { - return fileExtension; - } -} diff --git a/allure-attachments/src/main/java/io/qameta/allure/attachment/DefaultAttachmentProcessor.java b/allure-attachments/src/main/java/io/qameta/allure/attachment/DefaultAttachmentProcessor.java deleted file mode 100644 index 3bfc71a43..000000000 --- a/allure-attachments/src/main/java/io/qameta/allure/attachment/DefaultAttachmentProcessor.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2016-2026 Qameta Software Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.qameta.allure.attachment; - -import io.qameta.allure.Allure; -import io.qameta.allure.AllureLifecycle; - -import java.nio.charset.StandardCharsets; - -/** - * Supports Allure attachment integration with Allure reporting. - * - *Use this type through the module that owns it when translating framework execution, result metadata, or attachments into Allure report data.
- */ -public class DefaultAttachmentProcessor implements AttachmentProcessorUse this type through the module that owns it when translating framework execution, result metadata, or attachments into Allure report data.
- */ -public class FreemarkerAttachmentRenderer implements AttachmentRendererUse this model to carry request metadata and body content from client interceptors to attachment renderers and processors.
- */ -public class HttpRequestAttachment implements AttachmentData { - - private final String name; - - private final String url; - - private final String method; - - private final String body; - - private final String curl; - - private final MapUse this model to carry response metadata and body content from client interceptors to attachment renderers and processors.
- */ -public class HttpResponseAttachment implements AttachmentData { - - private final String name; - - private final String url; - - private final String body; - - private final int responseCode; - - private final Map
- <#t>${data.body}
-
-
- <#t>${data.body}
-
-
- <#t>${data.body.size}
-
-The proxy hides version-specific Cucumber source model APIs from the reporting plugin. Integrations use it to add source-read events and resolve feature, scenario, and step keyword metadata during execution.
- */ -public class TestSourcesModelProxy { - - private final TestSourcesModel testSources; - - /** - * Creates a test sources model proxy with default configuration. - */ - public TestSourcesModelProxy() { - this.testSources = new TestSourcesModel(); - } - - /** - * Adds the test source read event. - * - * @param path the path to read from or write to - * @param event the framework event to process - */ - public void addTestSourceReadEvent(final String path, final TestSourceRead event) { - testSources.addTestSourceReadEvent(path, event); - } - - /** - * Returns the feature. - * - * @param path the path to read from or write to - * @return the feature - */ - public Feature getFeature(final String path) { - return testSources.getFeature(path); - } - - /** - * Returns the scenario definition. - * - * @param path the path to read from or write to - * @param line the source line number to resolve - * @return the scenario definition - */ - public ScenarioDefinition getScenarioDefinition(final String path, final int line) { - return testSources.getScenarioDefinition(path, line); - } - - /** - * Returns the keyword from source. - * - * @param uri the feature file URI - * @param stepLine the feature file line number of the step - * @return the keyword from source - */ - public String getKeywordFromSource(final String uri, final int stepLine) { - return testSources.getKeywordFromSource(uri, stepLine); - } -} diff --git a/allure-cucumber4-jvm/src/main/java/io/qameta/allure/cucumber4jvm/AllureCucumber4Jvm.java b/allure-cucumber4-jvm/src/main/java/io/qameta/allure/cucumber4jvm/AllureCucumber4Jvm.java deleted file mode 100644 index cc291892d..000000000 --- a/allure-cucumber4-jvm/src/main/java/io/qameta/allure/cucumber4jvm/AllureCucumber4Jvm.java +++ /dev/null @@ -1,540 +0,0 @@ -/* - * Copyright 2016-2026 Qameta Software Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.qameta.allure.cucumber4jvm; - -import cucumber.api.HookTestStep; -import cucumber.api.HookType; -import cucumber.api.PickleStepTestStep; -import cucumber.api.Result; -import cucumber.api.TestCase; -import cucumber.api.TestStep; -import cucumber.api.event.ConcurrentEventListener; -import cucumber.api.event.EmbedEvent; -import cucumber.api.event.EventHandler; -import cucumber.api.event.EventPublisher; -import cucumber.api.event.TestCaseFinished; -import cucumber.api.event.TestCaseStarted; -import cucumber.api.event.TestSourceRead; -import cucumber.api.event.TestStepFinished; -import cucumber.api.event.TestStepStarted; -import cucumber.api.event.WriteEvent; -import cucumber.runtime.formatter.TestSourcesModelProxy; -import gherkin.ast.Examples; -import gherkin.ast.Feature; -import gherkin.ast.ScenarioDefinition; -import gherkin.ast.ScenarioOutline; -import gherkin.ast.TableRow; -import gherkin.pickles.PickleCell; -import gherkin.pickles.PickleRow; -import gherkin.pickles.PickleStep; -import gherkin.pickles.PickleTable; -import gherkin.pickles.PickleTag; -import io.qameta.allure.Allure; -import io.qameta.allure.AllureLifecycle; -import io.qameta.allure.model.FixtureResult; -import io.qameta.allure.model.Parameter; -import io.qameta.allure.model.Status; -import io.qameta.allure.model.StatusDetails; -import io.qameta.allure.model.StepResult; -import io.qameta.allure.model.TestResult; -import io.qameta.allure.model.TestResultContainer; - -import java.io.ByteArrayInputStream; -import java.net.URI; -import java.nio.charset.StandardCharsets; -import java.nio.file.Paths; -import java.util.Collections; -import java.util.Deque; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; -import java.util.stream.Collectors; -import java.util.stream.IntStream; -import java.util.stream.Stream; - -import static cucumber.api.HookType.Before; -import static io.qameta.allure.util.ResultsUtils.createParameter; -import static io.qameta.allure.util.ResultsUtils.createTitlePath; -import static io.qameta.allure.util.ResultsUtils.createTitlePathFromSourcePath; -import static io.qameta.allure.util.ResultsUtils.getStatus; -import static io.qameta.allure.util.ResultsUtils.getStatusDetails; -import static io.qameta.allure.util.ResultsUtils.md5; - -/** - * Reports Cucumber JVM 4 execution to Allure. - * - *Add this plugin to the Cucumber runtime so feature, scenario, step, hook, and attachment events are converted into Allure results. Use the default lifecycle for normal runs or pass one explicitly for embedded runners and tests.
- */ -@SuppressWarnings( - { - "ClassDataAbstractionCoupling", - "ClassFanOutComplexity", - "MultipleStringLiterals", - "PMD.GodClass", - } -) -public class AllureCucumber4Jvm implements ConcurrentEventListener { - - private static final String COLON = ":"; - - private final AllureLifecycle lifecycle; - - private final TestSourcesModelProxy testSources = new TestSourcesModelProxy(); - - private final EventHandler