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

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

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

    // Create a region with an unrecognized compressor
    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, "BAD_COMPRESSOR");
    CommandResult cmdResult = executeCommand(commandStringBuilder.toString());
    assertEquals(Result.Status.ERROR, cmdResult.getStatus());

    // Assert that our region was not created
    vm.invoke(() -> {
      Region region = getCache().getRegion("compressedRegion");
      assertNull(region);
    });
  }
/**
   * Asserts that the "compressor" option for the "create region" command fails for an unrecognized
   * compressorc.
   */
Asserts that the "compressor" option for the "create region" command fails for an unrecognized
compressorc.
Asserts that the " compressor " option for the " create region " command fails for an unrecognized compressorc .
@Test
  public void testCreateRegionWithBadCompressor() {
    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, "BAD_COMPRESSOR");
    CommandResult cmdResult = executeCommand(commandStringBuilder.toString());
    assertEquals(Result.Status.ERROR, cmdResult.getStatus());
    vm.invoke(() -> {
      Region region = getCache().getRegion("compressedRegion");
      assertNull(region);
    });
  }
@ Test public void testCreateRegionWithBadCompressor ( ) { 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 , "BAD_COMPRESSOR" ) ; CommandResult cmdResult = executeCommand ( commandStringBuilder . toString ( ) ) ; assertEquals ( Result . Status . ERROR , cmdResult . getStatus ( ) ) ; vm . invoke ( ( ) -> { Region region = getCache ( ) . getRegion ( "compressedRegion" ) ; assertNull ( region ) ; } ) ; }
Asserts that the "compressor" option for the "create region" command fails for an unrecognized
 compressorc.
Asserts that the " compressor " option for the " create region " command fails for an unrecognized compressorc .
// Create a cache in vm 1 // Create a region with an unrecognized compressor // Assert that our region was not created