geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [05/50] incubator-geode git commit: GEODE-10: Refactor HdfsStore api to match spec
Date Fri, 24 Jul 2015 23:15:28 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3772869d/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/functions/AlterHDFSStoreFunctionJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/functions/AlterHDFSStoreFunctionJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/functions/AlterHDFSStoreFunctionJUnitTest.java
index f66f54b..4a93e30 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/functions/AlterHDFSStoreFunctionJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/functions/AlterHDFSStoreFunctionJUnitTest.java
@@ -30,14 +30,13 @@ import com.gemstone.gemfire.cache.CacheClosedException;
 import com.gemstone.gemfire.cache.execute.FunctionContext;
 import com.gemstone.gemfire.cache.execute.ResultSender;
 import com.gemstone.gemfire.cache.hdfs.HDFSStore;
-import com.gemstone.gemfire.cache.hdfs.internal.HDFSEventQueueAttributesImpl;
 import com.gemstone.gemfire.cache.hdfs.internal.HDFSStoreConfigHolder;
-import com.gemstone.gemfire.cache.hdfs.internal.HDFSStoreConfigHolder.AbstractHDFSCompactionConfigHolder;
 import com.gemstone.gemfire.cache.hdfs.internal.HDFSStoreImpl;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.InternalCache;
 import com.gemstone.gemfire.internal.logging.LogService;
+import com.gemstone.gemfire.management.internal.cli.commands.HDFSStoreCommandsJUnitTest;
 import com.gemstone.gemfire.management.internal.cli.functions.AlterHDFSStoreFunction.AlterHDFSStoreAttributes;
 import com.gemstone.gemfire.management.internal.configuration.domain.XmlEntity;
 import com.gemstone.gemfire.test.junit.categories.HoplogTest;
