File: 22-test-without_TempDir.patch

package info (click to toggle)
zookeeper 3.9.4-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 27,108 kB
  • sloc: java: 122,772; cpp: 14,071; ansic: 12,480; javascript: 11,754; xml: 4,965; python: 2,829; sh: 2,434; makefile: 244; perl: 114
file content (137 lines) | stat: -rw-r--r-- 6,024 bytes parent folder | download | duplicates (4)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
Description: building the tests without TempDir annotation, which is a feature
 of a not yet Debian-packaged version of junit5
 Four test classes also have to be omitted as the test would not run without
 the annotation.
Author: Pierre Gruet <pgt@debian.org>
Forwarded: not-needed
Last-Update: 2022-06-21

--- a/zookeeper-server/src/test/java/org/apache/zookeeper/common/AtomicFileWritingIdiomTest.java
+++ b/zookeeper-server/src/test/java/org/apache/zookeeper/common/AtomicFileWritingIdiomTest.java
@@ -33,12 +33,11 @@
 import org.apache.zookeeper.common.AtomicFileWritingIdiom.OutputStreamStatement;
 import org.apache.zookeeper.common.AtomicFileWritingIdiom.WriterStatement;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.io.TempDir;
 
 public class AtomicFileWritingIdiomTest extends ZKTestCase {
 
     @Test
-    public void testOutputStreamSuccess(@TempDir File tmpdir) throws IOException {
+    public void testOutputStreamSuccess(File tmpdir) throws IOException {
         File target = new File(tmpdir, "target.txt");
         final File tmp = new File(tmpdir, "target.txt.tmp");
         createFile(target, "before");
@@ -56,7 +55,7 @@
     }
 
     @Test
-    public void testWriterSuccess(@TempDir File tmpdir) throws IOException {
+    public void testWriterSuccess(File tmpdir) throws IOException {
         File target = new File(tmpdir, "target.txt");
         final File tmp = new File(tmpdir, "target.txt.tmp");
         createFile(target, "before");
@@ -74,7 +73,7 @@
     }
 
     @Test
-    public void testOutputStreamFailure(@TempDir File tmpdir) throws IOException {
+    public void testOutputStreamFailure(File tmpdir) throws IOException {
         File target = new File(tmpdir, "target.txt");
         final File tmp = new File(tmpdir, "target.txt.tmp");
         createFile(target, "before");
@@ -100,7 +99,7 @@
     }
 
     @Test
-    public void testWriterFailure(@TempDir File tmpdir) throws IOException {
+    public void testWriterFailure(File tmpdir) throws IOException {
         File target = new File(tmpdir, "target.txt");
         final File tmp = new File(tmpdir, "target.txt.tmp");
         createFile(target, "before");
@@ -126,7 +125,7 @@
     }
 
     @Test
-    public void testOutputStreamFailureIOException(@TempDir File tmpdir) throws IOException {
+    public void testOutputStreamFailureIOException(File tmpdir) throws IOException {
         File target = new File(tmpdir, "target.txt");
         final File tmp = new File(tmpdir, "target.txt.tmp");
         createFile(target, "before");
@@ -152,7 +151,7 @@
     }
 
     @Test
-    public void testWriterFailureIOException(@TempDir File tmpdir) throws IOException {
+    public void testWriterFailureIOException(File tmpdir) throws IOException {
         File target = new File(tmpdir, "target.txt");
         final File tmp = new File(tmpdir, "target.txt.tmp");
         createFile(target, "before");
@@ -178,7 +177,7 @@
     }
 
     @Test
-    public void testOutputStreamFailureError(@TempDir File tmpdir) throws IOException {
+    public void testOutputStreamFailureError(File tmpdir) throws IOException {
         File target = new File(tmpdir, "target.txt");
         final File tmp = new File(tmpdir, "target.txt.tmp");
         createFile(target, "before");
@@ -204,7 +203,7 @@
     }
 
     @Test
-    public void testWriterFailureError(@TempDir File tmpdir) throws IOException {
+    public void testWriterFailureError(File tmpdir) throws IOException {
         File target = new File(tmpdir, "target.txt");
         final File tmp = new File(tmpdir, "target.txt.tmp");
         createFile(target, "before");
@@ -232,7 +231,7 @@
     // ************** target file does not exist
 
     @Test
-    public void testOutputStreamSuccessNE(@TempDir File tmpdir) throws IOException {
+    public void testOutputStreamSuccessNE(File tmpdir) throws IOException {
         File target = new File(tmpdir, "target.txt");
         final File tmp = new File(tmpdir, "target.txt.tmp");
         target.delete();
@@ -249,7 +248,7 @@
     }
 
     @Test
-    public void testWriterSuccessNE(@TempDir File tmpdir) throws IOException {
+    public void testWriterSuccessNE(File tmpdir) throws IOException {
         File target = new File(tmpdir, "target.txt");
         final File tmp = new File(tmpdir, "target.txt.tmp");
         target.delete();
@@ -267,7 +266,7 @@
     }
 
     @Test
-    public void testOutputStreamFailureNE(@TempDir File tmpdir) throws IOException {
+    public void testOutputStreamFailureNE(File tmpdir) throws IOException {
         File target = new File(tmpdir, "target.txt");
         final File tmp = new File(tmpdir, "target.txt.tmp");
         target.delete();
@@ -293,7 +292,7 @@
     }
 
     @Test
-    public void testWriterFailureNE(@TempDir File tmpdir) throws IOException {
+    public void testWriterFailureNE(File tmpdir) throws IOException {
         File target = new File(tmpdir, "target.txt");
         final File tmp = new File(tmpdir, "target.txt.tmp");
         target.delete();
--- a/zookeeper-server/pom.xml
+++ b/zookeeper-server/pom.xml
@@ -247,6 +247,11 @@
                 <exclude>**/ThrottledOpObserverTest.java</exclude><!-- Needs ThrottledOpHelper -->
                 <exclude>**/ThrottledOpQuorumTest.java</exclude><!-- Needs ThrottledOpHelper -->
                 <exclude>**/ThrottledOpStandaloneTest.java</exclude><!-- Needs ThrottledOpHelper -->
+                <!-- The four below tests cannot be run as of today, because the TempDir annotation is not available in Debian-packaged junit5. -->
+                <exclude>**/server/embedded/ZookeeperServerClusterMutualAuthTest.java</exclude>
+                <exclude>**/server/embedded/ZookeeperServerClusterTest.java</exclude>
+                <exclude>**/server/embedded/ZookeeperServerEmbeddedTest.java</exclude>
+                <exclude>**/server/embedded/ZookeeperServerSslEmbeddedTest.java</exclude>
               </testExcludes>
             </configuration>
             <goals>