incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject git commit: Changes to the test to ensure that if the tests inside the class are run out of order the tests will still pass.
Date Wed, 06 Aug 2014 11:57:12 GMT
Repository: incubator-blur
Updated Branches:
  refs/heads/master a872832b0 -> a09a8e2fc


Changes to the test to ensure that if the tests inside the class are run out of order the
tests will still pass.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/a09a8e2f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/a09a8e2f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/a09a8e2f

Branch: refs/heads/master
Commit: a09a8e2fce181d84430ce249eefe21439e7c17ae
Parents: a872832
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Wed Aug 6 07:57:15 2014 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Wed Aug 6 07:57:15 2014 -0400

----------------------------------------------------------------------
 .../org/apache/blur/console/util/QueryUtilTest.java   | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a09a8e2f/blur-console/src/test/java/org/apache/blur/console/util/QueryUtilTest.java
----------------------------------------------------------------------
diff --git a/blur-console/src/test/java/org/apache/blur/console/util/QueryUtilTest.java b/blur-console/src/test/java/org/apache/blur/console/util/QueryUtilTest.java
index 08e6957..72878b9 100644
--- a/blur-console/src/test/java/org/apache/blur/console/util/QueryUtilTest.java
+++ b/blur-console/src/test/java/org/apache/blur/console/util/QueryUtilTest.java
@@ -64,9 +64,9 @@ public class QueryUtilTest extends ConsoleTestBase {
         null,
         null, //new Selector(false, null, null, null, null, null, 0, 10, null),
         false, 0, 10, 1, 2000, UUID.randomUUID().toString(), "testUser", false, System.currentTimeMillis(),
null, null);
+    int currentCount = QueryUtil.getCurrentQueryCount();
     client.query("queryUnitTable", query);
-
-    assertEquals(1, QueryUtil.getCurrentQueryCount());
+    assertEquals(currentCount + 1, QueryUtil.getCurrentQueryCount());
   }
 
   @SuppressWarnings("unchecked")
@@ -78,12 +78,20 @@ public class QueryUtilTest extends ConsoleTestBase {
         null,
         null, //new Selector(false, null, null, null, null, null, 0, 10, null),
         false, 0, 10, 1, 2000, UUID.randomUUID().toString(), "testUser", false, System.currentTimeMillis(),
null, null);
+    int currentCount = 0;
+    {
+      Map<String, Object> queries = QueryUtil.getQueries();
+      Object o = queries.get("queries");
+      if (o != null) {
+        currentCount = ((List<Map<String, Object>>) o).size();
+      }
+    }
     client.query("queryUnitTable", query);
 
     Map<String, Object> queries = QueryUtil.getQueries();
 
     assertEquals(0, queries.get("slowQueries"));
-    assertEquals(2, ((List<Map<String, Object>>) queries.get("queries")).size());
+    assertEquals(currentCount + 1, ((List<Map<String, Object>>) queries.get("queries")).size());
     assertEquals("testUser", ((List<Map<String, Object>>) queries.get("queries")).get(0).get("user"));
   }
 }


Mime
View raw message