Skip to content

Commit d242711

Browse files
authored
Merge branch 'trunk' into MAPREDUCE-7421-PART2
2 parents a65feaa + 19bd575 commit d242711

File tree

277 files changed

+5710
-5175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

277 files changed

+5710
-5175
lines changed

hadoop-hdfs-project/hadoop-hdfs-httpfs/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,26 @@
210210
<artifactId>kotlin-stdlib-jdk8</artifactId>
211211
<scope>test</scope>
212212
</dependency>
213+
<dependency>
214+
<groupId>org.junit.jupiter</groupId>
215+
<artifactId>junit-jupiter-api</artifactId>
216+
<scope>test</scope>
217+
</dependency>
218+
<dependency>
219+
<groupId>org.junit.jupiter</groupId>
220+
<artifactId>junit-jupiter-engine</artifactId>
221+
<scope>test</scope>
222+
</dependency>
223+
<dependency>
224+
<groupId>org.junit.jupiter</groupId>
225+
<artifactId>junit-jupiter-params</artifactId>
226+
<scope>test</scope>
227+
</dependency>
228+
<dependency>
229+
<groupId>org.junit.platform</groupId>
230+
<artifactId>junit-platform-launcher</artifactId>
231+
<scope>test</scope>
232+
</dependency>
213233
</dependencies>
214234

215235
<build>

hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java

Lines changed: 140 additions & 147 deletions
Large diffs are not rendered by default.

hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/TestHttpFSFWithSWebhdfsFileSystem.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,13 @@
2525
import org.apache.hadoop.security.ssl.KeyStoreTestUtil;
2626
import org.apache.hadoop.test.GenericTestUtils;
2727
import org.apache.hadoop.test.TestJettyHelper;
28-
import org.junit.AfterClass;
29-
import org.junit.runner.RunWith;
30-
import org.junit.runners.Parameterized;
28+
import org.junit.jupiter.api.AfterAll;
3129

3230
import java.io.File;
3331
import java.net.URI;
3432
import java.net.URL;
3533
import java.util.UUID;
3634

37-
@RunWith(value = Parameterized.class)
3835
public class TestHttpFSFWithSWebhdfsFileSystem
3936
extends TestHttpFSWithHttpFSFileSystem {
4037
private static String classpathDir;
@@ -69,15 +66,14 @@ public class TestHttpFSFWithSWebhdfsFileSystem
6966
"serverP");
7067
}
7168

72-
@AfterClass
69+
@AfterAll
7370
public static void cleanUp() throws Exception {
7471
new File(classpathDir, "ssl-client.xml").delete();
7572
new File(classpathDir, "ssl-server.xml").delete();
7673
KeyStoreTestUtil.cleanupSSLConfig(keyStoreDir, classpathDir);
7774
}
7875

