Search in sources :

Example 1 with ParallelGatewaySenderQueueMetaRegion

use of org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderQueue.ParallelGatewaySenderQueueMetaRegion in project geode by apache.

the class ParallelGatewaySenderQueueJUnitTest method testLocalSize.

@Test
public void testLocalSize() throws Exception {
    ParallelGatewaySenderQueueMetaRegion mockMetaRegion = mock(ParallelGatewaySenderQueueMetaRegion.class);
    PartitionedRegionDataStore dataStore = mock(PartitionedRegionDataStore.class);
    when(mockMetaRegion.getDataStore()).thenReturn(dataStore);
    when(dataStore.getSizeOfLocalPrimaryBuckets()).thenReturn(3);
    when(metaRegionFactory.newMetataRegion(any(), any(), any(), any())).thenReturn(mockMetaRegion);
    when(cache.createVMRegion(any(), any(), any())).thenReturn(mockMetaRegion);
    queue.addShadowPartitionedRegionForUserPR(mockPR("region1"));
    assertEquals(3, queue.localSize());
}
Also used : PartitionedRegionDataStore(org.apache.geode.internal.cache.PartitionedRegionDataStore) ParallelGatewaySenderQueueMetaRegion(org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderQueue.ParallelGatewaySenderQueueMetaRegion) UnitTest(org.apache.geode.test.junit.categories.UnitTest) Test(org.junit.Test)

Aggregations

PartitionedRegionDataStore (org.apache.geode.internal.cache.PartitionedRegionDataStore)1 ParallelGatewaySenderQueueMetaRegion (org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderQueue.ParallelGatewaySenderQueueMetaRegion)1 UnitTest (org.apache.geode.test.junit.categories.UnitTest)1 Test (org.junit.Test)1