-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
19 changed files
with
1,037 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ schema | |
build | ||
/*/allure-results/ | ||
out | ||
.gradletasknamecache | ||
|
||
#IDEA Files | ||
.idea | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
377 changes: 283 additions & 94 deletions
377
allure-junit-platform/src/main/java/io/qameta/allure/junitplatform/AllureJunitPlatform.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...platform/src/test/java/io/qameta/allure/junitplatform/features/BrokenInAfterAllTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright 2019 Qameta Software OÜ | ||
* | ||
* 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.junitplatform.features; | ||
|
||
import org.junit.jupiter.api.AfterAll; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.ValueSource; | ||
|
||
public class BrokenInAfterAllTests { | ||
|
||
@AfterAll | ||
static void exception() { | ||
throw new RuntimeException("Exception in @AfterAll"); | ||
} | ||
|
||
@Test | ||
void test1() { | ||
} | ||
|
||
@Test | ||
void test2() { | ||
} | ||
|
||
@ValueSource(strings = {"a", "b", "c"}) | ||
@ParameterizedTest | ||
void parameterisedTest(final String value) { | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...latform/src/test/java/io/qameta/allure/junitplatform/features/BrokenInBeforeAllTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright 2019 Qameta Software OÜ | ||
* | ||
* 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.junitplatform.features; | ||
|
||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.ValueSource; | ||
|
||
public class BrokenInBeforeAllTests { | ||
|
||
@BeforeAll | ||
static void exception() { | ||
throw new RuntimeException("Exception in @BeforeAll"); | ||
} | ||
|
||
@Test | ||
void test1() { | ||
} | ||
|
||
@Test | ||
void test2() { | ||
} | ||
|
||
@ValueSource(strings = {"a", "b", "c"}) | ||
@ParameterizedTest | ||
void parameterisedTest(final String value) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...atform/src/test/java/io/qameta/allure/junitplatform/features/SkippedInBeforeAllTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2019 Qameta Software OÜ | ||
* | ||
* 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.junitplatform.features; | ||
|
||
import org.junit.jupiter.api.Assumptions; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class SkippedInBeforeAllTests { | ||
|
||
@BeforeAll | ||
static void skip(){ | ||
Assumptions.assumeTrue(false,"Skip in @BeforeAll"); | ||
} | ||
@Test | ||
void test() { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,52 @@ | ||
description = "Allure JUnit 5 Integration" | ||
|
||
val agent: Configuration by configurations.creating | ||
|
||
dependencies { | ||
agent("org.aspectj:aspectjweaver") | ||
api(project(":allure-junit-platform")) | ||
implementation("org.junit.jupiter:junit-jupiter-api") | ||
implementation("org.junit.platform:junit-platform-launcher") | ||
testAnnotationProcessor(project(":allure-descriptions-javadoc")) | ||
testImplementation("io.github.glytching:junit-extensions") | ||
testImplementation("org.assertj:assertj-core") | ||
testImplementation("org.junit.jupiter:junit-jupiter-api") | ||
testImplementation("org.junit.jupiter:junit-jupiter-params") | ||
testImplementation("org.slf4j:slf4j-simple") | ||
testImplementation(project(":allure-assertj")) | ||
testImplementation(project(":allure-java-commons-test")) | ||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") | ||
} | ||
|
||
tasks.jar { | ||
manifest { | ||
attributes(mapOf( | ||
"Automatic-Module-Name" to "io.qameta.allure.junit5" | ||
)) | ||
} | ||
from("src/main/services") { | ||
into("META-INF/services") | ||
} | ||
} | ||
|
||
tasks.test { | ||
systemProperty("junit.jupiter.execution.parallel.enabled", "false") | ||
useJUnitPlatform() | ||
exclude("**/features/*") | ||
doFirst { | ||
jvmArgs("-javaagent:${agent.singleFile}") | ||
} | ||
} | ||
|
||
val spiOffJar by tasks.creating(Jar::class) { | ||
from(sourceSets.getByName("main").output) | ||
archiveClassifier.set("spi-off") | ||
} | ||
|
||
val spiOff by configurations.creating { | ||
extendsFrom(configurations.getByName("compile")) | ||
} | ||
|
||
artifacts.add("archives", spiOffJar) | ||
artifacts.add("spiOff", spiOffJar) | ||
|
Oops, something went wrong.