@Test
  public void updateAcceptorSocketBinding() throws IOException, CommandFailedException {
    cliClient.executeCommand(command);
    page.navigateToMessaging();
    page.selectView("Connections");
    page.selectInTable(NAME, 0);
    page.edit();

    String socketBindingName = "RemoteAcceptorSB" + RandomStringUtils.randomAlphanumeric(5);

    try (OnlineManagementClient client = ManagementClientProvider.createOnlineManagementClient()) {
      int port = AvailablePortFinder.getNextAvailable(1024);
      log.info("Obtained port for socket binding '" + socketBindingName + "' is " + port);
      client.apply(new AddSocketBinding.Builder(socketBindingName).port(port).build());
    }

    ConfigFragment editPanelFragment = page.getConfigFragment();

    editPanelFragment.getEditor().text("socketBinding", socketBindingName);
    boolean finished = editPanelFragment.save();

    assertTrue("Config should be saved and closed.", finished);
    verifier.verifyAttribute(address, "socket-binding", socketBindingName, 500);

    cliClient.executeCommand(remove);
  }
  @Test
  public void updateBridgeDiscoveryGroup() throws Exception {
    try {
      ConfigFragment editPanelFragment = page.getConfigFragment();
      Editor editor = editPanelFragment.edit();

      editor.text("staticConnectors", "");
      editor.text("discoveryGroup", DISCOVERY_GROUP_EDIT);
      boolean finished = editPanelFragment.save();

      Assert.assertTrue("Config should be saved and closed.", finished);
      new ResourceVerifier(BRIDGE_ADDRESS, client)
          .verifyAttribute("discovery-group", DISCOVERY_GROUP_EDIT);
    } finally {
      operations.undefineAttribute(BRIDGE_ADDRESS, "discovery-group");
    }
  }
示例#3
0
  @Test
  public void updateAcceptorServerID() {
    cliClient.executeCommand(command);
    page.navigateToMessaging();
    page.selectView("Connections");
    page.switchType("Type: In-VM");
    page.selectInTable(NAME, 0);
    page.edit();

    ConfigFragment editPanelFragment = page.getConfigFragment();

    editPanelFragment.getEditor().text("serverId", "0");
    boolean finished = editPanelFragment.save();

    assertTrue("Config should be saved and closed.", finished);
    verifier.verifyAttribute(address, "server-id", "0", 500);

    cliClient.executeCommand(remove);
  }
  @Test
  public void updateBroadcastGroupInitialTimeoutNegativeValue() {
    cliClient.executeCommand(command);
    page.navigateToMessaging();
    page.selectView("Clustering");
    page.switchToDiscovery();
    page.selectInTable(NAME, 0);
    page.edit();

    ConfigFragment editPanelFragment = page.getConfigFragment();

    editPanelFragment.getEditor().text("initialWaitTimeout", "-1");
    boolean finished = editPanelFragment.save();

    assertFalse("Config should not be saved and closed.Negative value.", finished);
    verifier.verifyAttribute(address, "initial-wait-timeout", "10000", 500);

    cliClient.executeCommand(remove);
  }
  @Test
  public void updateDiscoveryGroupRefreshTimeout() {
    cliClient.executeCommand(command);
    page.navigateToMessaging();
    page.selectView("Clustering");
    page.switchToDiscovery();
    page.selectInTable(NAME, 0);
    page.edit();

    ConfigFragment editPanelFragment = page.getConfigFragment();

    editPanelFragment.getEditor().text("refreshTimeout", "2000");
    boolean finished = editPanelFragment.save();

    assertTrue("Config should be saved and closed.", finished);
    verifier.verifyAttribute(address, "refresh-timeout", "2000", 500);

    cliClient.executeCommand(remove);
  }
  @Test
  public void updateTopicsJndiNames() throws InterruptedException, TimeoutException, IOException {
    page.getConfig().topicsConfig();
    page.selectInTable(TOPIC);

    String jndiName = "java:/jndi-name" + RandomStringUtils.randomAlphanumeric(5);

    ConfigFragment editPanelFragment = page.getConfigFragment();

    editPanelFragment.edit().text("entries", jndiName);
    boolean finished = editPanelFragment.save();

    administration.reloadIfRequired();

    assertTrue("Config should be saved and closed.", finished);

    ModelNodeResult result = operations.readAttribute(TOPIC_ADDRESS, "entries");

    Assert.assertTrue(result.hasDefinedValue() && result.stringValue().contains(jndiName));
  }