You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2020/11/14 10:04:12 UTC
[iotdb] branch fix_session_pool updated: add tset case
This is an automated email from the ASF dual-hosted git repository.
hxd pushed a commit to branch fix_session_pool
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/fix_session_pool by this push:
new 8ce9467 add tset case
8ce9467 is described below
commit 8ce9467638f345c682d43f7aea2011c88324616c
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Sat Nov 14 18:03:47 2020 +0800
add tset case
---
.../org/apache/iotdb/session/pool/SessionPoolTest.java | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java b/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java
index fbca8e4..c426e90 100644
--- a/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java
+++ b/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java
@@ -33,6 +33,7 @@ import org.apache.iotdb.rpc.IoTDBConnectionException;
import org.apache.iotdb.rpc.StatementExecutionException;
import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
import org.junit.After;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -240,8 +241,18 @@ public class SessionPoolTest {
@Test
public void testClose() {
SessionPool pool = new SessionPool("127.0.0.1", 6667, "root", "root", 3, 1, 60000, false, null);
- write10Data(pool, true);
-
+ pool.close();
+ try {
+ pool.insertRecord("root.sg1.d1", 1, Collections.singletonList("s1" ),
+ Collections.singletonList(TSDataType.INT64),
+ Collections.singletonList(1L));
+ } catch (IoTDBConnectionException e) {
+ Assert.assertEquals("Session pool is closed", e.getMessage());
+ } catch (StatementExecutionException e) {
+ fail();
+ }
+ //some other test cases are not covered:
+ //e.g., thread A created a new session, but not returned; thread B close the pool; A get the session.
}
}
\ No newline at end of file