accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [41/50] [abbrv] git commit: ACCUMULO-1537 close batch scanners in tests
Date Wed, 17 Jul 2013 02:33:43 GMT
ACCUMULO-1537 close batch scanners in tests

git-svn-id: https://svn.apache.org/repos/asf/accumulo/trunk@1502639 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/6c4bfc71
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/6c4bfc71
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/6c4bfc71

Branch: refs/heads/ACCUMULO-1496
Commit: 6c4bfc716dba6631cc6be623bf46dba7c7542420
Parents: 37d2fdb
Author: Eric C. Newton <ecn@apache.org>
Authored: Fri Jul 12 17:56:31 2013 +0000
Committer: Eric C. Newton <ecn@apache.org>
Committed: Fri Jul 12 17:56:31 2013 +0000

----------------------------------------------------------------------
 .../java/org/apache/accumulo/test/functional/ExamplesIT.java    | 5 ++++-
 .../org/apache/accumulo/test/functional/ServerSideErrorIT.java  | 4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/6c4bfc71/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java
index 48300fb..6c846b4 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java
@@ -26,6 +26,7 @@ import java.util.List;
 import java.util.Map.Entry;
 
 import org.apache.accumulo.core.cli.BatchWriterOpts;
+import org.apache.accumulo.core.client.BatchScanner;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.Connector;
@@ -157,7 +158,9 @@ public class ExamplesIT extends MacTest {
     bw = c.createBatchWriter("shard", bwc);
     Index.index(30, new File(System.getProperty("user.dir") + "/src"), "\\W+", bw);
     bw.close();
-    List<String> found = Query.query(c.createBatchScanner("shard", Authorizations.EMPTY,
4), Arrays.asList("foo", "bar"));
+    BatchScanner bs = c.createBatchScanner("shard", Authorizations.EMPTY, 4);
+    List<String> found = Query.query(bs, Arrays.asList("foo", "bar"));
+    bs.close();
     // should find ourselves
     boolean thisFile = false;
     for (String file : found) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/6c4bfc71/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
b/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
index cb4e2d7..0293ae8 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
@@ -79,10 +79,12 @@ public class ServerSideErrorIT extends MacTest {
       for (Entry<Key,Value> entry : bs) {
         entry.getKey();
       }
-      bs.close();
     } catch (Exception e) {
       caught = true;
+    } finally {
+      bs.close();
     }
+    
     if (!caught)
       throw new Exception("batch scan did not fail");
     


Mime
View raw message