Repository: accumulo Updated Branches: refs/heads/1.6.1-SNAPSHOT 0277521da -> 07bacc346 refs/heads/master 19de9683c -> a63ded99d
ACCUMULO-2560 Fix broken unit test Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/07bacc34 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/07bacc34 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/07bacc34 Branch: refs/heads/1.6.1-SNAPSHOT Commit: 07bacc346b798b1607ec4c83f9dc37a8c55e6e3e Parents: 0277521 Author: Josh Elser <els...@apache.org> Authored: Sun Aug 10 15:25:14 2014 -0400 Committer: Josh Elser <els...@apache.org> Committed: Sun Aug 10 15:25:14 2014 -0400 ---------------------------------------------------------------------- .../accumulo/gc/SimpleGarbageCollectorTest.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/07bacc34/server/gc/src/test/java/org/apache/accumulo/gc/SimpleGarbageCollectorTest.java ---------------------------------------------------------------------- diff --git a/server/gc/src/test/java/org/apache/accumulo/gc/SimpleGarbageCollectorTest.java b/server/gc/src/test/java/org/apache/accumulo/gc/SimpleGarbageCollectorTest.java index baa98b7..d4319b8 100644 --- a/server/gc/src/test/java/org/apache/accumulo/gc/SimpleGarbageCollectorTest.java +++ b/server/gc/src/test/java/org/apache/accumulo/gc/SimpleGarbageCollectorTest.java @@ -17,18 +17,23 @@ package org.apache.accumulo.gc; import java.io.FileNotFoundException; + import org.apache.accumulo.core.client.Instance; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.core.security.Credentials; import org.apache.accumulo.core.security.thrift.TCredentials; import org.apache.accumulo.gc.SimpleGarbageCollector.Opts; + import static org.apache.accumulo.gc.SimpleGarbageCollector.CANDIDATE_MEMORY_PERCENTAGE; + import org.apache.accumulo.server.fs.VolumeManager; import org.apache.accumulo.trace.thrift.TInfo; import org.apache.hadoop.fs.Path; +import org.easymock.EasyMock; import org.junit.Before; import org.junit.Test; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -69,15 +74,20 @@ public class SimpleGarbageCollectorTest { AccumuloConfiguration systemConfig = createMock(AccumuloConfiguration.class); expect(systemConfig.getTimeInMillis(Property.GC_CYCLE_START)).andReturn(1000L); expect(systemConfig.getTimeInMillis(Property.GC_CYCLE_DELAY)).andReturn(20000L); - expect(systemConfig.getCount(Property.GC_DELETE_THREADS)).andReturn(2); - expect(systemConfig.getCount(Property.GC_DELETE_THREADS)).andReturn(2); + expect(systemConfig.getCount(Property.GC_DELETE_THREADS)).andReturn(2).times(2); expect(systemConfig.getBoolean(Property.GC_TRASH_IGNORE)).andReturn(false); replay(systemConfig); return systemConfig; } - //@Test + @Test public void testInit() throws Exception { + EasyMock.reset(systemConfig); + expect(systemConfig.getTimeInMillis(Property.GC_CYCLE_START)).andReturn(1000L).times(2); + expect(systemConfig.getTimeInMillis(Property.GC_CYCLE_DELAY)).andReturn(20000L); + expect(systemConfig.getCount(Property.GC_DELETE_THREADS)).andReturn(2).times(2); + expect(systemConfig.getBoolean(Property.GC_TRASH_IGNORE)).andReturn(false); + replay(systemConfig); gc.init(volMgr, instance, credentials, systemConfig); assertSame(volMgr, gc.getVolumeManager()); assertSame(instance, gc.getInstance());