@@ -92,8 +91,9 @@ public class AlterHDFSStoreFunctionJUnitTest {
 
     final AlterHDFSStoreFunction function = createAlterHDFSStoreFunction(mockCache, mockMember,
xmlEntity);
     final TestResultSender testResultSender = new TestResultSender();
-    final HDFSStoreImpl mockHdfsStore = createMockHDFSStoreImpl("hdfsStoreName", "hdfs://localhost:9000",
"testDir",
-        1024, 20, .25f, null, 20, 20, null, false, 0, 1024, false, false, true, 20, 20, 10,
100);
+    final HDFSStoreImpl mockHdfsStore = CreateHDFSStoreFunctionJUnitTest.createMockHDFSStoreImpl(mockContext,
+        "hdfsStoreName", "hdfs://localhost:9000", "testDir", 1024, 20, .25f, null, 20, 20,
null, false, 0, 1024, false,
+        false, true, 20, 20, 10, 100);
 	final AlterHDFSStoreAttributes alterHDFSStoreAttributes = new AlterHDFSStoreAttributes(
 				"mockStore", 100, 100, false, false, 100, 100, 100, 100, 100,
 				100);
@@ -254,144 +254,6 @@ public class AlterHDFSStoreFunctionJUnitTest {
 
   }
 
-  protected HDFSStoreImpl createMockHDFSStoreImpl(final String storeName, final String namenode,
final String homeDir,
-      final int maxFileSize, final int fileRolloverInterval, final float blockCachesize,
final String clientConfigFile,
-      final int batchSize, final int batchInterval, final String diskStoreName, final boolean
syncDiskwrite,
-      final int dispatcherThreads, final int maxMemory, final boolean bufferPersistent, final
boolean minorCompact,
-      final boolean majorCompact, final int majorCompactionInterval, final int majorCompactionThreads,
-      final int minorCompactionThreads, final int purgeInterval) {
-
-    HDFSStoreImpl mockHdfsStore = mockContext.mock(HDFSStoreImpl.class, "HDFSStoreImpl");
-
-    HDFSEventQueueAttributesImpl mockEventQueue = createMockEventQueue("hdfsStore_" + storeName,
batchSize,
-        batchInterval, diskStoreName, syncDiskwrite, dispatcherThreads, maxMemory, bufferPersistent);
-
-    AbstractHDFSCompactionConfigHolder mockCompactionConfig = createMockHDFSCompactionConfigHolder("hdfsStore_"
-        + storeName, minorCompact, majorCompact, majorCompactionInterval, majorCompactionThreads,
-        minorCompactionThreads, purgeInterval);
-
-    mockHdfsStore = (HDFSStoreImpl)createMockStore(mockHdfsStore, storeName, namenode, homeDir,
maxFileSize,
-        fileRolloverInterval, minorCompact, blockCachesize, clientConfigFile, mockCompactionConfig,
mockEventQueue);
-    return mockHdfsStore;
-  }
-
-  protected HDFSStoreConfigHolder createMockHDFSStoreConfigHolder(final String storeName,
final String namenode,
-      final String homeDir, final int maxFileSize, final int fileRolloverInterval, final
float blockCachesize,
-      final String clientConfigFile, final int batchSize, final int batchInterval, final
String diskStoreName,
-      final boolean syncDiskwrite, final int dispatcherThreads, final int maxMemory, final
boolean bufferPersistent,
-      final boolean minorCompact, final boolean majorCompact, final int majorCompactionInterval,
-      final int majorCompactionThreads, final int minorCompactionThreads, final int purgeInterval)
{
-
-    HDFSStoreConfigHolder mockHdfsStore = mockContext.mock(HDFSStoreConfigHolder.class, "HDFSStoreConfigHolder");
-    HDFSEventQueueAttributesImpl mockEventQueue = createMockEventQueue("hdfsStoreConfig_"
+ storeName, batchSize,
-        batchInterval, diskStoreName, syncDiskwrite, dispatcherThreads, maxMemory, bufferPersistent);
-
-    AbstractHDFSCompactionConfigHolder mockCompactionConfig = createMockHDFSCompactionConfigHolder("hdfsStoreConfig_"
-        + storeName, minorCompact, majorCompact, majorCompactionInterval, majorCompactionThreads,
-        minorCompactionThreads, purgeInterval);
-
-    mockHdfsStore = (HDFSStoreConfigHolder)createMockStore(mockHdfsStore, storeName, namenode,
homeDir, maxFileSize,
-        fileRolloverInterval, minorCompact, blockCachesize, clientConfigFile, mockCompactionConfig,
mockEventQueue);
-    return mockHdfsStore;
-
-  }
-
-  private HDFSEventQueueAttributesImpl createMockEventQueue(final String name, final int
batchSize,
-      final int batchInterval, final String diskStoreName, final boolean syncDiskwrite, final
int dispatcherThreads,
-      final int maxMemory, final boolean bufferPersistent) {
-
-    final HDFSEventQueueAttributesImpl mockEventQueue = mockContext.mock(HDFSEventQueueAttributesImpl.class,
name
-        + "EventQueueImpl");
-
-    mockContext.checking(new Expectations() {
-      {
-        allowing(mockEventQueue).getBatchSizeMB();
-        will(returnValue(batchSize));
-        allowing(mockEventQueue).getBatchTimeInterval();
-        will(returnValue(batchInterval));
-        allowing(mockEventQueue).getDiskStoreName();
-        will(returnValue(diskStoreName));
-        allowing(mockEventQueue).isDiskSynchronous();
-        will(returnValue(syncDiskwrite));
-        allowing(mockEventQueue).isPersistent();
-        will(returnValue(bufferPersistent));
-        allowing(mockEventQueue).getDispatcherThreads();
-        will(returnValue(dispatcherThreads));
-        allowing(mockEventQueue).getMaximumQueueMemory();
-        will(returnValue(maxMemory));
-      }
-    });
-
-    return mockEventQueue;
-  }
-
-  private AbstractHDFSCompactionConfigHolder createMockHDFSCompactionConfigHolder(final String
name,
-      final boolean minorCompact, final boolean majorCompact, final int majorCompactionInterval,
-      final int majorCompactionThreads, final int minorCompactionThreads, final int purgeInterval)
{
-
-    final AbstractHDFSCompactionConfigHolder mockCompactionConfig = mockContext.mock(
-        AbstractHDFSCompactionConfigHolder.class, name + "CompactionConfig");
-
-    mockContext.checking(new Expectations() {
-      {
-        allowing(mockCompactionConfig).getAutoMajorCompaction();
-        will(returnValue(majorCompact));
-        allowing(mockCompactionConfig).getMajorCompactionIntervalMins();
-        will(returnValue(majorCompactionInterval));
-        allowing(mockCompactionConfig).getMajorCompactionMaxThreads();
-        will(returnValue(majorCompactionThreads));
-        allowing(mockCompactionConfig).getMaxThreads();
-        will(returnValue(minorCompactionThreads));
-        allowing(mockCompactionConfig).getOldFilesCleanupIntervalMins();
-        will(returnValue(purgeInterval));
-        allowing(mockCompactionConfig).getMaxInputFileCount();
-        will(returnValue(10));
-        allowing(mockCompactionConfig).getMaxInputFileSizeMB();
-        will(returnValue(1024));
-        allowing(mockCompactionConfig).getMinInputFileCount();
-        will(returnValue(2));
-        allowing(mockCompactionConfig).getCompactionStrategy();
-        will(returnValue(null));
-      }
-    });
-
-    return mockCompactionConfig;
-  }
-
-  private HDFSStore createMockStore(final HDFSStore mockStore, final String storeName, final
String namenode,
-      final String homeDir, final int maxFileSize, final int fileRolloverInterval, final
boolean minorCompact, 
-      final float blockCachesize,final String clientConfigFile, 
-      final AbstractHDFSCompactionConfigHolder mockCompactionConfig,
-      final HDFSEventQueueAttributesImpl mockEventQueue) {
-
-    mockContext.checking(new Expectations() {
-      {
-        allowing(mockStore).getName();
-        will(returnValue(storeName));
-        allowing(mockStore).getNameNodeURL();
-        will(returnValue(namenode));
-        allowing(mockStore).getHomeDir();
-        will(returnValue(homeDir));
-        allowing(mockStore).getMaxFileSize();
-        will(returnValue(maxFileSize));
-        allowing(mockStore).getFileRolloverInterval();
-        will(returnValue(fileRolloverInterval));
-        allowing(mockStore).getMinorCompaction();
-        will(returnValue(minorCompact));
-        allowing(mockStore).getBlockCacheSize();
-        will(returnValue(blockCachesize));
-        allowing(mockStore).getHDFSClientConfigFile();
-        will(returnValue(clientConfigFile));
-        allowing(mockStore).getHDFSEventQueueAttributes();
-        will(returnValue(mockEventQueue));
-        allowing(mockStore).getHDFSCompactionConfig();
-        will(returnValue(mockCompactionConfig));
-      }
-    });
-    return mockStore;
-
-  }
-
   protected TestAlterHDFSStoreFunction createAlterHDFSStoreFunction(final Cache cache, DistributedMember
member,
       XmlEntity xml) {
     return new TestAlterHDFSStoreFunction(cache, member, xml);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3772869d/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/functions/CreateHDFSStoreFunctionJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/functions/CreateHDFSStoreFunctionJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/functions/CreateHDFSStoreFunctionJUnitTest.java
index a20297b..8a012b4 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/functions/CreateHDFSStoreFunctionJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/functions/CreateHDFSStoreFunctionJUnitTest.java
@@ -31,13 +31,12 @@ import com.gemstone.gemfire.cache.CacheClosedException;
 import com.gemstone.gemfire.cache.execute.FunctionContext;
 import com.gemstone.gemfire.cache.execute.ResultSender;
 import com.gemstone.gemfire.cache.hdfs.HDFSStore;
-import com.gemstone.gemfire.cache.hdfs.internal.HDFSEventQueueAttributesImpl;
 import com.gemstone.gemfire.cache.hdfs.internal.HDFSStoreConfigHolder;
-import com.gemstone.gemfire.cache.hdfs.internal.HDFSStoreConfigHolder.AbstractHDFSCompactionConfigHolder;
 import com.gemstone.gemfire.cache.hdfs.internal.HDFSStoreImpl;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.logging.LogService;
+import com.gemstone.gemfire.management.internal.cli.commands.HDFSStoreCommandsJUnitTest;
 import com.gemstone.gemfire.management.internal.configuration.domain.XmlEntity;
 import com.gemstone.gemfire.test.junit.categories.HoplogTest;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest
@@ -95,12 +94,12 @@ public class CreateHDFSStoreFunctionJUnitTest {
     
     final TestResultSender testResultSender = new TestResultSender();
     
-    final HDFSStoreImpl mockHdfsStore = createMockHDFSStoreImpl("hdfsStoreName", "hdfs://localhost:9000",
"testDir",
+    final HDFSStoreImpl mockHdfsStore = createMockHDFSStoreImpl(mockContext, "hdfsStoreName",
"hdfs://localhost:9000", "testDir",
         1024, 20, .25f, null, 20, 20, null, false, 0, 1024, false, false, true, 20, 20, 10,
100);
     
-    final HDFSStoreConfigHolder mockHdfsStoreConfigHolder = createMockHDFSStoreConfigHolder("hdfsStoreName",
-        "hdfs://localhost:9000", "testDir", 1024, 20, .25f, null, 40, 40, null, false, 0,
2048, true, true, true, 40,
-        40, 40, 800);
+    final HDFSStoreConfigHolder mockHdfsStoreConfigHolder = HDFSStoreCommandsJUnitTest.createMockHDFSStoreConfigHolder(
+        mockContext, "hdfsStoreName", "hdfs://localhost:9000", "testDir", 1024, 20, .25f,
null, 40, 40, null, false, 0,
+        2048, true, true, true, 40, 40, 40, 800);
     
     final CreateHDFSStoreFunction function = new TestCreateHDFSStoreFunction(mockCache, mockMember,
xmlEntity , mockHdfsStore);
 
@@ -144,10 +143,10 @@ public class CreateHDFSStoreFunctionJUnitTest {
     final String memberName = "mockMemberName";
     
     final TestResultSender testResultSender = new TestResultSender();
-    final HDFSStoreImpl mockHdfsStore = createMockHDFSStoreImpl("hdfsStoreName", "hdfs://localhost:9000",
"testDir",
+    final HDFSStoreImpl mockHdfsStore = createMockHDFSStoreImpl(mockContext, "hdfsStoreName",
"hdfs://localhost:9000", "testDir",
         1024, 20, .25f, null, 20, 20, null, false, 0, 1024, false, false, true, 20, 20, 10,
100);
     
-    final HDFSStoreConfigHolder mockHdfsStoreConfigHolder = createMockHDFSStoreConfigHolder("hdfsStoreName",
+    final HDFSStoreConfigHolder mockHdfsStoreConfigHolder = HDFSStoreCommandsJUnitTest.createMockHDFSStoreConfigHolder(mockContext,
"hdfsStoreName",
         "hdfs://localhost:9000", "testDir", 1024, 20, .25f, null, 40, 40, null, false, 0,
2048, true, true, true, 40,
         40, 40, 800);
     
@@ -189,12 +188,12 @@ public class CreateHDFSStoreFunctionJUnitTest {
     final String memberName = "mockMemberName";
     
     final TestResultSender testResultSender = new TestResultSender();
-    final HDFSStoreImpl mockHdfsStore = createMockHDFSStoreImpl("hdfsStoreName", "hdfs://localhost:9000",
"testDir",
+    final HDFSStoreImpl mockHdfsStore = createMockHDFSStoreImpl(mockContext, "hdfsStoreName",
"hdfs://localhost:9000", "testDir",
         1024, 20, .25f, null, 20, 20, null, false, 0, 1024, false, false, true, 20, 20, 10,
100);
     
-    final HDFSStoreConfigHolder mockHdfsStoreConfigHolder = createMockHDFSStoreConfigHolder("hdfsStoreName",
-        "hdfs://localhost:9000", "testDir", 1024, 20, .25f, null, 40, 40, null, false, 0,
2048, true, true, true, 40,
-        40, 40, 800);
+    final HDFSStoreConfigHolder mockHdfsStoreConfigHolder = HDFSStoreCommandsJUnitTest.createMockHDFSStoreConfigHolder(
+        mockContext, "hdfsStoreName", "hdfs://localhost:9000", "testDir", 1024, 20, .25f,
null, 40, 40, null, false, 0,
+        2048, true, true, true, 40, 40, 40, 800);
     
     final CreateHDFSStoreFunction function = new TestCreateHDFSStoreFunction(mockCache, mockMember,
xmlEntity , mockHdfsStore) {
       @Override
@@ -223,7 +222,7 @@ public class CreateHDFSStoreFunctionJUnitTest {
 
   }
 
-  protected HDFSStoreImpl createMockHDFSStoreImpl(final String storeName, final String namenode,
final String homeDir,
+  public static HDFSStoreImpl createMockHDFSStoreImpl(Mockery mockContext, final String storeName,
final String namenode, final String homeDir,
       final int maxFileSize, final int fileRolloverInterval, final float blockCachesize,
final String clientConfigFile,
       final int batchSize, final int batchInterval, final String diskStoreName, final boolean
syncDiskwrite,
       final int dispatcherThreads, final int maxMemory, final boolean bufferPersistent, final
boolean minorCompact,
@@ -232,135 +231,14 @@ public class CreateHDFSStoreFunctionJUnitTest {
 
     HDFSStoreImpl mockHdfsStore = mockContext.mock(HDFSStoreImpl.class, "HDFSStoreImpl");
 
-    HDFSEventQueueAttributesImpl mockEventQueue = createMockEventQueue("hdfsStore_" + storeName,
batchSize,
-        batchInterval, diskStoreName, syncDiskwrite, dispatcherThreads, maxMemory, bufferPersistent);
-
-    AbstractHDFSCompactionConfigHolder mockCompactionConfig = createMockHDFSCompactionConfigHolder("hdfsStore_"
-        + storeName, minorCompact, majorCompact, majorCompactionInterval, majorCompactionThreads,
-        minorCompactionThreads, purgeInterval);
-
-    mockHdfsStore = (HDFSStoreImpl)createMockStore(mockHdfsStore, storeName, namenode, homeDir,
maxFileSize,
-        fileRolloverInterval, minorCompact, blockCachesize, clientConfigFile, mockCompactionConfig,
mockEventQueue);
-    return mockHdfsStore;
-  }
-
-  protected HDFSStoreConfigHolder createMockHDFSStoreConfigHolder(final String storeName,
final String namenode,
-      final String homeDir, final int maxFileSize, final int fileRolloverInterval, final
float blockCachesize,
-      final String clientConfigFile, final int batchSize, final int batchInterval, final
String diskStoreName,
-      final boolean syncDiskwrite, final int dispatcherThreads, final int maxMemory, final
boolean bufferPersistent,
-      final boolean minorCompact, final boolean majorCompact, final int majorCompactionInterval,
-      final int majorCompactionThreads, final int minorCompactionThreads, final int purgeInterval)
{
-
-    HDFSStoreConfigHolder mockHdfsStore = mockContext.mock(HDFSStoreConfigHolder.class, "HDFSStoreConfigHolder");
-    HDFSEventQueueAttributesImpl mockEventQueue = createMockEventQueue("hdfsStoreConfig_"
+ storeName, batchSize,
-        batchInterval, diskStoreName, syncDiskwrite, dispatcherThreads, maxMemory, bufferPersistent);
-
-    AbstractHDFSCompactionConfigHolder mockCompactionConfig = createMockHDFSCompactionConfigHolder("hdfsStoreConfig_"
-        + storeName, minorCompact, majorCompact, majorCompactionInterval, majorCompactionThreads,
-        minorCompactionThreads, purgeInterval);
-
-    mockHdfsStore = (HDFSStoreConfigHolder)createMockStore(mockHdfsStore, storeName, namenode,
homeDir, maxFileSize,
-        fileRolloverInterval, minorCompact, blockCachesize, clientConfigFile, mockCompactionConfig,
mockEventQueue);
+    HDFSStoreCommandsJUnitTest.createMockStore(mockContext, mockHdfsStore, storeName, namenode,
homeDir, maxFileSize,
+        fileRolloverInterval, minorCompact, minorCompactionThreads, majorCompact, majorCompactionThreads,
+        majorCompactionInterval, purgeInterval, blockCachesize, clientConfigFile, batchSize,
batchInterval,
+        diskStoreName, syncDiskwrite, dispatcherThreads, maxMemory, bufferPersistent);
+    
     return mockHdfsStore;
-
   }
 
-  private HDFSEventQueueAttributesImpl createMockEventQueue(final String name, final int
batchSize,
-      final int batchInterval, final String diskStoreName, final boolean syncDiskwrite, final
int dispatcherThreads,
-      final int maxMemory, final boolean bufferPersistent) {
-
-    final HDFSEventQueueAttributesImpl mockEventQueue = mockContext.mock(HDFSEventQueueAttributesImpl.class,
name
-        + "EventQueueImpl");
-
-    mockContext.checking(new Expectations() {
-      {
-        allowing(mockEventQueue).getBatchSizeMB();
-        will(returnValue(batchSize));
-        allowing(mockEventQueue).getBatchTimeInterval();
-        will(returnValue(batchInterval));
-        allowing(mockEventQueue).getDiskStoreName();
-        will(returnValue(diskStoreName));
-        allowing(mockEventQueue).isDiskSynchronous();
-        will(returnValue(syncDiskwrite));
-        allowing(mockEventQueue).isPersistent();
-        will(returnValue(bufferPersistent));
-        allowing(mockEventQueue).getDispatcherThreads();
-        will(returnValue(dispatcherThreads));
-        allowing(mockEventQueue).getMaximumQueueMemory();
-        will(returnValue(maxMemory));
-      }
-    });
-
-    return mockEventQueue;
-  }
-
-  private AbstractHDFSCompactionConfigHolder createMockHDFSCompactionConfigHolder(final String
name,
-      final boolean minorCompact, final boolean majorCompact, final int majorCompactionInterval,
-      final int majorCompactionThreads, final int minorCompactionThreads, final int purgeInterval)
{
-
-    final AbstractHDFSCompactionConfigHolder mockCompactionConfig = mockContext.mock(
-        AbstractHDFSCompactionConfigHolder.class, name + "CompactionConfig");
-
-    mockContext.checking(new Expectations() {
-      {
-        allowing(mockCompactionConfig).getAutoMajorCompaction();
-        will(returnValue(majorCompact));
-        allowing(mockCompactionConfig).getMajorCompactionIntervalMins();
-        will(returnValue(majorCompactionInterval));
-        allowing(mockCompactionConfig).getMajorCompactionMaxThreads();
-        will(returnValue(majorCompactionThreads));
-        allowing(mockCompactionConfig).getMaxThreads();
-        will(returnValue(minorCompactionThreads));
-        allowing(mockCompactionConfig).getOldFilesCleanupIntervalMins();
-        will(returnValue(purgeInterval));
-        allowing(mockCompactionConfig).getMaxInputFileCount();
-        will(returnValue(10));
-        allowing(mockCompactionConfig).getMaxInputFileSizeMB();
-        will(returnValue(1024));
-        allowing(mockCompactionConfig).getMinInputFileCount();
-        will(returnValue(2));
-        allowing(mockCompactionConfig).getCompactionStrategy();
-        will(returnValue(null));
-      }
-    });
-
-    return mockCompactionConfig;
-  }
-
-  private HDFSStore createMockStore(final HDFSStore mockStore, final String storeName, final
String namenode,
-      final String homeDir, final int maxFileSize, final int fileRolloverInterval, final
boolean minorCompact, final float blockCachesize,
-      final String clientConfigFile, final AbstractHDFSCompactionConfigHolder mockCompactionConfig,
-      final HDFSEventQueueAttributesImpl mockEventQueue) {
-
-    mockContext.checking(new Expectations() {
-      {
-        allowing(mockStore).getName();
-        will(returnValue(storeName));
-        allowing(mockStore).getNameNodeURL();
-        will(returnValue(namenode));
-        allowing(mockStore).getHomeDir();
-        will(returnValue(homeDir));
-        allowing(mockStore).getMaxFileSize();
-        will(returnValue(maxFileSize));
-        allowing(mockStore).getFileRolloverInterval();
-        will(returnValue(fileRolloverInterval));
-        allowing(mockStore).getMinorCompaction();
-        will(returnValue(minorCompact));
-        allowing(mockStore).getBlockCacheSize();
-        will(returnValue(blockCachesize));
-        allowing(mockStore).getHDFSClientConfigFile();
-        will(returnValue(clientConfigFile));
-        allowing(mockStore).getHDFSEventQueueAttributes();
-        will(returnValue(mockEventQueue));
-        allowing(mockStore).getHDFSCompactionConfig();
-        will(returnValue(mockCompactionConfig));
-      }
-    });
-    return mockStore;
-
-  }
-
-
   protected static class TestCreateHDFSStoreFunction extends CreateHDFSStoreFunction {
     private static final long serialVersionUID = 1L;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3772869d/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/functions/DescribeHDFSStoreFunctionJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/functions/DescribeHDFSStoreFunctionJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/functions/DescribeHDFSStoreFunctionJUnitTest.java
index fe630fe..2d2378f 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/functions/DescribeHDFSStoreFunctionJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/management/internal/cli/functions/DescribeHDFSStoreFunctionJUnitTest.java
@@ -30,10 +30,7 @@ import org.junit.experimental.categories.Category;
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.execute.FunctionContext;
 import com.gemstone.gemfire.cache.execute.ResultSender;
-import com.gemstone.gemfire.cache.hdfs.HDFSEventQueueAttributes;
-import com.gemstone.gemfire.cache.hdfs.internal.HDFSEventQueueAttributesImpl;
 import com.gemstone.gemfire.cache.hdfs.internal.HDFSStoreConfigHolder;
-import com.gemstone.gemfire.cache.hdfs.internal.HDFSStoreConfigHolder.AbstractHDFSCompactionConfigHolder;
 import com.gemstone.gemfire.cache.hdfs.internal.HDFSStoreImpl;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
@@ -56,7 +53,7 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest
  * @see org.junit.Assert
  * @see org.junit.Test
  */
-@SuppressWarnings( { "null", "unused" })
+@SuppressWarnings( { "unused" })
 @Category({IntegrationTest.class, HoplogTest.class})
 public class DescribeHDFSStoreFunctionJUnitTest {
 
@@ -124,13 +121,24 @@ public class DescribeHDFSStoreFunctionJUnitTest {
     assertEquals(hdfsStoreName, hdfsStoreDetails.getName());
     assertEquals("hdfs://localhost:9000", hdfsStoreDetails.getNameNodeURL());
     assertEquals("testDir", hdfsStoreDetails.getHomeDir());
-    assertEquals(1024, hdfsStoreDetails.getMaxFileSize());
-    assertEquals(20, hdfsStoreDetails.getFileRolloverInterval());
+    assertEquals(1024, hdfsStoreDetails.getMaxWriteOnlyFileSize());
+    assertEquals(20, hdfsStoreDetails.getWriteOnlyFileRolloverInterval());
     assertFalse(hdfsStoreDetails.getMinorCompaction());
     assertEquals("0.25", Float.toString(hdfsStoreDetails.getBlockCacheSize()));
     assertNull(hdfsStoreDetails.getHDFSClientConfigFile());
-    assertCompactionConfig(hdfsStoreDetails.getHDFSCompactionConfig());
-    assertEventQueueAttributes(hdfsStoreDetails.getHDFSEventQueueAttributes());
+    assertTrue(hdfsStoreDetails.getMajorCompaction());
+    assertEquals(20, hdfsStoreDetails.getMajorCompactionInterval());
+    assertEquals(20, hdfsStoreDetails.getMajorCompactionThreads());
+    assertEquals(10, hdfsStoreDetails.getMinorCompactionThreads());
+    assertEquals(100, hdfsStoreDetails.getPurgeInterval());
+
+    assertEquals(20, hdfsStoreDetails.getBatchSize());
+    assertEquals(20, hdfsStoreDetails.getBatchInterval());
+    assertNull(hdfsStoreDetails.getDiskStoreName());
+    assertFalse(hdfsStoreDetails.getSynchronousDiskWrite());
+    assertEquals(0, hdfsStoreDetails.getDispatcherThreads());
+    assertEquals(1024, hdfsStoreDetails.getMaxMemory());
+    assertFalse(hdfsStoreDetails.getBufferPersistent());
   }
 
   
@@ -245,65 +253,49 @@ public class DescribeHDFSStoreFunctionJUnitTest {
       final boolean majorCompact, final int majorCompactionInterval, final int majorCompactionThreads,
       final int minorCompactionThreads, final int purgeInterval) {
 
-    final AbstractHDFSCompactionConfigHolder mockCompactionConfig = mockContext.mock(
-        AbstractHDFSCompactionConfigHolder.class, storeName + "CompactionConfig");
-    final HDFSEventQueueAttributesImpl mockEventQueue = mockContext.mock(HDFSEventQueueAttributesImpl.class,
storeName
-        + "EventQueueImpl");
     final HDFSStoreImpl mockHdfsStore = mockContext.mock(HDFSStoreImpl.class, storeName);
 
     mockContext.checking(new Expectations() {
       {
-        oneOf(mockCompactionConfig).getAutoMajorCompaction();
+        oneOf(mockHdfsStore).getMajorCompaction();
         will(returnValue(majorCompact));
-        oneOf(mockCompactionConfig).getMajorCompactionIntervalMins();
+        oneOf(mockHdfsStore).getMajorCompactionInterval();
         will(returnValue(majorCompactionInterval));
-        oneOf(mockCompactionConfig).getMajorCompactionMaxThreads();
+        oneOf(mockHdfsStore).getMajorCompactionThreads();
         will(returnValue(majorCompactionThreads));
-        oneOf(mockCompactionConfig).getMaxThreads();
+        oneOf(mockHdfsStore).getMinorCompactionThreads();
         will(returnValue(minorCompactionThreads));
-        oneOf(mockCompactionConfig).getOldFilesCleanupIntervalMins();
+        oneOf(mockHdfsStore).getPurgeInterval();
         will(returnValue(purgeInterval));
-        oneOf(mockCompactionConfig).getMaxInputFileCount();
+        oneOf(mockHdfsStore).getMaxInputFileCount();
         will(returnValue(10));
-        oneOf(mockCompactionConfig).getMaxInputFileSizeMB();
+        oneOf(mockHdfsStore).getMaxInputFileSizeMB();
         will(returnValue(1024));
-        oneOf(mockCompactionConfig).getMinInputFileCount();
+        oneOf(mockHdfsStore).getMinInputFileCount();
         will(returnValue(2));
-        oneOf(mockCompactionConfig).getCompactionStrategy();
-        will(returnValue(null));
-      }
-    });
-
-    mockContext.checking(new Expectations() {
-      {
-        oneOf(mockEventQueue).getBatchSizeMB();
+        oneOf(mockHdfsStore).getBatchSize();
         will(returnValue(batchSize));
-        oneOf(mockEventQueue).getBatchTimeInterval();
+        oneOf(mockHdfsStore).getBatchInterval();
         will(returnValue(batchInterval));
-        oneOf(mockEventQueue).getDiskStoreName();
+        oneOf(mockHdfsStore).getDiskStoreName();
         will(returnValue(diskStoreName));
-        oneOf(mockEventQueue).isDiskSynchronous();
+        oneOf(mockHdfsStore).getSynchronousDiskWrite();
         will(returnValue(syncDiskwrite));
-        oneOf(mockEventQueue).isPersistent();
+        oneOf(mockHdfsStore).getBufferPersistent();
         will(returnValue(bufferPersistent));
-        oneOf(mockEventQueue).getDispatcherThreads();
+        oneOf(mockHdfsStore).getDispatcherThreads();
         will(returnValue(dispatcherThreads));
-        oneOf(mockEventQueue).getMaximumQueueMemory();
+        oneOf(mockHdfsStore).getMaxMemory();
         will(returnValue(maxMemory));
-      }
-    });
-
-    mockContext.checking(new Expectations() {
-      {
         oneOf(mockHdfsStore).getName();
         will(returnValue(storeName));
         oneOf(mockHdfsStore).getNameNodeURL();
         will(returnValue(namenode));
         oneOf(mockHdfsStore).getHomeDir();
         will(returnValue(homeDir));
-        oneOf(mockHdfsStore).getMaxFileSize();
+        oneOf(mockHdfsStore).getMaxWriteOnlyFileSize();
         will(returnValue(maxFileSize));
-        oneOf(mockHdfsStore).getFileRolloverInterval();
+        oneOf(mockHdfsStore).getWriteOnlyFileRolloverInterval();
         will(returnValue(fileRolloverInterval));
         oneOf(mockHdfsStore).getMinorCompaction();
         will(returnValue(minorCompact));
@@ -311,10 +303,6 @@ public class DescribeHDFSStoreFunctionJUnitTest {
         will(returnValue(blockCachesize));
         allowing(mockHdfsStore).getHDFSClientConfigFile();
         will(returnValue(clientConfigFile));
-        oneOf(mockHdfsStore).getHDFSEventQueueAttributes();
-        will(returnValue(mockEventQueue));
-        oneOf(mockHdfsStore).getHDFSCompactionConfig();
-        will(returnValue(mockCompactionConfig));
       }
     });
     return mockHdfsStore;
@@ -324,26 +312,6 @@ public class DescribeHDFSStoreFunctionJUnitTest {
     return new TestDescribeHDFSStoreFunction(cache, member);
   }
 
-  private void assertCompactionConfig(AbstractHDFSCompactionConfigHolder compactionConfig)
{
-    assertNotNull(compactionConfig);
-    assertTrue(compactionConfig.getAutoMajorCompaction());
-    assertEquals(20, compactionConfig.getMajorCompactionIntervalMins());
-    assertEquals(20, compactionConfig.getMajorCompactionMaxThreads());
-    assertEquals(10, compactionConfig.getMaxThreads());
-    assertEquals(100, compactionConfig.getOldFilesCleanupIntervalMins());
-  }
-
-  private void assertEventQueueAttributes(HDFSEventQueueAttributes eventQueueAttr) {
-    assertNotNull(eventQueueAttr);
-    assertEquals(20, eventQueueAttr.getBatchSizeMB());
-    assertEquals(20, eventQueueAttr.getBatchTimeInterval());
-    assertNull(eventQueueAttr.getDiskStoreName());
-    assertFalse(eventQueueAttr.isDiskSynchronous());
-    assertEquals(0, eventQueueAttr.getDispatcherThreads());
-    assertEquals(1024, eventQueueAttr.getMaximumQueueMemory());
-    assertFalse(eventQueueAttr.isPersistent());
-  }
-
   protected static class TestDescribeHDFSStoreFunction extends DescribeHDFSStoreFunction
{
     private static final long serialVersionUID = 1L;
 


Mime
View raw message