File: 17-backward-compatibility.patch

package info (click to toggle)
junit5 5.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 14,080 kB
  • sloc: java: 92,777; xml: 1,824; sh: 184; javascript: 59; makefile: 2
file content (49 lines) | stat: -rw-r--r-- 1,556 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Description: Restores the compatibilty with the previous versions
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
--- a/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java
+++ b/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java
@@ -109,7 +109,6 @@
  * the {@code junit-platform-suite-engine} module; to be removed in JUnit Platform 2.0
  */
 @API(status = DEPRECATED, since = "1.8")
-@Deprecated
 public class JUnitPlatform extends Runner implements Filterable {
 
 	// @formatter:off
--- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java
+++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java
@@ -96,6 +96,33 @@
 		return testPlan;
 	}
 
+	@API(status = INTERNAL, since = "1.0")
+	public static TestPlan from(Collection<TestDescriptor> engineDescriptors) {
+		return from(engineDescriptors, new ConfigurationParameters() {
+			@Override
+			public Optional<String> get(String key) {
+				return Optional.empty();
+			}
+
+			@Override
+			public Optional<Boolean> getBoolean(String key) {
+				return Optional.empty();
+			}
+
+			@Override
+			@SuppressWarnings("deprecation")
+			public int size() {
+				return 0;
+			}
+
+			@Override
+			public Set<String> keySet() {
+				return java.util.Collections.emptySet();
+			}
+
+		});
+	}
+
 	@API(status = INTERNAL, since = "1.4")
 	protected TestPlan(boolean containsTests, ConfigurationParameters configurationParameters) {
 		this.containsTests = containsTests;