diff --git a/hadoop-client-modules/hadoop-client-minicluster/pom.xml b/hadoop-client-modules/hadoop-client-minicluster/pom.xml index 189b0f291118f..fe58ccbf60e2a 100644 --- a/hadoop-client-modules/hadoop-client-minicluster/pom.xml +++ b/hadoop-client-modules/hadoop-client-minicluster/pom.xml @@ -51,12 +51,6 @@ hadoop-client-runtime runtime - - - junit - junit - runtime - org.apache.hadoop @@ -629,6 +623,10 @@ jakarta.servlet jakarta.servlet-api + + junit-jupiter + org.junit.jupiter + true @@ -640,6 +638,10 @@ jakarta.ws.rs jakarta.ws.rs-api + + junit-jupiter + org.junit.jupiter + true diff --git a/hadoop-common-project/hadoop-auth/pom.xml b/hadoop-common-project/hadoop-auth/pom.xml index 506502476ad78..eafc3fd5fa7ad 100644 --- a/hadoop-common-project/hadoop-auth/pom.xml +++ b/hadoop-common-project/hadoop-auth/pom.xml @@ -204,6 +204,26 @@ assertj-core test + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.jupiter + junit-jupiter-params + test + + + org.junit.platform + junit-platform-launcher + test + diff --git a/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/util/TestZookeeperClientCreation.java b/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/util/TestZookeeperClientCreation.java index 65cf3939ab44b..d91a91525a063 100644 --- a/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/util/TestZookeeperClientCreation.java +++ b/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/util/TestZookeeperClientCreation.java @@ -24,8 +24,6 @@ import org.apache.zookeeper.ZooDefs; import org.apache.zookeeper.client.ZKClientConfig; import org.apache.zookeeper.common.ClientX509Util; -import org.hamcrest.Matcher; -import org.hamcrest.core.IsNull; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; @@ -35,10 +33,7 @@ import java.util.Arrays; -import static org.hamcrest.CoreMatchers.anyOf; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentCaptor.forClass; import static org.mockito.ArgumentMatchers.isA; @@ -219,14 +214,18 @@ public void testSSLConfiguration() { verify(cfBuilder).zkClientConfig(clientConfCaptor.capture()); ZKClientConfig conf = clientConfCaptor.getValue(); - assertThat(conf.getProperty(ZKClientConfig.SECURE_CLIENT), is("true")); - assertThat(conf.getProperty(ZKClientConfig.ZOOKEEPER_CLIENT_CNXN_SOCKET), - is("org.apache.zookeeper.ClientCnxnSocketNetty")); + assertThat(conf.getProperty(ZKClientConfig.SECURE_CLIENT)).isEqualTo("true"); + assertThat(conf.getProperty(ZKClientConfig.ZOOKEEPER_CLIENT_CNXN_SOCKET)) + .isEqualTo("org.apache.zookeeper.ClientCnxnSocketNetty"); try (ClientX509Util sslOpts = new ClientX509Util()) { - assertThat(conf.getProperty(sslOpts.getSslKeystoreLocationProperty()), is("keystoreLoc")); - assertThat(conf.getProperty(sslOpts.getSslKeystorePasswdProperty()), is("ksPass")); - assertThat(conf.getProperty(sslOpts.getSslTruststoreLocationProperty()), is("truststoreLoc")); - assertThat(conf.getProperty(sslOpts.getSslTruststorePasswdProperty()), is("tsPass")); + assertThat(conf.getProperty(sslOpts.getSslKeystoreLocationProperty())) + .isEqualTo("keystoreLoc"); + assertThat(conf.getProperty(sslOpts.getSslKeystorePasswdProperty())) + .isEqualTo("ksPass"); + assertThat(conf.getProperty(sslOpts.getSslTruststoreLocationProperty())) + .isEqualTo("truststoreLoc"); + assertThat(conf.getProperty(sslOpts.getSslTruststorePasswdProperty())) + .isEqualTo("tsPass"); } verifyDummyConnectionString(); @@ -244,7 +243,7 @@ public void testNoConnectionString(){ clientConfigurer.withConnectionString(null); Throwable t = assertThrows(NullPointerException.class, () -> clientConfigurer.create()); - assertThat(t.getMessage(), containsString("Zookeeper connection string cannot be null!")); + assertThat(t.getMessage()).contains("Zookeeper connection string cannot be null!"); } @Test @@ -252,7 +251,7 @@ public void testNoRetryPolicy() { clientConfigurer.withRetryPolicy(null); Throwable t = assertThrows(NullPointerException.class, () -> clientConfigurer.create()); - assertThat(t.getMessage(), containsString("Zookeeper connection retry policy cannot be null!")); + assertThat(t.getMessage()).contains("Zookeeper connection retry policy cannot be null!"); } @Test @@ -260,7 +259,7 @@ public void testNoAuthType() { clientConfigurer.withAuthType(null); Throwable t = assertThrows(NullPointerException.class, () -> clientConfigurer.create()); - assertThat(t.getMessage(), containsString("Zookeeper authType cannot be null!")); + assertThat(t.getMessage()).contains("Zookeeper authType cannot be null!"); } @Test @@ -268,7 +267,7 @@ public void testUnrecognizedAuthType() { clientConfigurer.withAuthType("something"); Throwable t = assertThrows(IllegalArgumentException.class, () -> clientConfigurer.create()); - assertThat(t.getMessage(), is("Zookeeper authType must be one of [none, sasl]!")); + assertThat(t.getMessage()).isEqualTo("Zookeeper authType must be one of [none, sasl]!"); } @Test @@ -276,7 +275,7 @@ public void testSaslAuthTypeWithoutKeytab() { clientConfigurer.withAuthType("sasl"); Throwable t = assertThrows(IllegalArgumentException.class, () -> clientConfigurer.create()); - assertThat(t.getMessage(), is("Zookeeper client's Kerberos Keytab must be specified!")); + assertThat(t.getMessage()).isEqualTo("Zookeeper client's Kerberos Keytab must be specified!"); } @Test @@ -286,7 +285,8 @@ public void testSaslAuthTypeWithEmptyKeytab() { .withKeytab(""); Throwable t = assertThrows(IllegalArgumentException.class, () -> clientConfigurer.create()); - assertThat(t.getMessage(), is("Zookeeper client's Kerberos Keytab must be specified!")); + + assertThat(t.getMessage()).isEqualTo("Zookeeper client's Kerberos Keytab must be specified!"); } @Test @@ -296,7 +296,8 @@ public void testSaslAuthTypeWithoutPrincipal() { .withKeytab("keytabLoc"); Throwable t = assertThrows(IllegalArgumentException.class, () -> clientConfigurer.create()); - assertThat(t.getMessage(), is("Zookeeper client's Kerberos Principal must be specified!")); + assertThat(t.getMessage()).isEqualTo( + "Zookeeper client's Kerberos Principal must be specified!"); } @Test @@ -307,7 +308,8 @@ public void testSaslAuthTypeWithEmptyPrincipal() { .withPrincipal(""); Throwable t = assertThrows(IllegalArgumentException.class, () -> clientConfigurer.create()); - assertThat(t.getMessage(), is("Zookeeper client's Kerberos Principal must be specified!")); + assertThat(t.getMessage()).isEqualTo( + "Zookeeper client's Kerberos Principal must be specified!"); } @Test @@ -319,7 +321,7 @@ public void testSaslAuthTypeWithoutJaasLoginEntryName() { .withJaasLoginEntryName(null); Throwable t = assertThrows(IllegalArgumentException.class, () -> clientConfigurer.create()); - assertThat(t.getMessage(), is("JAAS Login Entry name must be specified!")); + assertThat(t.getMessage()).isEqualTo("JAAS Login Entry name must be specified!"); } @Test @@ -331,7 +333,7 @@ public void testSaslAuthTypeWithEmptyJaasLoginEntryName() { .withJaasLoginEntryName(""); Throwable t = assertThrows(IllegalArgumentException.class, () -> clientConfigurer.create()); - assertThat(t.getMessage(), is("JAAS Login Entry name must be specified!")); + assertThat(t.getMessage()).isEqualTo("JAAS Login Entry name must be specified!"); } @Test @@ -340,8 +342,8 @@ public void testSSLWithoutKeystore() { .enableSSL(true); Throwable t = assertThrows(IllegalArgumentException.class, () -> clientConfigurer.create()); - assertThat(t.getMessage(), - is("The keystore location parameter is empty for the ZooKeeper client connection.")); + assertThat(t.getMessage()).isEqualTo( + "The keystore location parameter is empty for the ZooKeeper client connection."); } @Test @@ -351,8 +353,8 @@ public void testSSLWithEmptyKeystore() { .withKeystore(""); Throwable t = assertThrows(IllegalArgumentException.class, () -> clientConfigurer.create()); - assertThat(t.getMessage(), - is("The keystore location parameter is empty for the ZooKeeper client connection.")); + assertThat(t.getMessage()).isEqualTo( + "The keystore location parameter is empty for the ZooKeeper client connection."); } @Test @@ -362,8 +364,8 @@ public void testSSLWithoutTruststore() { .withKeystore("keyStoreLoc"); Throwable t = assertThrows(IllegalArgumentException.class, () -> clientConfigurer.create()); - assertThat(t.getMessage(), - is("The truststore location parameter is empty for the ZooKeeper client connection.")); + assertThat(t.getMessage()).isEqualTo( + "The truststore location parameter is empty for the ZooKeeper client connection."); } @Test @@ -374,8 +376,8 @@ public void testSSLWithEmptyTruststore() { .withTruststore(""); Throwable t = assertThrows(IllegalArgumentException.class, () -> clientConfigurer.create()); - assertThat(t.getMessage(), - is("The truststore location parameter is empty for the ZooKeeper client connection.")); + assertThat(t.getMessage()).isEqualTo( + "The truststore location parameter is empty for the ZooKeeper client connection."); } private void testSaslAuthType(String vendor) { @@ -395,36 +397,39 @@ private void testSaslAuthType(String vendor) { verify(cfBuilder).aclProvider(aclProviderCaptor.capture()); SASLOwnerACLProvider aclProvider = aclProviderCaptor.getValue(); - assertThat(aclProvider.getDefaultAcl().size(), is(1)); - assertThat(aclProvider.getDefaultAcl().get(0).getId().getScheme(), is("sasl")); - assertThat(aclProvider.getDefaultAcl().get(0).getId().getId(), is("principal")); - assertThat(aclProvider.getDefaultAcl().get(0).getPerms(), is(ZooDefs.Perms.ALL)); + assertThat(aclProvider.getDefaultAcl().size()).isEqualTo(1); + assertThat(aclProvider.getDefaultAcl().get(0).getId().getScheme()).isEqualTo("sasl"); + assertThat(aclProvider.getDefaultAcl().get(0).getId().getId()).isEqualTo("principal"); + assertThat(aclProvider.getDefaultAcl().get(0).getPerms()).isEqualTo(ZooDefs.Perms.ALL); Arrays.stream(new String[] {"/", "/foo", "/foo/bar/baz", "/random/path"}) .forEach(s -> { - assertThat(aclProvider.getAclForPath(s).size(), is(1)); - assertThat(aclProvider.getAclForPath(s).get(0).getId().getScheme(), is("sasl")); - assertThat(aclProvider.getAclForPath(s).get(0).getId().getId(), is("principal")); - assertThat(aclProvider.getAclForPath(s).get(0).getPerms(), is(ZooDefs.Perms.ALL)); + assertThat(aclProvider.getAclForPath(s).size()).isEqualTo(1); + assertThat(aclProvider.getAclForPath(s).get(0).getId().getScheme()).isEqualTo("sasl"); + assertThat(aclProvider.getAclForPath(s).get(0).getId().getId()).isEqualTo("principal"); + assertThat(aclProvider.getAclForPath(s).get(0).getPerms()).isEqualTo(ZooDefs.Perms.ALL); }); - assertThat(System.getProperty(ZKClientConfig.LOGIN_CONTEXT_NAME_KEY), is("TestEntry")); - assertThat(System.getProperty("zookeeper.authProvider.1"), - is("org.apache.zookeeper.server.auth.SASLAuthenticationProvider")); + assertThat(System.getProperty(ZKClientConfig.LOGIN_CONTEXT_NAME_KEY)).isEqualTo("TestEntry"); + assertThat(System.getProperty("zookeeper.authProvider.1")).isEqualTo( + "org.apache.zookeeper.server.auth.SASLAuthenticationProvider"); Configuration config = Configuration.getConfiguration(); - assertThat(config.getAppConfigurationEntry("TestEntry").length, is(1)); + assertThat(config.getAppConfigurationEntry("TestEntry").length).isEqualTo(1); AppConfigurationEntry entry = config.getAppConfigurationEntry("TestEntry")[0]; - assertThat(entry.getOptions().get("keyTab"), is("keytabLoc")); - assertThat(entry.getOptions().get("principal"), is("principal@some.host/SOME.REALM")); - assertThat(entry.getOptions().get("useKeyTab"), is("true")); - assertThat(entry.getOptions().get("storeKey"), is("true")); - assertThat(entry.getOptions().get("useTicketCache"), is("false")); - assertThat(entry.getOptions().get("refreshKrb5Config"), is("true")); + assertThat(entry.getOptions().get("keyTab")).isEqualTo("keytabLoc"); + assertThat(entry.getOptions().get("principal")).isEqualTo("principal@some.host/SOME.REALM"); + assertThat(entry.getOptions().get("useKeyTab")).isEqualTo("true"); + assertThat(entry.getOptions().get("storeKey")).isEqualTo("true"); + assertThat(entry.getOptions().get("useTicketCache")).isEqualTo("false"); + assertThat(entry.getOptions().get("refreshKrb5Config")).isEqualTo("true"); + if (System.getProperty("java.vendor").contains("IBM")){ - assertThat(entry.getLoginModuleName(), is("com.ibm.security.auth.module.Krb5LoginModule")); + assertThat(entry.getLoginModuleName()).isEqualTo( + "com.ibm.security.auth.module.Krb5LoginModule"); } else { - assertThat(entry.getLoginModuleName(), is("com.sun.security.auth.module.Krb5LoginModule")); + assertThat(entry.getLoginModuleName()).isEqualTo( + "com.sun.security.auth.module.Krb5LoginModule"); } } finally { Configuration.setConfiguration(origConf); @@ -465,8 +470,8 @@ private void verifyDefaultRetryPolicy() { verify(cfBuilder).retryPolicy(retry.capture()); ExponentialBackoffRetry policy = retry.getValue(); - assertThat(policy.getBaseSleepTimeMs(), is(1000)); - assertThat(policy.getN(), is(3)); + assertThat(policy.getBaseSleepTimeMs()).isEqualTo(1000); + assertThat(policy.getN()).isEqualTo(3); } private void verifyDefaultAclProvider() { @@ -478,21 +483,16 @@ private void verifyDefaultZKClientConfig() { verify(cfBuilder).zkClientConfig(clientConfCaptor.capture()); ZKClientConfig conf = clientConfCaptor.getValue(); - assertThat(conf.getProperty(ZKClientConfig.SECURE_CLIENT), isEmptyOrFalse()); + assertThat(conf.getProperty(ZKClientConfig.SECURE_CLIENT)) + .satisfiesAnyOf(value -> assertThat(value).isNullOrEmpty(), + value -> assertThat(value).isEqualTo("false")); + try (ClientX509Util sslOpts = new ClientX509Util()) { - assertThat(conf.getProperty(sslOpts.getSslKeystoreLocationProperty()), isEmpty()); - assertThat(conf.getProperty(sslOpts.getSslKeystorePasswdProperty()), isEmpty()); - assertThat(conf.getProperty(sslOpts.getSslTruststoreLocationProperty()), isEmpty()); - assertThat(conf.getProperty(sslOpts.getSslTruststorePasswdProperty()), isEmpty()); + assertThat(conf.getProperty(sslOpts.getSslKeystoreLocationProperty())).isNullOrEmpty(); + assertThat(conf.getProperty(sslOpts.getSslKeystorePasswdProperty())).isNullOrEmpty(); + assertThat(conf.getProperty(sslOpts.getSslTruststoreLocationProperty())).isNullOrEmpty(); + assertThat(conf.getProperty(sslOpts.getSslTruststorePasswdProperty())).isNullOrEmpty(); } } - private Matcher isEmptyOrFalse() { - return anyOf(isEmpty(), is("false")); - } - - private Matcher isEmpty() { - return anyOf(new IsNull<>(), is("")); - } - } diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfiguration.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfiguration.java index fa0301b251765..6bb7c2bd1d3f9 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfiguration.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfiguration.java @@ -2610,12 +2610,6 @@ public void testGettingPropertiesWithPrefix() throws Exception { assertTrue(prefixedProps.isEmpty()); } - public static void main(String[] argv) throws Exception { - junit.textui.TestRunner.main(new String[]{ - TestConfiguration.class.getName() - }); - } - @Test public void testGetAllPropertiesByTags() throws Exception { diff --git a/hadoop-common-project/hadoop-minikdc/pom.xml b/hadoop-common-project/hadoop-minikdc/pom.xml index 2296a428e4690..ab314f9b7562c 100644 --- a/hadoop-common-project/hadoop-minikdc/pom.xml +++ b/hadoop-common-project/hadoop-minikdc/pom.xml @@ -43,11 +43,6 @@ slf4j-reload4j compile - - junit - junit - compile - org.assertj assertj-core diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/diskbalancer/DiskBalancerResultVerifier.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/diskbalancer/DiskBalancerResultVerifier.java deleted file mode 100644 index 22367ee2fa97a..0000000000000 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/diskbalancer/DiskBalancerResultVerifier.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with this - * work for additional information regarding copyright ownership. The ASF - * licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - *

- * http://www.apache.org/licenses/LICENSE-2.0 - *

- * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.apache.hadoop.hdfs.server.diskbalancer; - -import org.hamcrest.Description; -import org.hamcrest.TypeSafeMatcher; - -/** - * Helps in verifying test results. - */ -public class DiskBalancerResultVerifier - extends TypeSafeMatcher { - private final DiskBalancerException.Result expectedResult; - - DiskBalancerResultVerifier(DiskBalancerException.Result expectedResult) { - this.expectedResult = expectedResult; - } - - @Override - protected boolean matchesSafely(DiskBalancerException exception) { - return (this.expectedResult == exception.getResult()); - } - - @Override - public void describeTo(Description description) { - description.appendText("expects Result: ") - .appendValue(this.expectedResult); - - } -} diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestHAFsck.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestHAFsck.java index 97f9bd4566bc0..4161beed20ae5 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestHAFsck.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestHAFsck.java @@ -22,8 +22,9 @@ import java.util.Arrays; import org.junit.jupiter.api.Test; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameter; +import org.junit.jupiter.params.Parameter; +import org.junit.jupiter.params.ParameterizedClass; +import org.junit.jupiter.params.provider.MethodSource; import org.slf4j.event.Level; import org.apache.hadoop.conf.Configuration; @@ -39,20 +40,21 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; +@ParameterizedClass(name = "ProxyProvider: {0}") +@MethodSource("data") public class TestHAFsck { static { GenericTestUtils.setLogLevel(DFSUtil.LOG, Level.TRACE); } - @Parameter + @Parameter(0) private String proxyProvider; public String getProxyProvider() { return proxyProvider; } - @Parameterized.Parameters(name = "ProxyProvider: {0}") public static Iterable data() { return Arrays.asList(new Object[][] {{ConfiguredFailoverProxyProvider.class.getName()}, diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/pom.xml b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/pom.xml index fee97311ee589..486c4697d2952 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/pom.xml +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/pom.xml @@ -66,6 +66,21 @@ junit-platform-launcher test + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.jupiter + junit-jupiter-params + test + diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/pom.xml b/hadoop-mapreduce-project/hadoop-mapreduce-client/pom.xml index be7e5ea682989..10c4f3ca97aa6 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/pom.xml +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/pom.xml @@ -152,11 +152,23 @@ org.glassfish.jersey.test-framework jersey-test-framework-core test + + + junit-jupiter + org.junit.jupiter + + org.glassfish.jersey.test-framework.providers jersey-test-framework-provider-jetty test + + + junit-jupiter + org.junit.jupiter + + diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml index c71e61500a7c3..24dd3ea0cf238 100644 --- a/hadoop-project/pom.xml +++ b/hadoop-project/pom.xml @@ -236,9 +236,7 @@ 2.0 2.11.0 2.6.1-hadoop3 - 4.13.2 5.13.3 - 5.13.3 1.13.3 3.12.2 3.9.0 @@ -1174,12 +1172,6 @@ ${junit.jupiter.version} test - - junit - junit - ${junit.version} - test - org.junit.jupiter junit-jupiter-engine @@ -1192,12 +1184,6 @@ ${junit.jupiter.version} test - - org.junit.vintage - junit-vintage-engine - ${junit.vintage.version} - test - org.junit.platform diff --git a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/utils/Parallelized.java b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/utils/Parallelized.java deleted file mode 100644 index 994b8ec07b622..0000000000000 --- a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/utils/Parallelized.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.apache.hadoop.fs.azurebfs.utils; - -import org.junit.runners.Parameterized; -import org.junit.runners.model.RunnerScheduler; - -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; - -/** - * Provided for convenience to execute parametrized test cases concurrently. - */ -public class Parallelized extends Parameterized { - - public Parallelized(Class classObj) throws Throwable { - super(classObj); - setScheduler(new ThreadPoolScheduler()); - } - - private static class ThreadPoolScheduler implements RunnerScheduler { - private ExecutorService executor; - - ThreadPoolScheduler() { - int numThreads = 10; - executor = Executors.newFixedThreadPool(numThreads); - } - - public void finished() { - executor.shutdown(); - try { - executor.awaitTermination(10, TimeUnit.MINUTES); - } catch (InterruptedException exc) { - throw new RuntimeException(exc); - } - } - - public void schedule(Runnable childStatement) { - executor.submit(childStatement); - } - } -} \ No newline at end of file diff --git a/hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/pom.xml b/hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/pom.xml index 307e4bb0d6b50..b9068953aadd1 100644 --- a/hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/pom.xml +++ b/hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/pom.xml @@ -44,12 +44,6 @@ hadoop-shaded-guava compile - - junit - junit - - compile - org.apache.hadoop hadoop-client diff --git a/hadoop-tools/hadoop-resourceestimator/pom.xml b/hadoop-tools/hadoop-resourceestimator/pom.xml index 707b47a5f3a79..1817bfc29a849 100644 --- a/hadoop-tools/hadoop-resourceestimator/pom.xml +++ b/hadoop-tools/hadoop-resourceestimator/pom.xml @@ -78,11 +78,6 @@ org.glassfish.jersey.core jersey-server - - junit - junit - test - org.junit.jupiter junit-jupiter-api diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi/pom.xml index c5b87f0fc327e..2e9ce48b2cebe 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi/pom.xml +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-csi/pom.xml @@ -95,10 +95,6 @@ - - junit - junit - org.assertj assertj-core