File tree 3 files changed +14
-2
lines changed
junit-platform-reporting/src/main/java/org/junit/platform/reporting/open/xml
platform-tooling-support-tests
projects/jar-describe-module
src/test/java/platform/tooling/support/tests
3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 10
10
11
11
package org .junit .platform .reporting .open .xml ;
12
12
13
+ import static org .apiguardian .api .API .Status .EXPERIMENTAL ;
13
14
import static org .junit .platform .reporting .open .xml .JUnitFactory .legacyReportingName ;
14
15
import static org .junit .platform .reporting .open .xml .JUnitFactory .type ;
15
16
import static org .junit .platform .reporting .open .xml .JUnitFactory .uniqueId ;
51
52
import java .util .concurrent .ConcurrentHashMap ;
52
53
import java .util .concurrent .atomic .AtomicInteger ;
53
54
55
+ import org .apiguardian .api .API ;
54
56
import org .junit .platform .commons .JUnitException ;
55
57
import org .junit .platform .commons .util .StringUtils ;
56
58
import org .junit .platform .engine .ConfigurationParameters ;
77
79
import org .opentest4j .reporting .events .root .Events ;
78
80
import org .opentest4j .reporting .schema .Namespace ;
79
81
82
+ /**
83
+ * Open Test Reporting events XML generating test execution listener.
84
+ *
85
+ * @since 1.9
86
+ */
87
+ @ API (status = EXPERIMENTAL , since = "1.9" )
80
88
public class OpenTestReportGeneratingListener implements TestExecutionListener {
81
89
82
90
static final String ENABLED_PROPERTY_NAME = "junit.platform.reporting.open.xml.enabled" ;
@@ -106,7 +114,7 @@ public void testPlanExecutionStarted(TestPlan testPlan) {
106
114
reportInfrastructure ();
107
115
}
108
116
catch (Exception e ) {
109
- throw new RuntimeException ("Failed to initialize XML events file: " + eventsXml , e );
117
+ throw new JUnitException ("Failed to initialize XML events file: " + eventsXml , e );
110
118
}
111
119
}
112
120
}
Original file line number Diff line number Diff line change 1
1
org.junit.platform.reporting@${platformVersion} jar:file:.+/junit-platform-reporting-\d.+\.jar..module-info\.class
2
2
exports org.junit.platform.reporting.legacy
3
3
exports org.junit.platform.reporting.legacy.xml
4
+ exports org.junit.platform.reporting.open.xml
4
5
requires java.base mandated
5
6
requires java.xml
6
7
requires org.apiguardian.api static transitive
7
8
requires org.junit.platform.commons
8
9
requires org.junit.platform.engine transitive
9
10
requires org.junit.platform.launcher transitive
11
+ provides org.junit.platform.launcher.TestExecutionListener with org.junit.platform.reporting.open.xml.OpenTestReportGeneratingListener
Original file line number Diff line number Diff line change 20
20
import static com .tngtech .archunit .core .domain .JavaModifier .PUBLIC ;
21
21
import static com .tngtech .archunit .core .domain .properties .HasModifiers .Predicates .modifier ;
22
22
import static com .tngtech .archunit .core .domain .properties .HasName .Predicates .name ;
23
+ import static com .tngtech .archunit .core .domain .properties .HasName .Predicates .nameContaining ;
23
24
import static com .tngtech .archunit .lang .conditions .ArchPredicates .are ;
24
25
import static com .tngtech .archunit .lang .conditions .ArchPredicates .have ;
25
26
import static com .tngtech .archunit .lang .syntax .ArchRuleDefinition .classes ;
@@ -73,7 +74,8 @@ void avoidJavaUtilLogging(JavaClasses classes) {
73
74
@ ArchTest
74
75
void avoidThrowingGenericExceptions (JavaClasses classes ) {
75
76
// LoggerFactory.java:155 -> new Throwable()
76
- var subset = classes .that (are (not (name ("org.junit.platform.commons.logging.LoggerFactory$DelegatingLogger" ))));
77
+ var subset = classes .that (are (not (
78
+ name ("org.junit.platform.commons.logging.LoggerFactory$DelegatingLogger" ).or (nameContaining (".shadow." )))));
77
79
GeneralCodingRules .NO_CLASSES_SHOULD_THROW_GENERIC_EXCEPTIONS .check (subset );
78
80
}
79
81
You can’t perform that action at this time.
0 commit comments