You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2020/11/13 07:56:27 UTC

[iotdb] branch jira-990 updated: fix tests

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

haonan pushed a commit to branch jira-990
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/jira-990 by this push:
     new d2deba9  fix tests
d2deba9 is described below

commit d2deba9de91d3580b88dbfef62e8de0a0f5d3c3e
Author: HTHou <hh...@outlook.com>
AuthorDate: Fri Nov 13 15:55:56 2020 +0800

    fix tests
---
 .../java/org/apache/iotdb/cli/AbstractCliIT.java   | 24 ++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/cli/src/test/java/org/apache/iotdb/cli/AbstractCliIT.java b/cli/src/test/java/org/apache/iotdb/cli/AbstractCliIT.java
index d62a419..bc12782 100644
--- a/cli/src/test/java/org/apache/iotdb/cli/AbstractCliIT.java
+++ b/cli/src/test/java/org/apache/iotdb/cli/AbstractCliIT.java
@@ -210,11 +210,23 @@ public class AbstractCliIT {
   private void testSetMaxDisplayNumber() {
     AbstractCli.setMaxDisplayNumber("10");
     assertEquals(10, AbstractCli.maxPrintRowCount);
-    AbstractCli.setMaxDisplayNumber("111111111111111");
-    assertEquals(Integer.MAX_VALUE, AbstractCli.maxPrintRowCount);
-    AbstractCli.setMaxDisplayNumber("-10");
-    assertEquals(Integer.MAX_VALUE, AbstractCli.maxPrintRowCount);
-    AbstractCli.setMaxDisplayNumber("0");
-    assertEquals(Integer.MAX_VALUE, AbstractCli.maxPrintRowCount);
+    try {
+      AbstractCli.setMaxDisplayNumber("111111111111111");
+      fail();
+    } catch (Exception e) {
+      assertEquals(new NumberFormatException(), e);
+    }
+    try {
+      AbstractCli.setMaxDisplayNumber("-10");
+      fail();
+    } catch (Exception e) {
+      assertEquals(new NumberFormatException(), e);
+    }
+    try {
+      AbstractCli.setMaxDisplayNumber("0");
+      fail();
+    } catch (Exception e) {
+      assertEquals(new NumberFormatException(), e);
+    }
   }
 }