You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2013/07/12 19:56:31 UTC

svn commit: r1502639 - in /accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional: ExamplesIT.java ServerSideErrorIT.java

Author: ecn
Date: Fri Jul 12 17:56:31 2013
New Revision: 1502639

URL: http://svn.apache.org/r1502639
Log:
ACCUMULO-1537 close batch scanners in tests

Modified:
    accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java
    accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java

Modified: accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java?rev=1502639&r1=1502638&r2=1502639&view=diff
==============================================================================
--- accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java (original)
+++ accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java Fri Jul 12 17:56:31 2013
@@ -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) {

Modified: accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java?rev=1502639&r1=1502638&r2=1502639&view=diff
==============================================================================
--- accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java (original)
+++ accumulo/trunk/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java Fri Jul 12 17:56:31 2013
@@ -79,10 +79,12 @@ public class ServerSideErrorIT extends M
       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");