8000 HADOOP-19410. Upgrade JUnit from 4 to 5 in hadoop-client-integration-… · apache/hadoop@ab60845 · GitHub
[go: up one dir, main page]

Skip to content

Commit ab60845

Browse files
committed
HADOOP-19410. Upgrade JUnit from 4 to 5 in hadoop-client-integration-tests.
1 parent 709d10e commit ab60845

File tree

3 files changed

+33
-12
lines changed

3 files changed

+33
-12
lines changed

hadoop-client-modules/hadoop-client-integration-tests/pom.xml

+20
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,26 @@
4747
<artifactId>junit</artifactId>
4848
<scope>test</scope>
4949
</dependency>
50+
<dependency>
51+
<groupId>org.junit.jupiter</groupId>
52+
<artifactId>junit-jupiter-api</artifactId>
53+
<scope>test</scope>
54+
</dependency>
55+
<dependency>
56+
<groupId>org.junit.jupiter</groupId>
57+
<artifactId>junit-jupiter-engine</artifactId>
58+
<scope>test</scope>
59+
</dependency>
60+
<dependency>
61+
<groupId>org.junit.jupiter</groupId>
62+
<artifactId>junit-jupiter-params</artifactId>
63+
<scope>test</scope>
64+
</dependency>
65+
<dependency>
66+
<groupId>org.junit.platform</groupId>
67+
<artifactId>junit-platform-launcher</artifactId>
68+
<scope>test</scope>
69+
</dependency>
5070
<dependency>
5171
<groupId>org.lz4</groupId>
5272
<artifactId>lz4-java</artifactId>

hadoop-client-modules/hadoop-client-integration-tests/src/test/java/org/apache/hadoop/example/ITUseHadoopCodecs.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
package org.apache.hadoop.example;
2222

23-
import static org.junit.Assert.assertEquals;
24-
import static org.junit.Assert.assertFalse;
23+
import static org.junit.jupiter.api.Assertions.assertEquals;
24+
import static org.junit.jupiter.api.Assertions.assertFalse;
2525

2626
import java.io.*;
2727
import java.util.Arrays;
@@ -37,7 +37,7 @@
3737
import org.apache.hadoop.io.compress.CompressionOutputStream;
3838
import org.apache.hadoop.io.compress.zlib.ZlibFactory;
3939
import org.apache.hadoop.util.ReflectionUtils;
40-
import org.junit.Test;
40+
import org.junit.jupiter.api.Test;
4141
import org.slf4j.Logger;
4242
import org.slf4j.LoggerFactory;
4343

@@ -134,8 +134,8 @@ private void codecTest(Configuration conf, int seed, int count, String codecClas
134134
int expected;
135135
do {
136136
expected = originalIn.read();
137-
assertEquals("Inflated stream read by byte does not match",
138-
expected, inflateFilter.read());
137+
assertEquals(expected, inflateFilter.read(),
138+
"Inflated stream read by byte does not match");
139139
} while (expected != -1);
140140
}
141141

hadoop-client-modules/hadoop-client-integration-tests/src/test/java/org/apache/hadoop/example/ITUseMiniCluster.java

+8-7
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020

2121
package org.apache.hadoop.example;
2222

23+
import static org.junit.jupiter.api.Assertions.assertEquals;
24+
2325
import java.io.IOException;
2426
import java.net.URISyntaxException;
2527

26-
import org.junit.After;
27-
import org.junit.Assert;
28-
import org.junit.Before;
29-
import org.junit.Test;
28+
import org.junit.jupiter.api.AfterEach;
29+
import org.junit.jupiter.api.BeforeEach;
30+
import org.junit.jupiter.api.Test;
3031

3132
import org.slf4j.Logger;
3233
import org.slf4j.LoggerFactory;
@@ -69,7 +70,7 @@ public class ITUseMiniCluster {
6970
+ "fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,"
7071
+ " sunt in culpa qui officia deserunt mollit anim id est laborum.";
7172

72-
@Before
73+
@BeforeEach
7374
public void clusterUp() throws IOException {
7475
final Configuration conf = new HdfsConfiguration();
7576
cluster = new MiniDFSCluster.Builder(conf)
@@ -84,7 +85,7 @@ public void clusterUp() throws IOException {
8485
yarnCluster.start();
8586
}
8687

87-
@After
88+
@AfterEach
8889
public void clusterDown() {
8990
if (cluster != null) {
9091
cluster.close();
@@ -111,7 +112,7 @@ public void simpleReadAfterWrite(final FileSystem fs) throws IOException {
111112
}
112113
try (FSDataInputStream in = fs.open(path)) {
113114
final String result = in.readUTF();
114-
Assert.assertEquals("Didn't read back text we wrote.", TEXT, result);
115+
assertEquals(TEXT, result, "Didn't read back text we wrote.");
115116
}
116117
}
117118

0 commit comments

Comments
 (0)
0