You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2023/07/19 16:46:45 UTC

[accumulo] branch 2.1 updated: tests custom prop changes are seen (#3627)

This is an automated email from the ASF dual-hosted git repository.

kturner pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/2.1 by this push:
     new abd7c6c2f0 tests custom prop changes are seen (#3627)
abd7c6c2f0 is described below

commit abd7c6c2f0b6e49e467afdb859d024b573e58a7c
Author: Keith Turner <kt...@apache.org>
AuthorDate: Wed Jul 19 12:46:38 2023 -0400

    tests custom prop changes are seen (#3627)
    
    This is a follow up to #3588.  Realized that ConfigurationCopy supported
    the Deriver that ConfigrationImpl uses to detect changes, so added unit
    test that leverage this.
---
 .../apache/accumulo/core/util/ConfigurationImplTest.java | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/core/src/test/java/org/apache/accumulo/core/util/ConfigurationImplTest.java b/core/src/test/java/org/apache/accumulo/core/util/ConfigurationImplTest.java
index fba1bee4a0..dbc0407b21 100644
--- a/core/src/test/java/org/apache/accumulo/core/util/ConfigurationImplTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/util/ConfigurationImplTest.java
@@ -45,5 +45,21 @@ public class ConfigurationImplTest {
 
     assertNull(confImp.getCustom("p1"));
     assertNull(confImp.getTableCustom("p3"));
+
+    // ensure changes to custom props are seen
+    conf.set("general.custom.p4", "v5");
+    conf.set("table.custom.p2", "v6");
+    conf.set("table.custom.p5", "v7");
+
+    assertEquals(Map.of("p3", "v3", "p4", "v5"), confImp.getCustom());
+    assertEquals(Map.of("p1", "v1", "p2", "v6", "p5", "v7"), confImp.getTableCustom());
+
+    assertEquals("v3", confImp.getCustom("p3"));
+    assertEquals("v5", confImp.getCustom("p4"));
+    assertEquals("v1", confImp.getTableCustom("p1"));
+    assertEquals("v6", confImp.getTableCustom("p2"));
+
+    assertNull(confImp.getCustom("p5"));
+    assertNull(confImp.getTableCustom("p4"));
   }
 }