This is an automated email from the ASF dual-hosted git repository.
szetszwo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new d71ab1f3303 HDDS-14402. Move InMemoryConfiguration to test (#9623)
d71ab1f3303 is described below
commit d71ab1f3303fb2238c1791fc15d56ab21202bb96
Author: Russole <[email protected]>
AuthorDate: Tue Jan 13 06:45:23 2026 +0800
HDDS-14402. Move InMemoryConfiguration to test (#9623)
---
hadoop-hdds/common/pom.xml | 6 ++++++
.../client/TestReplicationConfigValidator.java | 8 ++++----
.../hadoop/hdds/tracing/TestTracingUtil.java | 4 ++--
hadoop-hdds/config/pom.xml | 11 ++++++++++
.../conf/InMemoryConfigurationForTesting.java} | 6 +++---
.../hadoop/hdds/conf/TestConfigurationSource.java | 12 +++++------
.../hadoop/hdds/conf/TestReconfigurableConfig.java | 2 +-
hadoop-hdds/container-service/pom.xml | 6 ++++++
.../replication/TestGrpcContainerUploader.java | 4 ++--
hadoop-ozone/cli-shell/pom.xml | 6 ++++++
.../shell/TestOzoneAddressClientCreation.java | 24 +++++++++++-----------
hadoop-ozone/client/pom.xml | 6 ++++++
.../TestBlockOutputStreamIncrementalPutBlock.java | 20 +++++++-----------
.../client/checksum/TestFileChecksumHelper.java | 7 +++----
hadoop-ozone/multitenancy-ranger/pom.xml | 6 ++++++
...estRangerClientMultiTenantAccessController.java | 4 ++--
hadoop-ozone/ozone-manager/pom.xml | 6 ++++++
.../TestInMemoryMultiTenantAccessController.java | 4 ++--
pom.xml | 6 ++++++
19 files changed, 97 insertions(+), 51 deletions(-)
diff --git a/hadoop-hdds/common/pom.xml b/hadoop-hdds/common/pom.xml
index 95d7ebe39f4..988e359c2a9 100644
--- a/hadoop-hdds/common/pom.xml
+++ b/hadoop-hdds/common/pom.xml
@@ -192,6 +192,12 @@
<artifactId>slf4j-reload4j</artifactId>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.ozone</groupId>
+ <artifactId>hdds-config</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
<!-- Test dependencies -->
<dependency>
diff --git
a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/client/TestReplicationConfigValidator.java
b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/client/TestReplicationConfigValidator.java
index da61845012b..07c43c79a14 100644
---
a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/client/TestReplicationConfigValidator.java
+++
b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/client/TestReplicationConfigValidator.java
@@ -26,7 +26,7 @@
import java.util.LinkedList;
import java.util.List;
import org.apache.hadoop.hdds.client.ECReplicationConfig.EcCodec;
-import org.apache.hadoop.hdds.conf.InMemoryConfiguration;
+import org.apache.hadoop.hdds.conf.InMemoryConfigurationForTesting;
import org.apache.hadoop.hdds.conf.MutableConfigurationSource;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -46,10 +46,10 @@ class TestReplicationConfigValidator {
@BeforeAll
void setup() {
- defaultValidator = new InMemoryConfiguration()
+ defaultValidator = new InMemoryConfigurationForTesting()
.getObject(ReplicationConfigValidator.class);
- MutableConfigurationSource disabled = new InMemoryConfiguration();
+ MutableConfigurationSource disabled = new
InMemoryConfigurationForTesting();
disabled.set("ozone.replication.allowed-configs", "");
disabledValidator = disabled
.getObject(ReplicationConfigValidator.class);
@@ -127,7 +127,7 @@ void disabledAcceptsStandalone() {
@Test
void testCustomValidation() {
- MutableConfigurationSource config = new InMemoryConfiguration();
+ MutableConfigurationSource config = new InMemoryConfigurationForTesting();
config.set("ozone.replication.allowed-configs", "RATIS/THREE");
final ReplicationConfigValidator validator =
diff --git
a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/tracing/TestTracingUtil.java
b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/tracing/TestTracingUtil.java
index bc500ddddab..0df11a03ed3 100644
---
a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/tracing/TestTracingUtil.java
+++
b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/tracing/TestTracingUtil.java
@@ -22,7 +22,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
-import org.apache.hadoop.hdds.conf.InMemoryConfiguration;
+import org.apache.hadoop.hdds.conf.InMemoryConfigurationForTesting;
import org.apache.hadoop.hdds.conf.MutableConfigurationSource;
import org.apache.hadoop.hdds.scm.ScmConfigKeys;
import org.apache.hadoop.hdds.tracing.TestTraceAllMethod.Service;
@@ -53,7 +53,7 @@ public void testInitTracing() {
}
private static MutableConfigurationSource tracingEnabled() {
- MutableConfigurationSource config = new InMemoryConfiguration();
+ MutableConfigurationSource config = new InMemoryConfigurationForTesting();
config.setBoolean(ScmConfigKeys.HDDS_TRACING_ENABLED, true);
return config;
}
diff --git a/hadoop-hdds/config/pom.xml b/hadoop-hdds/config/pom.xml
index 44c7d02253c..dca25492fff 100644
--- a/hadoop-hdds/config/pom.xml
+++ b/hadoop-hdds/config/pom.xml
@@ -77,6 +77,17 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
diff --git
a/hadoop-hdds/config/src/main/java/org/apache/hadoop/hdds/conf/InMemoryConfiguration.java
b/hadoop-hdds/config/src/test/java/org/apache/hadoop/hdds/conf/InMemoryConfigurationForTesting.java
similarity index 88%
rename from
hadoop-hdds/config/src/main/java/org/apache/hadoop/hdds/conf/InMemoryConfiguration.java
rename to
hadoop-hdds/config/src/test/java/org/apache/hadoop/hdds/conf/InMemoryConfigurationForTesting.java
index 3a9669bd314..79c9d2ac3be 100644
---
a/hadoop-hdds/config/src/main/java/org/apache/hadoop/hdds/conf/InMemoryConfiguration.java
+++
b/hadoop-hdds/config/src/test/java/org/apache/hadoop/hdds/conf/InMemoryConfigurationForTesting.java
@@ -25,14 +25,14 @@
/**
* In memory, mutable configuration source for testing.
*/
-public class InMemoryConfiguration implements MutableConfigurationSource {
+public class InMemoryConfigurationForTesting implements
MutableConfigurationSource {
private Map<String, String> configs = new HashMap<>();
- public InMemoryConfiguration() {
+ public InMemoryConfigurationForTesting() {
}
- public InMemoryConfiguration(String key, String value) {
+ public InMemoryConfigurationForTesting(String key, String value) {
set(key, value);
}
diff --git
a/hadoop-hdds/config/src/test/java/org/apache/hadoop/hdds/conf/TestConfigurationSource.java
b/hadoop-hdds/config/src/test/java/org/apache/hadoop/hdds/conf/TestConfigurationSource.java
index f38658af201..d0473cbe0ef 100644
---
a/hadoop-hdds/config/src/test/java/org/apache/hadoop/hdds/conf/TestConfigurationSource.java
+++
b/hadoop-hdds/config/src/test/java/org/apache/hadoop/hdds/conf/TestConfigurationSource.java
@@ -27,7 +27,7 @@ class TestConfigurationSource {
@Test
void getPropsMatchPrefixAndTrimPrefix() {
- MutableConfigurationSource c = new InMemoryConfiguration();
+ MutableConfigurationSource c = new InMemoryConfigurationForTesting();
c.set("somePrefix.key", "value");
assertEquals(ImmutableMap.of("key", "value"),
@@ -36,7 +36,7 @@ void getPropsMatchPrefixAndTrimPrefix() {
@Test
void getPropsMatchPrefix() {
- MutableConfigurationSource c = new InMemoryConfiguration();
+ MutableConfigurationSource c = new InMemoryConfigurationForTesting();
c.set("somePrefix.key", "value");
assertEquals(ImmutableMap.of("somePrefix.key", "value"),
@@ -51,7 +51,7 @@ void reconfigurableProperties() {
prefix + ".grandpa.dyna"
);
- ConfigurationExample obj = new InMemoryConfiguration().getObject(
+ ConfigurationExample obj = new InMemoryConfigurationForTesting().getObject(
ConfigurationExample.class);
assertEquals(expected, obj.reconfigurableProperties());
@@ -59,7 +59,7 @@ void reconfigurableProperties() {
@Test
void reconfiguration() {
- MutableConfigurationSource subject = new InMemoryConfiguration();
+ MutableConfigurationSource subject = new InMemoryConfigurationForTesting();
ConfigurationExample orig = subject.getObject(ConfigurationExample.class);
ConfigurationExample obj = subject.getObject(ConfigurationExample.class);
@@ -73,7 +73,7 @@ void reconfiguration() {
@Test
void getPropertyWithPrefixIncludedInName() {
- MutableConfigurationSource conf = new InMemoryConfiguration();
+ MutableConfigurationSource conf = new InMemoryConfigurationForTesting();
String value = "newValue";
conf.set("ozone.test.config.with.prefix.included", value);
@@ -84,7 +84,7 @@ void getPropertyWithPrefixIncludedInName() {
@Test
void setPropertyWithPrefixIncludedInName() {
- MutableConfigurationSource conf = new InMemoryConfiguration();
+ MutableConfigurationSource conf = new InMemoryConfigurationForTesting();
ConfigurationExample subject = conf.getObject(ConfigurationExample.class);
String value = "newValue";
diff --git
a/hadoop-hdds/config/src/test/java/org/apache/hadoop/hdds/conf/TestReconfigurableConfig.java
b/hadoop-hdds/config/src/test/java/org/apache/hadoop/hdds/conf/TestReconfigurableConfig.java
index 5441b68b6c3..dfa707c31b9 100644
---
a/hadoop-hdds/config/src/test/java/org/apache/hadoop/hdds/conf/TestReconfigurableConfig.java
+++
b/hadoop-hdds/config/src/test/java/org/apache/hadoop/hdds/conf/TestReconfigurableConfig.java
@@ -28,7 +28,7 @@ class TestReconfigurableConfig {
@Test
void testReconfigureProperty() {
- ConfigurationExample subject = new InMemoryConfiguration()
+ ConfigurationExample subject = new InMemoryConfigurationForTesting()
.getObject(ConfigurationExample.class);
subject.reconfigureProperty("ozone.test.config.dynamic", "updated");
diff --git a/hadoop-hdds/container-service/pom.xml
b/hadoop-hdds/container-service/pom.xml
index b2b390af9e4..d43ad4d1202 100644
--- a/hadoop-hdds/container-service/pom.xml
+++ b/hadoop-hdds/container-service/pom.xml
@@ -239,6 +239,12 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.ozone</groupId>
+ <artifactId>hdds-config</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds-server-framework</artifactId>
diff --git
a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestGrpcContainerUploader.java
b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestGrpcContainerUploader.java
index b10b412b12f..4e53206e377 100644
---
a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestGrpcContainerUploader.java
+++
b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestGrpcContainerUploader.java
@@ -29,7 +29,7 @@
import java.io.OutputStream;
import java.util.concurrent.CompletableFuture;
import org.apache.commons.lang3.RandomUtils;
-import org.apache.hadoop.hdds.conf.InMemoryConfiguration;
+import org.apache.hadoop.hdds.conf.InMemoryConfigurationForTesting;
import org.apache.hadoop.hdds.protocol.DatanodeDetails;
import org.apache.hadoop.hdds.protocol.MockDatanodeDetails;
import
org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.SendContainerRequest;
@@ -117,7 +117,7 @@ void immediateError() throws Exception {
private static GrpcContainerUploader createSubject(
GrpcReplicationClient client) {
- return new GrpcContainerUploader(new InMemoryConfiguration(), null,
+ return new GrpcContainerUploader(new InMemoryConfigurationForTesting(),
null,
mock(ContainerController.class)) {
@Override
protected GrpcReplicationClient createReplicationClient(
diff --git a/hadoop-ozone/cli-shell/pom.xml b/hadoop-ozone/cli-shell/pom.xml
index ba3475203a8..2ea4cde683c 100644
--- a/hadoop-ozone/cli-shell/pom.xml
+++ b/hadoop-ozone/cli-shell/pom.xml
@@ -122,6 +122,12 @@
<artifactId>ozone-filesystem</artifactId>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.ozone</groupId>
+ <artifactId>hdds-config</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
diff --git
a/hadoop-ozone/cli-shell/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneAddressClientCreation.java
b/hadoop-ozone/cli-shell/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneAddressClientCreation.java
index 9fab5bcec24..0ce0f723009 100644
---
a/hadoop-ozone/cli-shell/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneAddressClientCreation.java
+++
b/hadoop-ozone/cli-shell/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneAddressClientCreation.java
@@ -26,7 +26,7 @@
import java.io.IOException;
import org.apache.hadoop.hdds.conf.ConfigurationSource;
-import org.apache.hadoop.hdds.conf.InMemoryConfiguration;
+import org.apache.hadoop.hdds.conf.InMemoryConfigurationForTesting;
import org.apache.hadoop.hdds.conf.MutableConfigurationSource;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.ozone.client.OzoneClient;
@@ -42,7 +42,7 @@ public class TestOzoneAddressClientCreation {
public void implicitNonHA() throws IOException {
TestableOzoneAddress address =
new TestableOzoneAddress("/vol1/bucket1/key1");
- address.createClient(new InMemoryConfiguration());
+ address.createClient(new InMemoryConfigurationForTesting());
assertTrue(address.simpleCreation);
}
@@ -52,7 +52,7 @@ public void implicitHAOneServiceId()
TestableOzoneAddress address =
new TestableOzoneAddress("/vol1/bucket1/key1");
address.createClient(
- new InMemoryConfiguration(OZONE_OM_SERVICE_IDS_KEY, "service1"));
+ new InMemoryConfigurationForTesting(OZONE_OM_SERVICE_IDS_KEY,
"service1"));
assertFalse(address.simpleCreation);
assertEquals("service1", address.serviceId);
}
@@ -63,7 +63,7 @@ public void implicitHaMultipleServiceId()
TestableOzoneAddress address =
new TestableOzoneAddress("/vol1/bucket1/key1");
assertThrows(OzoneClientException.class, () ->
- address.createClient(new
InMemoryConfiguration(OZONE_OM_SERVICE_IDS_KEY,
+ address.createClient(new
InMemoryConfigurationForTesting(OZONE_OM_SERVICE_IDS_KEY,
"service1,service2")));
}
@@ -72,7 +72,7 @@ public void implicitHaMultipleServiceIdWithDefaultServiceId()
throws IOException {
TestableOzoneAddress address =
new TestableOzoneAddress("/vol1/bucket1/key1");
- InMemoryConfiguration conf = new
InMemoryConfiguration(OZONE_OM_SERVICE_IDS_KEY,
+ InMemoryConfigurationForTesting conf = new
InMemoryConfigurationForTesting(OZONE_OM_SERVICE_IDS_KEY,
"service1,service2");
conf.set(OZONE_OM_INTERNAL_SERVICE_ID, "service2");
@@ -101,7 +101,7 @@ public void explicitHaMultipleServiceId()
TestableOzoneAddress address =
new TestableOzoneAddress("o3://service1/vol1/bucket1/key1");
address.createClient(
- new InMemoryConfiguration(OZONE_OM_SERVICE_IDS_KEY,
+ new InMemoryConfigurationForTesting(OZONE_OM_SERVICE_IDS_KEY,
"service1,service2"));
assertFalse(address.simpleCreation);
assertEquals("service1", address.serviceId);
@@ -111,7 +111,7 @@ public void explicitHaMultipleServiceId()
public void explicitNonHAHostPort() throws IOException {
TestableOzoneAddress address =
new TestableOzoneAddress("o3://om:9862/vol1/bucket1/key1");
- address.createClient(new InMemoryConfiguration());
+ address.createClient(new InMemoryConfigurationForTesting());
assertFalse(address.simpleCreation);
assertEquals("om", address.host);
assertEquals(9862, address.port);
@@ -123,7 +123,7 @@ public void explicitHAHostPortWithServiceId()
TestableOzoneAddress address =
new TestableOzoneAddress("o3://om:9862/vol1/bucket1/key1");
address.createClient(
- new InMemoryConfiguration(OZONE_OM_SERVICE_IDS_KEY, "service1"));
+ new InMemoryConfigurationForTesting(OZONE_OM_SERVICE_IDS_KEY,
"service1"));
assertFalse(address.simpleCreation);
assertEquals("om", address.host);
assertEquals(9862, address.port);
@@ -135,7 +135,7 @@ public void explicitAHostPortWithServiceIds()
TestableOzoneAddress address =
new TestableOzoneAddress("o3://om:9862/vol1/bucket1/key1");
address.createClient(
- new InMemoryConfiguration(OZONE_OM_SERVICE_IDS_KEY,
+ new InMemoryConfigurationForTesting(OZONE_OM_SERVICE_IDS_KEY,
"service1,service2"));
assertFalse(address.simpleCreation);
assertEquals("om", address.host);
@@ -147,7 +147,7 @@ public void explicitNonHAHost() throws IOException {
TestableOzoneAddress address =
new TestableOzoneAddress("o3://om/vol1/bucket1/key1");
address.createClient(
- new InMemoryConfiguration(OZONE_OM_SERVICE_IDS_KEY, "service1"));
+ new InMemoryConfigurationForTesting(OZONE_OM_SERVICE_IDS_KEY,
"service1"));
assertFalse(address.simpleCreation);
assertEquals("om", address.host);
}
@@ -156,7 +156,7 @@ public void explicitNonHAHost() throws IOException {
public void explicitHAHostPort() throws IOException {
TestableOzoneAddress address =
new TestableOzoneAddress("o3://om:1234/vol1/bucket1/key1");
- address.createClient(new InMemoryConfiguration());
+ address.createClient(new InMemoryConfigurationForTesting());
assertFalse(address.simpleCreation);
assertEquals("om", address.host);
assertEquals(1234, address.port);
@@ -167,7 +167,7 @@ public void explicitWrongScheme() throws IOException {
TestableOzoneAddress address =
new TestableOzoneAddress("ssh://host/vol1/bucket1/key1");
assertThrows(OzoneClientException.class, () ->
- address.createClient(new InMemoryConfiguration()));
+ address.createClient(new InMemoryConfigurationForTesting()));
}
/**
diff --git a/hadoop-ozone/client/pom.xml b/hadoop-ozone/client/pom.xml
index 6d817fa3163..877294f7607 100644
--- a/hadoop-ozone/client/pom.xml
+++ b/hadoop-ozone/client/pom.xml
@@ -114,6 +114,12 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.ozone</groupId>
+ <artifactId>hdds-config</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds-test-utils</artifactId>
diff --git
a/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/TestBlockOutputStreamIncrementalPutBlock.java
b/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/TestBlockOutputStreamIncrementalPutBlock.java
index 0bd1ac53055..caf18d3310e 100644
---
a/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/TestBlockOutputStreamIncrementalPutBlock.java
+++
b/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/TestBlockOutputStreamIncrementalPutBlock.java
@@ -28,8 +28,7 @@
import java.util.UUID;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.hadoop.hdds.client.ReplicationConfig;
-import org.apache.hadoop.hdds.conf.ConfigurationSource;
-import org.apache.hadoop.hdds.conf.InMemoryConfiguration;
+import org.apache.hadoop.hdds.conf.InMemoryConfigurationForTesting;
import org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos;
import org.apache.hadoop.hdds.scm.OzoneClientConfig;
import org.apache.hadoop.hdds.scm.XceiverClientFactory;
@@ -53,7 +52,7 @@ public class TestBlockOutputStreamIncrementalPutBlock {
private final String volumeName = UUID.randomUUID().toString();
private final String bucketName = UUID.randomUUID().toString();
private OzoneBucket bucket;
- private final ConfigurationSource config = new InMemoryConfiguration();
+ private final InMemoryConfigurationForTesting config = new
InMemoryConfigurationForTesting();
public static Iterable<Boolean> parameters() {
return Arrays.asList(true, false);
@@ -65,16 +64,11 @@ private void init(boolean incrementalChunkList) throws
IOException {
clientConfig.setIncrementalChunkList(incrementalChunkList);
clientConfig.setChecksumType(ContainerProtos.ChecksumType.CRC32C);
- ((InMemoryConfiguration)config).setFromObject(clientConfig);
-
- ((InMemoryConfiguration) config).setBoolean(
- OzoneConfigKeys.OZONE_HBASE_ENHANCEMENTS_ALLOWED, true);
- ((InMemoryConfiguration) config).setBoolean(
- "ozone.client.hbase.enhancements.allowed", true);
- ((InMemoryConfiguration) config).setBoolean(
- OzoneConfigKeys.OZONE_FS_HSYNC_ENABLED, true);
- ((InMemoryConfiguration) config).setInt(
- "ozone.client.bytes.per.checksum", 8192);
+ config.setFromObject(clientConfig);
+ config.setBoolean(OzoneConfigKeys.OZONE_HBASE_ENHANCEMENTS_ALLOWED, true);
+ config.setBoolean("ozone.client.hbase.enhancements.allowed", true);
+ config.setBoolean(OzoneConfigKeys.OZONE_FS_HSYNC_ENABLED, true);
+ config.setInt("ozone.client.bytes.per.checksum", 8192);
RpcClient rpcClient = new RpcClient(config, null) {
diff --git
a/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/checksum/TestFileChecksumHelper.java
b/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/checksum/TestFileChecksumHelper.java
index e8fd8a76657..bc894a58f9c 100644
---
a/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/checksum/TestFileChecksumHelper.java
+++
b/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/checksum/TestFileChecksumHelper.java
@@ -43,8 +43,7 @@
import org.apache.hadoop.hdds.client.RatisReplicationConfig;
import org.apache.hadoop.hdds.client.ReplicationConfig;
import org.apache.hadoop.hdds.client.ReplicationType;
-import org.apache.hadoop.hdds.conf.ConfigurationSource;
-import org.apache.hadoop.hdds.conf.InMemoryConfiguration;
+import org.apache.hadoop.hdds.conf.InMemoryConfigurationForTesting;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.protocol.DatanodeDetails;
import org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos;
@@ -90,11 +89,11 @@ public class TestFileChecksumHelper {
@BeforeEach
public void init() throws IOException {
- ConfigurationSource config = new InMemoryConfiguration();
+ InMemoryConfigurationForTesting config = new
InMemoryConfigurationForTesting();
OzoneClientConfig clientConfig = config.getObject(OzoneClientConfig.class);
clientConfig.setChecksumType(ContainerProtos.ChecksumType.CRC32C);
- ((InMemoryConfiguration)config).setFromObject(clientConfig);
+ config.setFromObject(clientConfig);
rpcClient = new RpcClient(config, null) {
diff --git a/hadoop-ozone/multitenancy-ranger/pom.xml
b/hadoop-ozone/multitenancy-ranger/pom.xml
index 623b213a337..62f5e5a5fd3 100644
--- a/hadoop-ozone/multitenancy-ranger/pom.xml
+++ b/hadoop-ozone/multitenancy-ranger/pom.xml
@@ -156,6 +156,12 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.ozone</groupId>
+ <artifactId>hdds-config</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds-test-utils</artifactId>
diff --git
a/hadoop-ozone/multitenancy-ranger/src/test/java/org/apache/hadoop/ozone/om/multitenant/TestRangerClientMultiTenantAccessController.java
b/hadoop-ozone/multitenancy-ranger/src/test/java/org/apache/hadoop/ozone/om/multitenant/TestRangerClientMultiTenantAccessController.java
index e994056a4b6..25c36945200 100644
---
a/hadoop-ozone/multitenancy-ranger/src/test/java/org/apache/hadoop/ozone/om/multitenant/TestRangerClientMultiTenantAccessController.java
+++
b/hadoop-ozone/multitenancy-ranger/src/test/java/org/apache/hadoop/ozone/om/multitenant/TestRangerClientMultiTenantAccessController.java
@@ -23,7 +23,7 @@
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_RANGER_SERVICE;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
-import org.apache.hadoop.hdds.conf.InMemoryConfiguration;
+import org.apache.hadoop.hdds.conf.InMemoryConfigurationForTesting;
import org.apache.hadoop.hdds.conf.MutableConfigurationSource;
import org.apache.hadoop.security.authentication.util.KerberosName;
import org.apache.ozone.test.GenericTestUtils;
@@ -37,7 +37,7 @@ class TestRangerClientMultiTenantAccessController extends
MultiTenantAccessContr
@Override
protected MultiTenantAccessController createSubject() {
- MutableConfigurationSource conf = new InMemoryConfiguration();
+ MutableConfigurationSource conf = new InMemoryConfigurationForTesting();
// Set up truststore
System.setProperty("javax.net.ssl.trustStore",
diff --git a/hadoop-ozone/ozone-manager/pom.xml
b/hadoop-ozone/ozone-manager/pom.xml
index 923b1c02cbe..ba17f1992b3 100644
--- a/hadoop-ozone/ozone-manager/pom.xml
+++ b/hadoop-ozone/ozone-manager/pom.xml
@@ -268,6 +268,12 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.ozone</groupId>
+ <artifactId>hdds-config</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds-server-framework</artifactId>
diff --git
a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/multitenant/TestInMemoryMultiTenantAccessController.java
b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/multitenant/TestInMemoryMultiTenantAccessController.java
index e9d0660aa62..1622987c1b6 100644
---
a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/multitenant/TestInMemoryMultiTenantAccessController.java
+++
b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/multitenant/TestInMemoryMultiTenantAccessController.java
@@ -20,14 +20,14 @@
import static
org.apache.hadoop.ozone.om.OMMultiTenantManagerImpl.OZONE_OM_TENANT_DEV_SKIP_RANGER;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
-import org.apache.hadoop.hdds.conf.InMemoryConfiguration;
+import org.apache.hadoop.hdds.conf.InMemoryConfigurationForTesting;
import org.apache.hadoop.hdds.conf.MutableConfigurationSource;
class TestInMemoryMultiTenantAccessController extends
MultiTenantAccessControllerTests {
@Override
protected MultiTenantAccessController createSubject() {
- MutableConfigurationSource conf = new InMemoryConfiguration();
+ MutableConfigurationSource conf = new InMemoryConfigurationForTesting();
conf.setBoolean(OZONE_OM_TENANT_DEV_SKIP_RANGER, true);
return assertInstanceOf(InMemoryMultiTenantAccessController.class,
MultiTenantAccessController.create(conf));
}
diff --git a/pom.xml b/pom.xml
index b2a1ec3e3ae..454b72aa16f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1023,6 +1023,12 @@
<artifactId>hdds-config</artifactId>
<version>${hdds.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.ozone</groupId>
+ <artifactId>hdds-config</artifactId>
+ <version>${hdds.version}</version>
+ <type>test-jar</type>
+ </dependency>
<dependency>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds-container-service</artifactId>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]