geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ListAndDescribeRegionDUnitTest.java
@Category(FlakyTest.class) // GEODE-1033: HeadlesssGFSH, random port, Snappy dependency
  @Test
  public void describeRegionWithCompressionCodec() throws Exception {
    final String regionName = "compressedRegion";
    VM vm = Host.getHost(0).getVM(1);

    // Create compressed region
    vm.invoke(() -> {
      createCompressedRegion(regionName);
    });

    // Test the describe command; look for compression
    CommandStringBuilder csb = new CommandStringBuilder(DESCRIBE_REGION);
    csb.addOption(DESCRIBE_REGION__NAME, regionName);
    String commandString = csb.toString();
    CommandResult commandResult = gfshShellConnectionRule.executeAndVerifyCommand(commandString);
    String commandResultString = commandResultToString(commandResult);
    assertThat(commandResultString).contains(regionName);
    assertThat(commandResultString).contains(RegionAttributesNames.COMPRESSOR);
    assertThat(commandResultString).contains(RegionEntryContext.DEFAULT_COMPRESSION_PROVIDER);

    // Destroy compressed region
    vm.invoke(() -> {
      final Region region = CacheFactory.getAnyInstance().getRegion(regionName);
      assertThat(region).isNotNull();
      region.destroyRegion();
    });
  }
/**
   * Asserts that a describe region command issued on a region with compression returns the correct
   * non default region attribute for compression and the correct codec value.
   */
Asserts that a describe region command issued on a region with compression returns the correct
non default region attribute for compression and the correct codec value.
Asserts that a describe region command issued on a region with compression returns the correct non default region attribute for compression and the correct codec value .
@Category(FlakyTest.class) 
  @Test
  public void describeRegionWithCompressionCodec() throws Exception {
    final String regionName = "compressedRegion";
    VM vm = Host.getHost(0).getVM(1);
    vm.invoke(() -> {
      createCompressedRegion(regionName);
    });
    CommandStringBuilder csb = new CommandStringBuilder(DESCRIBE_REGION);
    csb.addOption(DESCRIBE_REGION__NAME, regionName);
    String commandString = csb.toString();
    CommandResult commandResult = gfshShellConnectionRule.executeAndVerifyCommand(commandString);
    String commandResultString = commandResultToString(commandResult);
    assertThat(commandResultString).contains(regionName);
    assertThat(commandResultString).contains(RegionAttributesNames.COMPRESSOR);
    assertThat(commandResultString).contains(RegionEntryContext.DEFAULT_COMPRESSION_PROVIDER);
    vm.invoke(() -> {
      final Region region = CacheFactory.getAnyInstance().getRegion(regionName);
      assertThat(region).isNotNull();
      region.destroyRegion();
    });
  }
@ Category ( FlakyTest . class ) @ Test public void describeRegionWithCompressionCodec ( ) throws Exception { final String regionName = "compressedRegion" ; VM vm = Host . getHost ( 0 ) . getVM ( 1 ) ; vm . invoke ( ( ) -> { createCompressedRegion ( regionName ) ; } ) ; CommandStringBuilder csb = new CommandStringBuilder ( DESCRIBE_REGION ) ; csb . addOption ( DESCRIBE_REGION__NAME , regionName ) ; String commandString = csb . toString ( ) ; CommandResult commandResult = gfshShellConnectionRule . executeAndVerifyCommand ( commandString ) ; String commandResultString = commandResultToString ( commandResult ) ; assertThat ( commandResultString ) . contains ( regionName ) ; assertThat ( commandResultString ) . contains ( RegionAttributesNames . COMPRESSOR ) ; assertThat ( commandResultString ) . contains ( RegionEntryContext . DEFAULT_COMPRESSION_PROVIDER ) ; vm . invoke ( ( ) -> { final Region region = CacheFactory . getAnyInstance ( ) . getRegion ( regionName ) ; assertThat ( region ) . isNotNull ( ) ; region . destroyRegion ( ) ; } ) ; }
Asserts that a describe region command issued on a region with compression returns the correct
 non default region attribute for compression and the correct codec value.
Asserts that a describe region command issued on a region with compression returns the correct non default region attribute for compression and the correct codec value .
// GEODE-1033: HeadlesssGFSH, random port, Snappy dependency // Create compressed region // Test the describe command; look for compression // Destroy compressed region