geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateRegionCommandDUnitTest.java
@Test
  public void testCreateRegionWithGoodCompressor() {
    setUpJmxManagerOnVm0ThenConnect(null);
    VM vm = Host.getHost(0).getVM(1);

    // Create a cache in vm 1
    vm.invoke(() -> assertNotNull(getCache()));

    // Run create region command with compression
    CommandStringBuilder commandStringBuilder = new CommandStringBuilder(CliStrings.CREATE_REGION);
    commandStringBuilder.addOption(CliStrings.CREATE_REGION__REGION, "compressedRegion");
    commandStringBuilder.addOption(CliStrings.CREATE_REGION__REGIONSHORTCUT, "REPLICATE");
    commandStringBuilder.addOption(CliStrings.CREATE_REGION__COMPRESSOR,
        RegionEntryContext.DEFAULT_COMPRESSION_PROVIDER);
    CommandResult cmdResult = executeCommand(commandStringBuilder.toString());
    assertEquals(Result.Status.OK, cmdResult.getStatus());

    // Make sure our region exists with compression enabled
    vm.invoke(() -> {
      Region region = getCache().getRegion("compressedRegion");
      assertNotNull(region);
      assertTrue(
          SnappyCompressor.getDefaultInstance().equals(region.getAttributes().getCompressor()));
    });

    // cleanup
    commandStringBuilder = new CommandStringBuilder(CliStrings.DESTROY_REGION);
    commandStringBuilder.addOption(CliStrings.DESTROY_REGION__REGION, "compressedRegion");
    cmdResult = executeCommand(commandStringBuilder.toString());
    assertEquals(Result.Status.OK, cmdResult.getStatus());
  }
/**
   * Asserts that the "compressor" option for the "create region" command succeeds for a recognized
   * compressor.
   */
Asserts that the "compressor" option for the "create region" command succeeds for a recognized
compressor.
Asserts that the " compressor " option for the " create region " command succeeds for a recognized compressor .
@Test
  public void testCreateRegionWithGoodCompressor() {
    setUpJmxManagerOnVm0ThenConnect(null);
    VM vm = Host.getHost(0).getVM(1);
    vm.invoke(() -> assertNotNull(getCache()));
    CommandStringBuilder commandStringBuilder = new CommandStringBuilder(CliStrings.CREATE_REGION);
    commandStringBuilder.addOption(CliStrings.CREATE_REGION__REGION, "compressedRegion");
    commandStringBuilder.addOption(CliStrings.CREATE_REGION__REGIONSHORTCUT, "REPLICATE");
    commandStringBuilder.addOption(CliStrings.CREATE_REGION__COMPRESSOR,
        RegionEntryContext.DEFAULT_COMPRESSION_PROVIDER);
    CommandResult cmdResult = executeCommand(commandStringBuilder.toString());
    assertEquals(Result.Status.OK, cmdResult.getStatus());
    vm.invoke(() -> {
      Region region = getCache().getRegion("compressedRegion");
      assertNotNull(region);
      assertTrue(
          SnappyCompressor.getDefaultInstance().equals(region.getAttributes().getCompressor()));
    });
    commandStringBuilder = new CommandStringBuilder(CliStrings.DESTROY_REGION);
    commandStringBuilder.addOption(CliStrings.DESTROY_REGION__REGION, "compressedRegion");
    cmdResult = executeCommand(commandStringBuilder.toString());
    assertEquals(Result.Status.OK, cmdResult.getStatus());
  }
@ Test public void testCreateRegionWithGoodCompressor ( ) { setUpJmxManagerOnVm0ThenConnect ( null ) ; VM vm = Host . getHost ( 0 ) . getVM ( 1 ) ; vm . invoke ( ( ) -> assertNotNull ( getCache ( ) ) ) ; CommandStringBuilder commandStringBuilder = new CommandStringBuilder ( CliStrings . CREATE_REGION ) ; commandStringBuilder . addOption ( CliStrings . CREATE_REGION__REGION , "compressedRegion" ) ; commandStringBuilder . addOption ( CliStrings . CREATE_REGION__REGIONSHORTCUT , "REPLICATE" ) ; commandStringBuilder . addOption ( CliStrings . CREATE_REGION__COMPRESSOR , RegionEntryContext . DEFAULT_COMPRESSION_PROVIDER ) ; CommandResult cmdResult = executeCommand ( commandStringBuilder . toString ( ) ) ; assertEquals ( Result . Status . OK , cmdResult . getStatus ( ) ) ; vm . invoke ( ( ) -> { Region region = getCache ( ) . getRegion ( "compressedRegion" ) ; assertNotNull ( region ) ; assertTrue ( SnappyCompressor . getDefaultInstance ( ) . equals ( region . getAttributes ( ) . getCompressor ( ) ) ) ; } ) ; commandStringBuilder = new CommandStringBuilder ( CliStrings . DESTROY_REGION ) ; commandStringBuilder . addOption ( CliStrings . DESTROY_REGION__REGION , "compressedRegion" ) ; cmdResult = executeCommand ( commandStringBuilder . toString ( ) ) ; assertEquals ( Result . Status . OK , cmdResult . getStatus ( ) ) ; }
Asserts that the "compressor" option for the "create region" command succeeds for a recognized
 compressor.
Asserts that the " compressor " option for the " create region " command succeeds for a recognized compressor .
// Create a cache in vm 1 // Run create region command with compression // Make sure our region exists with compression enabled // cleanup