accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [accumulo] branch 1.8 updated: ACCUMULO-4775 Improved mocking in SetIterCommandTest
Date Wed, 17 Jan 2018 21:44:02 GMT
This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch 1.8
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/1.8 by this push:
     new 6782ba6  ACCUMULO-4775 Improved mocking in SetIterCommandTest
6782ba6 is described below

commit 6782ba6b9d43dc9a10df4bbadf3a89eaadb0cf6a
Author: Christopher Tubbs <ctubbsii@apache.org>
AuthorDate: Wed Jan 17 15:50:08 2018 -0500

    ACCUMULO-4775 Improved mocking in SetIterCommandTest
    
    Improve mock checking for specific parameters passed to
    tableOperations.attachIterator() during the test. This more rigorously
    validates our expectations for these parameters, and (bonus) fixes a
    warning about generics which cannot be avoided with
    EasyMock.anyObject(EnumSet.class).
---
 .../java/org/apache/accumulo/shell/commands/SetIterCommandTest.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/shell/src/test/java/org/apache/accumulo/shell/commands/SetIterCommandTest.java
b/shell/src/test/java/org/apache/accumulo/shell/commands/SetIterCommandTest.java
index 70c798f..8eb4514 100644
--- a/shell/src/test/java/org/apache/accumulo/shell/commands/SetIterCommandTest.java
+++ b/shell/src/test/java/org/apache/accumulo/shell/commands/SetIterCommandTest.java
@@ -24,6 +24,7 @@ import java.util.EnumSet;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.client.admin.TableOperations;
+import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.shell.Shell;
 import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader;
@@ -108,7 +109,7 @@ public class SetIterCommandTest {
     // Attach iterator
     EasyMock.expect(shellState.getConnector()).andReturn(conn);
     EasyMock.expect(conn.tableOperations()).andReturn(tableOperations);
-    tableOperations.attachIterator(EasyMock.anyString(), EasyMock.anyObject(IteratorSetting.class),
EasyMock.anyObject(EnumSet.class));
+    tableOperations.attachIterator(EasyMock.eq("foo"), EasyMock.anyObject(IteratorSetting.class),
EasyMock.eq(EnumSet.allOf(IteratorScope.class)));
     EasyMock.expectLastCall().once();
 
     EasyMock.replay(conn, cli, shellState, reader, tableOperations);

-- 
To stop receiving notification emails like this one, please contact
['"commits@accumulo.apache.org" <commits@accumulo.apache.org>'].

Mime
View raw message