79-
public TestHttpFSFWithSWebhdfsFileSystem(Operation operation) {
80-
super(operation);
76+
public TestHttpFSFWithSWebhdfsFileSystem() {
8177
}
8278

8379
@Override

hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/TestHttpFSFWithWebhdfsFileSystem.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,11 @@
1919
package org.apache.hadoop.fs.http.client;
2020

2121
import org.apache.hadoop.hdfs.web.WebHdfsFileSystem;
22-
import org.junit.runner.RunWith;
23-
import org.junit.runners.Parameterized;
2422

25-
@RunWith(value = Parameterized.class)
2623
public class TestHttpFSFWithWebhdfsFileSystem
2724
extends TestHttpFSWithHttpFSFileSystem {
2825

29-
public TestHttpFSFWithWebhdfsFileSystem(Operation operation) {
30-
super(operation);
26+
public TestHttpFSFWithWebhdfsFileSystem() {
3127
}
3228

3329
@Override

hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/TestHttpFSFileSystemLocalFileSystem.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@
2727
import org.apache.hadoop.fs.Path;
2828
import org.apache.hadoop.test.GenericTestUtils;
2929
import org.apache.hadoop.test.TestDirHelper;
30-
import org.junit.Assert;
31-
import org.junit.runner.RunWith;
32-
import org.junit.runners.Parameterized;
3330

3431
import java.io.File;
3532

36-
@RunWith(value = Parameterized.class)
33+
import static org.junit.jupiter.api.Assertions.assertEquals;
34+
3735
public class TestHttpFSFileSystemLocalFileSystem extends BaseTestHttpFSWith {
3836

3937
private static String PATH_PREFIX;
@@ -45,8 +43,7 @@ public class TestHttpFSFileSystemLocalFileSystem extends BaseTestHttpFSWith {
4543
PATH_PREFIX = file.getAbsolutePath();
4644
}
4745

48-
public TestHttpFSFileSystemLocalFileSystem(Operation operation) {
49-
super(operation);
46+
public TestHttpFSFileSystemLocalFileSystem() {
5047
}
5148

5249
@Override
@@ -86,7 +83,7 @@ protected void testSetPermission() throws Exception {
8683
FileStatus status1 = fs.getFileStatus(path);
8784
fs.close();
8885
FsPermission permission2 = status1.getPermission();
89-
Assert.assertEquals(permission2, permission1);
86+
assertEquals(permission2, permission1);
9087

9188
// sticky bit not supported on Windows with local file system, so the
9289
// subclass skips that part of the test

hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/TestHttpFSWithHttpFSFileSystem.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,10 @@
2222
import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
2323
import org.apache.hadoop.fs.Path;
2424
import org.apache.hadoop.test.TestHdfsHelper;
25-
import org.junit.runner.RunWith;
26-
import org.junit.runners.Parameterized;
2725

28-
@RunWith(value = Parameterized.class)
2926
public class TestHttpFSWithHttpFSFileSystem extends BaseTestHttpFSWith {
3027

31-
public TestHttpFSWithHttpFSFileSystem(Operation operation) {
32-
super(operation);
28+
public TestHttpFSWithHttpFSFileSystem() {
3329
}
3430

3531
@Override

hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/server/TestCheckUploadContentTypeFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import javax.servlet.http.HttpServletResponse;
2525

2626
import org.apache.hadoop.fs.http.client.HttpFSFileSystem;
27-
import org.junit.Test;
27+
import org.junit.jupiter.api.Test;
2828
import org.mockito.Mockito;
2929

3030
public class TestCheckUploadContentTypeFilter {

hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/server/TestHttpFSAccessControlled.java

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
import org.apache.hadoop.test.TestDirHelper;
3030
import org.apache.hadoop.test.TestJetty;
3131
import org.apache.hadoop.test.TestJettyHelper;
32-
import org.junit.Assert;
33-
import org.junit.Test;
32+
import org.junit.jupiter.api.Test;
3433
import org.eclipse.jetty.server.Server;
3534
import org.eclipse.jetty.webapp.WebAppContext;
3635

@@ -44,6 +43,9 @@
4443
import java.net.URL;
4544
import java.text.MessageFormat;
4645

46+
import static org.junit.jupiter.api.Assertions.assertEquals;
47+
import static org.junit.jupiter.api.Assertions.assertTrue;
48+
4749
/**
4850
* This test class ensures that everything works as expected when
4951
* support with the access controlled HTTPFS file system.
@@ -93,9 +95,9 @@ private void startMiniDFS() throws Exception {
9395
*/
9496
private void createHttpFSServer() throws Exception {
9597
File homeDir = TestDirHelper.getTestDir();
96-
Assert.assertTrue(new File(homeDir, "conf").mkdir());
97-
Assert.assertTrue(new File(homeDir, "log").mkdir());
98-
Assert.assertTrue(new File(homeDir, "temp").mkdir());
98+
assertTrue(new File(homeDir, "conf").mkdir());
99+
assertTrue(new File(homeDir, "log").mkdir());
100+
assertTrue(new File(homeDir, "temp").mkdir());
99101
HttpFSServerWebApp.setHomeDirForCurrentThread(homeDir.getAbsolutePath());
100102

101103
File secretFile = new File(new File(homeDir, "conf"), "secret");
@@ -175,9 +177,9 @@ private void getCmd(String filename, String message, String command, boolean exp
175177
conn.connect();
176178
int resp = conn.getResponseCode();
177179
if ( expectOK ) {
178-
Assert.assertEquals( outMsg, HttpURLConnection.HTTP_OK, resp);
180+
assertEquals(HttpURLConnection.HTTP_OK, resp, outMsg);
179181
} else {
180-
Assert.assertEquals(outMsg, HttpURLConnection.HTTP_FORBIDDEN, resp);
182+
assertEquals(HttpURLConnection.HTTP_FORBIDDEN, resp, outMsg);
181183
}
182184
}
183185

@@ -207,9 +209,9 @@ private void putCmd(String filename, String message, String command,
207209
conn.connect();
208210
int resp = conn.getResponseCode();
209211
if ( expectOK ) {
210-
Assert.assertEquals(outMsg, HttpURLConnection.HTTP_OK, resp);
212+
assertEquals(HttpURLConnection.HTTP_OK, resp, outMsg);
211213
} else {
212-
Assert.assertEquals(outMsg, HttpURLConnection.HTTP_FORBIDDEN, resp);
214+
assertEquals(HttpURLConnection.HTTP_FORBIDDEN, resp, outMsg);
213215
}
214216
}
215217

@@ -239,9 +241,9 @@ private void deleteCmd(String filename, String message, String command,
239241
conn.connect();
240242
int resp = conn.getResponseCode();
241243
if ( expectOK ) {
242-
Assert.assertEquals(outMsg, HttpURLConnection.HTTP_OK, resp);
244+
assertEquals(HttpURLConnection.HTTP_OK, resp, outMsg);
243245
} else {
244-
Assert.assertEquals(outMsg, HttpURLConnection.HTTP_FORBIDDEN, resp);
246+
assertEquals(HttpURLConnection.HTTP_FORBIDDEN, resp, outMsg);
245247
}
246248
}
247249

@@ -271,9 +273,9 @@ private void postCmd(String filename, String message, String command,
271273
conn.connect();
272274
int resp = conn.getResponseCode();
273275
if ( expectOK ) {
274-
Assert.assertEquals(outMsg, HttpURLConnection.HTTP_OK, resp);
276+
assertEquals(HttpURLConnection.HTTP_OK, resp, outMsg);
275277
} else {
276-
Assert.assertEquals(outMsg, HttpURLConnection.HTTP_FORBIDDEN, resp);
278+
assertEquals(HttpURLConnection.HTTP_FORBIDDEN, resp, outMsg);
277279
}
278280
}
279281

0 commit comments

Comments
 (0)