Search in sources :

Example 11 with SnappyCompressor

use of org.apache.geode.compression.SnappyCompressor in project geode by apache.

the class CompressionRegionConfigDUnitTest method testReplicatePersistentRegion.

/**
   * Sanity check for two peers sharing a persisted replicated region.
   * 
   * @throws Exception
   */
@Test
public void testReplicatePersistentRegion() throws Exception {
    Compressor compressor = new SnappyCompressor();
    assertTrue(createCompressedRegionOnVm(getVM(0), REGION_NAME, DataPolicy.PERSISTENT_REPLICATE, compressor, DISK_STORE));
    assertTrue(createCompressedRegionOnVm(getVM(1), REGION_NAME, DataPolicy.PERSISTENT_REPLICATE, compressor));
    assertNull(putUsingVM(getVM(0), KEY_1, VALUE_1));
    waitOnPut(getVM(1), KEY_1);
    flushDiskStoreOnVM(getVM(0), DISK_STORE);
    closeRegionOnVM(getVM(1), REGION_NAME);
    assertTrue(createCompressedRegionOnVm(getVM(1), REGION_NAME, DataPolicy.PERSISTENT_REPLICATE, compressor));
    assertEquals(VALUE_1, getUsingVM(getVM(1), KEY_1));
    cleanup(getVM(0));
}
Also used : SnappyCompressor(org.apache.geode.compression.SnappyCompressor) Compressor(org.apache.geode.compression.Compressor) SnappyCompressor(org.apache.geode.compression.SnappyCompressor) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Aggregations

SnappyCompressor (org.apache.geode.compression.SnappyCompressor)11 Test (org.junit.Test)9 Compressor (org.apache.geode.compression.Compressor)8 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)7 File (java.io.File)1 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)1