geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateRegionCommandDUnitTest.java
@Test
  public void testCreateRegionWithNoCompressor() {
    setUpJmxManagerOnVm0ThenConnect(null);

    VM vm = Host.getHost(0).getVM(1);

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

    // Create a region with no compression
    CommandStringBuilder commandStringBuilder = new CommandStringBuilder(CliStrings.CREATE_REGION);
    commandStringBuilder.addOption(CliStrings.CREATE_REGION__REGION, "testRegion");
    commandStringBuilder.addOption(CliStrings.CREATE_REGION__REGIONSHORTCUT, "REPLICATE");
    CommandResult cmdResult = executeCommand(commandStringBuilder.toString());
    assertEquals(Result.Status.OK, cmdResult.getStatus());

    // Assert that our newly created region has no compression
    vm.invoke(() -> {
      Region region = getCache().getRegion("testRegion");
      assertNotNull(region);
      assertNull(region.getAttributes().getCompressor());
    });

    // Cleanup
    commandStringBuilder = new CommandStringBuilder(CliStrings.DESTROY_REGION);
    commandStringBuilder.addOption(CliStrings.DESTROY_REGION__REGION, "testRegion");
    cmdResult = executeCommand(commandStringBuilder.toString());
    assertEquals(Result.Status.OK, cmdResult.getStatus());
  }
/**
   * Asserts that a missing "compressor" option for the "create region" command results in a region
   * with no compression.
   */
Asserts that a missing "compressor" option for the "create region" command results in a region
with no compression.
Asserts that a missing " compressor " option for the " create region " command results in a region with no compression .
@Test
  public void testCreateRegionWithNoCompressor() {
    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, "testRegion");
    commandStringBuilder.addOption(CliStrings.CREATE_REGION__REGIONSHORTCUT, "REPLICATE");
    CommandResult cmdResult = executeCommand(commandStringBuilder.toString());
    assertEquals(Result.Status.OK, cmdResult.getStatus());
    vm.invoke(() -> {
      Region region = getCache().getRegion("testRegion");
      assertNotNull(region);
      assertNull(region.getAttributes().getCompressor());
    });
    commandStringBuilder = new CommandStringBuilder(CliStrings.DESTROY_REGION);
    commandStringBuilder.addOption(CliStrings.DESTROY_REGION__REGION, "testRegion");
    cmdResult = executeCommand(commandStringBuilder.toString());
    assertEquals(Result.Status.OK, cmdResult.getStatus());
  }
@ Test public void testCreateRegionWithNoCompressor ( ) { 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 , "testRegion" ) ; commandStringBuilder . addOption ( CliStrings . CREATE_REGION__REGIONSHORTCUT , "REPLICATE" ) ; CommandResult cmdResult = executeCommand ( commandStringBuilder . toString ( ) ) ; assertEquals ( Result . Status . OK , cmdResult . getStatus ( ) ) ; vm . invoke ( ( ) -> { Region region = getCache ( ) . getRegion ( "testRegion" ) ; assertNotNull ( region ) ; assertNull ( region . getAttributes ( ) . getCompressor ( ) ) ; } ) ; commandStringBuilder = new CommandStringBuilder ( CliStrings . DESTROY_REGION ) ; commandStringBuilder . addOption ( CliStrings . DESTROY_REGION__REGION , "testRegion" ) ; cmdResult = executeCommand ( commandStringBuilder . toString ( ) ) ; assertEquals ( Result . Status . OK , cmdResult . getStatus ( ) ) ; }
Asserts that a missing "compressor" option for the "create region" command results in a region
 with no compression.
Asserts that a missing " compressor " option for the " create region " command results in a region with no compression .
// Create a cache in vm 1 // Create a region with no compression // Assert that our newly created region has no compression // Cleanup