This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch 3.0-metadata-refactor
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.0-metadata-refactor by this
push:
new 5b7b7c4 fix ut
5b7b7c4 is described below
commit 5b7b7c4a81b568e3fec9ca3270ff14deaf11e88b
Author: ken.lj <[email protected]>
AuthorDate: Fri Dec 3 10:43:19 2021 +0800
fix ut
---
.../java/org/apache/dubbo/common/cache/FileCacheStore.java | 2 +-
.../registry/client/metadata/store/MetaCacheManagerTest.java | 11 +++++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git
a/dubbo-common/src/main/java/org/apache/dubbo/common/cache/FileCacheStore.java
b/dubbo-common/src/main/java/org/apache/dubbo/common/cache/FileCacheStore.java
index cbe42f0..bdf8467 100644
---
a/dubbo-common/src/main/java/org/apache/dubbo/common/cache/FileCacheStore.java
+++
b/dubbo-common/src/main/java/org/apache/dubbo/common/cache/FileCacheStore.java
@@ -177,7 +177,7 @@ public class FileCacheStore {
}
if (dirLock == null) {
- throw new PathNotExclusiveException(basePath.getAbsolutePath() + "
is not exclusive.");
+ throw new PathNotExclusiveException(basePath.getAbsolutePath() +
"/" + fileName + " is not exclusive.");
}
this.directoryLock = dirLock;
diff --git
a/dubbo-registry/dubbo-registry-api/src/test/java/org/apache/dubbo/registry/client/metadata/store/MetaCacheManagerTest.java
b/dubbo-registry/dubbo-registry-api/src/test/java/org/apache/dubbo/registry/client/metadata/store/MetaCacheManagerTest.java
index 60ecead..4dd0677 100644
---
a/dubbo-registry/dubbo-registry-api/src/test/java/org/apache/dubbo/registry/client/metadata/store/MetaCacheManagerTest.java
+++
b/dubbo-registry/dubbo-registry-api/src/test/java/org/apache/dubbo/registry/client/metadata/store/MetaCacheManagerTest.java
@@ -31,6 +31,7 @@ import java.util.Map;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.fail;
public class MetaCacheManagerTest {
@@ -84,8 +85,14 @@ public class MetaCacheManagerTest {
try {
cacheManager.put("3", metadataInfo3);
- MetaCacheManager.CacheRefreshTask task = new
MetaCacheManager.CacheRefreshTask(cacheManager.cacheStore, cacheManager.cache);
- task.run();
+ try {
+ MetaCacheManager.CacheRefreshTask task = new
MetaCacheManager.CacheRefreshTask(cacheManager.cacheStore, cacheManager.cache);
+ task.run();
+ } catch (Exception e) {
+ fail();
+ } finally {
+ cacheManager.destroy();
+ }
MetaCacheManager newCacheManager = null;
try {