@Test
  public void deployMultipleJarsToOneGroup() throws Exception {
    // Deploy of multiple JARs to a single group
    gfshConnector
        .executeAndAssertThat("deploy --group=" + GROUP1 + " --jars=" + jar3.getAbsolutePath() + ","
            + jar4.getAbsolutePath())
        .statusIsSuccess().containsOutput(server1.getName()).doesNotContainOutput(server2.getName())
        .containsOutput(jarName3).containsOutput(jarName4);

    server1.invoke(() -> {
      assertThatCanLoad(jarName3, class3);
      assertThatCanLoad(jarName4, class4);
    });
    server2.invoke(() -> {
      assertThatCannotLoad(jarName3, class3);
      assertThatCannotLoad(jarName4, class4);
    });

    // Undeploy of multiple jars without specifying group
    gfshConnector.executeAndAssertThat("undeploy --jars=" + jarName3 + "," + jarName4)
        .statusIsSuccess()
        .hasTableSection("jars")
        .hasRowSize(4)
        .hasAnyRow().contains("server-1", "DeployCommandsDUnit3.jar")
        .hasAnyRow().contains("server-1", "DeployCommandsDUnit4.jar")
        .hasAnyRow()
        .contains("server-2", "DeployCommandsDUnit3.jar", "DeployCommandsDUnit3.jar not deployed")
        .hasAnyRow()
        .contains("server-2", "DeployCommandsDUnit4.jar", "DeployCommandsDUnit4.jar not deployed");
    server1.invoke(() -> {
      assertThatCannotLoad(jarName3, class3);
      assertThatCannotLoad(jarName4, class4);
    });
    server2.invoke(() -> {
      assertThatCannotLoad(jarName3, class3);
      assertThatCannotLoad(jarName4, class4);
    });
  }
Unit tests for DeployCommand, UndeployCommand, ListDeployedCommand

@since GemFire 7.0
geode-gfsh/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DeployWithGroupsDUnitTest.java