You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by il...@apache.org on 2018/05/15 05:33:54 UTC

[incubator-dubbo] branch master updated: unit test for SimpleDataStore (#1797)

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

iluo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git


The following commit(s) were added to refs/heads/master by this push:
     new f78f6d4  unit test for SimpleDataStore (#1797)
f78f6d4 is described below

commit f78f6d4fa2e600ec212371d5afdf4124fbfd46f0
Author: Ian Luo <ia...@gmail.com>
AuthorDate: Tue May 15 13:33:52 2018 +0800

    unit test for SimpleDataStore (#1797)
---
 .../common/store/support/SimpleDataStoreTest.java     | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/dubbo-common/src/test/java/com/alibaba/dubbo/common/store/support/SimpleDataStoreTest.java b/dubbo-common/src/test/java/com/alibaba/dubbo/common/store/support/SimpleDataStoreTest.java
index 42de80d..0b81a9a 100644
--- a/dubbo-common/src/test/java/com/alibaba/dubbo/common/store/support/SimpleDataStoreTest.java
+++ b/dubbo-common/src/test/java/com/alibaba/dubbo/common/store/support/SimpleDataStoreTest.java
@@ -18,14 +18,18 @@ package com.alibaba.dubbo.common.store.support;
 
 import org.junit.Test;
 
+import java.util.Map;
+
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 public class SimpleDataStoreTest {
-    SimpleDataStore dataStore = new SimpleDataStore();
+    private SimpleDataStore dataStore = new SimpleDataStore();
 
     @Test
-    public void testPut_Get() throws Exception {
+    public void testPutGet() throws Exception {
         assertNull(dataStore.get("xxx", "yyy"));
 
         dataStore.put("name", "key", "1");
@@ -42,4 +46,15 @@ public class SimpleDataStoreTest {
         dataStore.remove("name", "key");
         assertNull(dataStore.get("name", "key"));
     }
+
+    @Test
+    public void testGetComponent() throws Exception {
+        Map<String, Object> map = dataStore.get("component");
+        assertTrue(map != null && map.isEmpty());
+        dataStore.put("component", "key", "value");
+        map = dataStore.get("component");
+        assertTrue(map != null && map.size() == 1);
+        dataStore.remove("component", "key");
+        assertNotEquals(map, dataStore.get("component"));
+    }
 }

-- 
To stop receiving notification emails like this one, please contact
iluo@apache.org.