Skip to content

Commit bee34be

Browse files
authored
Rename allure-junit5 to allure-jupiter (via #1262)
1 parent bb7e6fe commit bee34be

36 files changed

+426
-68
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ body:
4545
- allure-jsonunit
4646
- allure-junit-platform
4747
- allure-junit4
48+
- allure-jupiter
49+
- allure-jupiter-assert
4850
- allure-junit5
51+
- allure-junit5-assert
4952
- allure-karate
5053
- allure-okhttp
5154
- allure-okhttp3

.github/labeler.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
- "allure-junit4-aspect/**"
4949

5050
"theme:junit-platform":
51-
- "allure-junit5/**"
52-
- "allure-junit5-assert/**"
51+
- "allure-jupiter/**"
52+
- "allure-jupiter-assert/**"
5353
- "allure-junit-platform/**"
5454

5555
"theme:karate":

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@
3737
- 📚 Example project — https://github.com/allure-examples?q=topic%3Ajunit4
3838
- ✅ Generate a project in 10 seconds via Allure Start - https://allurereport.org/start/
3939
-
40-
## JUnit 5
41-
42-
- 🚀 Documentation — https://allurereport.org/docs/junit5/
43-
- 📚 Example project — https://github.com/allure-examples?q=topic%3Ajunit5
44-
- ✅ Generate a project in 10 seconds via Allure Start - https://allurereport.org/start/
40+
## JUnit Jupiter (JUnit 5 and 6)
41+
42+
- 🚀 Documentation — https://allurereport.org/docs/junit5/
43+
- 📚 Example project — https://github.com/allure-examples?q=topic%3Ajunit5
44+
- ✅ Generate a project in 10 seconds via Allure Start - https://allurereport.org/start/
45+
- 🧩 Use `io.qameta.allure:allure-jupiter` for new setups. `allure-junit5` remains available as a deprecated compatibility alias during migration.
4546

4647
## Cucumber JVM
4748

allure-bom/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ dependencies {
88
constraints {
99
rootProject.subprojects.sorted()
1010
.forEach { api("${it.group}:${it.name}:${it.version}") }
11+
api("io.qameta.allure:allure-junit5:${project.version}")
12+
api("io.qameta.allure:allure-junit5-assert:${project.version}")
1113
}
1214
}
1315

allure-junit5/src/main/services/org.junit.jupiter.api.extension.Extension

Lines changed: 0 additions & 1 deletion
This file was deleted.

allure-junit5/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
Adding JUnit5-assert may lead to java.lang.OutOfMemoryError: Java heap space
1+
Adding Jupiter assert may lead to java.lang.OutOfMemoryError: Java heap space
2+
3+
The primary artifact is now `allure-jupiter-assert`. `allure-junit5-assert` remains available as a deprecated compatibility alias during the transition.
24

35
Having a huge class path may lead to OOM, because AspectJ processes all the classes. [Link to documentation](https://www.eclipse.org/aspectj/doc/released/devguide/ltw.html)
46

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
description = "Allure Junit5 Assertions Integration"
1+
description = "Allure Jupiter Assertions Integration"
22

33
dependencies {
4-
api(project(":allure-junit5"))
4+
api(project(":allure-jupiter"))
55
compileOnly("org.aspectj:aspectjrt")
66
compileOnly("org.junit.jupiter:junit-jupiter-api")
77
testAnnotationProcessor(project(":allure-descriptions-javadoc"))
@@ -15,7 +15,7 @@ dependencies {
1515
tasks.jar {
1616
manifest {
1717
attributes(mapOf(
18-
"Automatic-Module-Name" to "io.qameta.allure.junit5-assert"
18+
"Automatic-Module-Name" to "io.qameta.allure.jupiterassert"
1919
))
2020
}
2121
}
@@ -24,3 +24,10 @@ tasks.test {
2424
useJUnitPlatform()
2525
}
2626

27+
publishing {
28+
publications {
29+
create<MavenPublication>("legacyJunit5Assert") {
30+
artifactId = "allure-junit5-assert"
31+
}
32+
}
33+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright 2016-2026 Qameta Software Inc
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package io.qameta.allure.junit5assert;
17+
18+
import io.qameta.allure.jupiterassert.AllureJupiterAssert;
19+
20+
/**
21+
* @author legionivo (Andrey Konovka).
22+
* @deprecated use {@link AllureJupiterAssert}.
23+
*/
24+
@Deprecated
25+
public class AllureJunit5Assert extends AllureJupiterAssert {
26+
}

allure-junit5-assert/src/main/java/io/qameta/allure/junit5assert/AllureJunit5Assert.java renamed to allure-jupiter-assert/src/main/java/io/qameta/allure/jupiterassert/AllureJupiterAssert.java

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package io.qameta.allure.junit5assert;
16+
package io.qameta.allure.jupiterassert;
1717

1818
import io.qameta.allure.Allure;
1919
import io.qameta.allure.AllureLifecycle;
@@ -41,13 +41,12 @@
4141
*/
4242
@SuppressWarnings("all")
4343
@Aspect
44-
public class AllureJunit5Assert {
44+
public class AllureJupiterAssert {
4545

46-
private static final Logger LOGGER = LoggerFactory.getLogger(AllureJunit5Assert.class);
46+
private static final Logger LOGGER = LoggerFactory.getLogger(AllureJupiterAssert.class);
4747
private StepResult stepResult;
4848

49-
50-
private static InheritableThreadLocal<AllureLifecycle> lifecycle = new InheritableThreadLocal<AllureLifecycle>() {
49+
private static final InheritableThreadLocal<AllureLifecycle> LIFECYCLE = new InheritableThreadLocal<AllureLifecycle>() {
5150
@Override
5251
protected AllureLifecycle initialValue() {
5352
return Allure.getLifecycle();
@@ -69,11 +68,10 @@ public void stepStart(final JoinPoint joinPoint) {
6968
if (joinPoint.getArgs().length > 1) {
7069
final String uuid = UUID.randomUUID().toString();
7170
final String assertName = joinPoint.getSignature().getName();
72-
String name;
71+
final String name;
7372
if (joinPoint.getSignature().getName().equalsIgnoreCase("assertAll")) {
74-
name = String.format("assert All in " + " \'%s\'", joinPoint.getArgs()[0].toString());
73+
name = String.format("assert All in " + " '%s'", joinPoint.getArgs()[0].toString());
7574
} else {
76-
7775
final String actual = joinPoint.getArgs().length > 0
7876
? ObjectUtils.toString(joinPoint.getArgs()[1])
7977
: "<?>";
@@ -83,12 +81,13 @@ public void stepStart(final JoinPoint joinPoint) {
8381

8482
final List<String> assertArray = Arrays.asList(assertName.split("(?=[A-Z])"));
8583
if (assertArray.size() >= 3) {
86-
name = String.format(assertArray.get(0) + " " + assertArray.get(1) + " \'%s\'", expected)
84+
name = String.format(assertArray.get(0) + " " + assertArray.get(1) + " '%s'", expected)
8785
+ " " + String.format(assertArray.stream()
8886
.skip(2)
89-
.collect(Collectors.joining(" ")) + " \'%s\'", actual);
87+
.collect(Collectors.joining(" ")) + " '%s'", actual);
9088
} else {
91-
name = String.format(assertArray.get(0) + " \'%s\'", expected) + " " + String.format(assertArray.get(1) + " \'%s\'", actual);
89+
name = String.format(assertArray.get(0) + " '%s'", expected)
90+
+ " " + String.format(assertArray.get(1) + " '%s'", actual);
9291
}
9392
}
9493
final StepResult result = new StepResult()
@@ -101,7 +100,7 @@ public void stepStart(final JoinPoint joinPoint) {
101100
: "<?>";
102101
final String uuid = UUID.randomUUID().toString();
103102
final String assertName = joinPoint.getSignature().getName();
104-
final String name = String.format(assertName + " \'%s\'", actual);
103+
final String name = String.format(assertName + " '%s'", actual);
105104

106105
final StepResult result = new StepResult()
107106
.setName(name)
@@ -129,11 +128,10 @@ public void stepStop() {
129128
* @param allure allure lifecycle to set.
130129
*/
131130
public static void setLifecycle(final AllureLifecycle allure) {
132-
lifecycle.set(allure);
131+
LIFECYCLE.set(allure);
133132
}
134133

135134
public static AllureLifecycle getLifecycle() {
136-
return lifecycle.get();
135+
return LIFECYCLE.get();
137136
}
138-
139137
}

0 commit comments

Comments
 (0)