You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by bb...@apache.org on 2023/11/11 19:47:03 UTC
(hbase) branch branch-2 updated: HBASE-27276 Addendum fix test dependency issue
This is an automated email from the ASF dual-hosted git repository.
bbeaudreault pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2 by this push:
new 2bb98236d83 HBASE-27276 Addendum fix test dependency issue
2bb98236d83 is described below
commit 2bb98236d833eeef2de987457b8723b467b21803
Author: Bryan Beaudreault <bb...@hubspot.com>
AuthorDate: Sat Nov 11 14:46:21 2023 -0500
HBASE-27276 Addendum fix test dependency issue
---
.../apache/hadoop/hbase/filter/TestComparatorSerialization.java | 7 ++-----
.../org/apache/hadoop/hbase/filter/TestFilterSerialization.java | 8 +++-----
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestComparatorSerialization.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestComparatorSerialization.java
index 6a26dd49d52..673f23ff884 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestComparatorSerialization.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestComparatorSerialization.java
@@ -24,10 +24,8 @@ import static org.junit.Assert.fail;
import java.io.IOException;
import java.math.BigDecimal;
import java.nio.charset.Charset;
-import java.util.Collections;
import java.util.regex.Pattern;
import org.apache.commons.io.IOUtils;
-import org.apache.commons.text.StringSubstitutor;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseCommonTestingUtility;
@@ -157,10 +155,9 @@ public class TestComparatorSerialization {
}
// Write a jar to be loaded into the classloader
- String code = StringSubstitutor.replace(
+ String code =
IOUtils.toString(getClass().getResourceAsStream("/CustomLoadedComparator.java.template"),
- Charset.defaultCharset()),
- Collections.singletonMap("suffix", suffix));
+ Charset.defaultCharset()).replaceAll("\\$\\{suffix\\}", suffix);
ClassLoaderTestHelper.buildJar(dataTestDir, className, code,
ClassLoaderTestHelper.localDirPath(conf));
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterSerialization.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterSerialization.java
index 30ff910b529..6b21320681b 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterSerialization.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestFilterSerialization.java
@@ -22,12 +22,10 @@ import static org.junit.Assert.fail;
import java.nio.charset.Charset;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.TreeSet;
import org.apache.commons.io.IOUtils;
-import org.apache.commons.text.StringSubstitutor;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.CompareOperator;
import org.apache.hadoop.hbase.DoNotRetryIOException;
@@ -399,9 +397,9 @@ public class TestFilterSerialization {
}
// Write a jar to be loaded into the classloader
- String code = StringSubstitutor
- .replace(IOUtils.toString(getClass().getResourceAsStream("/CustomLoadedFilter.java.template"),
- Charset.defaultCharset()), Collections.singletonMap("suffix", suffix));
+ String code =
+ IOUtils.toString(getClass().getResourceAsStream("/CustomLoadedFilter.java.template"),
+ Charset.defaultCharset()).replaceAll("\\$\\{suffix\\}", suffix);
ClassLoaderTestHelper.buildJar(dataTestDir, className, code,
ClassLoaderTestHelper.localDirPath(conf));