Skip to content

Commit 35e62d5

Browse files
committed
AJ-524: add test case about upload BasicDictionary
1 parent f54dc1f commit 35e62d5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/com/xxdb/DBConnectionTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.xxdb;
22

33
import com.alibaba.fastjson2.JSONObject;
4+
import com.xxdb.data.Dictionary;
45
import com.xxdb.data.Vector;
56
import com.xxdb.data.*;
67
import com.xxdb.io.Double2;
@@ -1410,6 +1411,24 @@ public void testDictionaryUpload() throws IOException {
14101411
assertEquals(3, dict1.rows());
14111412
}
14121413
@Test
1414+
public void testDictionaryUpload_1() throws IOException {
1415+
DBConnection conn = new DBConnection();
1416+
conn.connect(HOST,PORT);
1417+
BasicDictionary bd = new BasicDictionary(Entity.DATA_TYPE.DT_INT, Entity.DATA_TYPE.DT_ANY);
1418+
Map<String,Entity> data = new HashMap<>();
1419+
data.put("bd",bd);
1420+
conn.upload(data);
1421+
Dictionary re= (Dictionary) conn.run("bd");
1422+
System.out.println(re.getString());
1423+
assertEquals("", re.getString());
1424+
bd.put(new BasicInt(1),new BasicInt(1));
1425+
data.put("bd",bd);
1426+
conn.upload(data);
1427+
Dictionary re1= (Dictionary) conn.run("bd");
1428+
System.out.println(re1.getString());
1429+
assertEquals("1->1\n", re1.getString());
1430+
}
1431+
@Test
14131432
public void testDurationUpload() throws IOException {
14141433
Entity duration = conn.run("duration(3XNYS)");
14151434
Map<String, Entity> map = new HashMap<String, Entity>();

0 commit comments

Comments
 (0)