Skip to content

Commit 597a75d

Browse files
letsrokkbaev
authored andcommitted
add cucumber-jvm 4 support (fixes allure-framework#255, via allure-framework#286)
1 parent bbbe4b5 commit 597a75d

28 files changed

+1534
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
description = "Allure CucumberJVM 4.0"
2+
3+
val agent by configurations.creating
4+
5+
val cucumberVersion = "4.0.0"
6+
7+
dependencies {
8+
agent("org.aspectj:aspectjweaver")
9+
compile(project(":allure-java-commons"))
10+
11+
compile("io.cucumber:cucumber-core:$cucumberVersion")
12+
compile("io.cucumber:cucumber-java:$cucumberVersion")
13+
14+
testCompile("io.cucumber:cucumber-testng:$cucumberVersion")
15+
testCompile(project(":allure-java-commons-test"))
16+
testCompile("commons-io:commons-io")
17+
testCompile("org.assertj:assertj-core")
18+
19+
testCompile("org.junit.jupiter:junit-jupiter-api")
20+
testRuntime("org.junit.jupiter:junit-jupiter-engine")
21+
testCompile("io.github.glytching:junit-extensions")
22+
23+
testCompile("org.slf4j:slf4j-simple")
24+
}
25+
26+
tasks.named<Jar>("jar") {
27+
manifest {
28+
attributes(mapOf(
29+
"Automatic-Module-Name" to "io.qameta.allure.cucumber4jvm"
30+
))
31+
}
32+
}
33+
34+
tasks.named<Test>("test") {
35+
useJUnitPlatform()
36+
doFirst {
37+
jvmArgs("-javaagent:${agent.singleFile}")
38+
}
39+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package cucumber.runtime.formatter;
2+
3+
import cucumber.api.event.TestSourceRead;
4+
import gherkin.ast.Feature;
5+
import gherkin.ast.ScenarioDefinition;
6+
7+
/**
8+
* Proxy class to internal Cucumber implementation of TestSourcesModel.
9+
*/
10+
public class TestSourcesModelProxy {
11+
12+
private final TestSourcesModel testSources;
13+
14+
public TestSourcesModelProxy() {
15+
this.testSources = new TestSourcesModel();
16+
}
17+
18+
public void addTestSourceReadEvent(final String path, final TestSourceRead event) {
19+
testSources.addTestSourceReadEvent(path, event);
20+
}
21+
22+
public Feature getFeature(final String path) {
23+
return testSources.getFeature(path);
24+
}
25+
26+
public ScenarioDefinition getScenarioDefinition(final String path, final int line) {
27+
return testSources.getScenarioDefinition(path, line);
28+
}
29+
30+
public String getKeywordFromSource(final String uri, final int stepLine) {
31+
return testSources.getKeywordFromSource(uri, stepLine);
32+
}
33+
}

0 commit comments

Comments
 (0)