@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);
  }
Esempio n. 2
0
 @Before
 public void before() {
   page.navigateToMessaging();
   page.selectConnectionsView();
   page.switchToBridges();
   page.selectInTable(BRIDGE);
 }
 @Before
 public void before() {
   page.navigateToMessaging();
   page.selectQueuesAndTopics();
   page.switchToJmsQueuesTopics();
   page.selectInTable(TOPIC);
 }
Esempio n. 4
0
  @Test
  public void addInVmAcceptor() {
    page.navigateToMessaging();
    page.selectView("Connections");
    page.switchType("Type: In-VM");
    page.addInVmAcceptor(NAME, SERVER);

    verifier.verifyResource(address, true);

    cliClient.executeCommand(remove);

    verifier.verifyResource(address, false);
  }
  @Test
  public void addRemoteAcceptor() {
    page.navigateToMessaging();
    page.selectView("Connections");
    // same fields in acceptor adding
    page.addDiscoveryGroup(NAME, BINDING);

    verifier.verifyResource(address, true);

    cliClient.executeCommand(remove);

    verifier.verifyResource(address, false);
  }
  @Test
  public void addDiscoveryGroup() {
    page.navigateToMessaging();
    page.selectView("Clustering");
    page.switchToDiscovery();

    page.addDiscoveryGroup(NAME, BINDING);

    verifier.verifyResource(address, true);

    cliClient.executeCommand(remove);

    verifier.verifyResource(address, false);
  }
  @Test
  public void removeRemoteAcceptor() {
    cliClient.executeCommand(command);

    page.navigateToMessaging();
    page.selectView("Connections");

    verifier.verifyResource(address, true);

    page.selectInTable(NAME, 0);
    page.remove();

    verifier.verifyResource(address, false);
  }
  @Test
  public void removeDiscoveryGroup() {
    cliClient.executeCommand(command);

    page.navigateToMessaging();
    page.selectView("Clustering");
    page.switchToDiscovery();

    verifier.verifyResource(address, true);

    page.selectInTable(NAME, 0);
    page.remove();

    verifier.verifyResource(address, false);
  }
Esempio n. 9
0
  @Test
  public void removeAcceptorProperties() {
    cliClient.executeCommand(command);
    cliClient.executeCommand(addProperty);
    page.navigateToMessaging();
    page.selectView("Connections");
    page.switchType("Type: In-VM");
    page.selectInTable(NAME, 0);
    ConfigPropertiesFragment properties = page.getConfig().propertiesConfig();
    properties.removeProperty("prop");

    verifier.verifyAttribute(address, "params", "undefined", 500);

    cliClient.executeCommand(remove);
  }
Esempio n. 10
0
  @Test
  public void updateAcceptorProperties() {
    cliClient.executeCommand(command);
    page.navigateToMessaging();
    page.selectView("Connections");
    page.switchType("Type: In-VM");
    page.selectInTable(NAME, 0);

    ConfigPropertiesFragment properties = page.getConfig().propertiesConfig();
    ConfigPropertyWizard wizard = properties.addProperty();
    boolean result = wizard.name("prop").value("test").finish();

    assertTrue("Property should be added and wizard closed.", result);
    verifier.verifyAttribute(address, "params", "{\"prop\" => \"test\"}", 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));
  }
Esempio n. 12
0
 @Test
 public void updateBridgeTransformerClass() throws Exception {
   try {
     new ConfigChecker.Builder(client, BRIDGE_ADDRESS)
         .configFragment(page.getConfigFragment())
         .editAndSave(ConfigChecker.InputType.TEXT, "transformerClass", "clazz")
         .verifyFormSaved()
         .verifyAttribute("transformer-class-name", "clazz");
   } finally {
     operations.undefineAttribute(BRIDGE_ADDRESS, "transformer-class-name");
   }
 }
Esempio n. 13
0
  @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");
    }
  }
Esempio n. 14
0
  @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);
  }
Esempio n. 15
0
  @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);
  }
Esempio n. 16
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);
  }
Esempio n. 17
0
 @Test
 public void removeBridge() throws Exception {
   page.remove(BRIDGE_TBR);
   new ResourceVerifier(BRIDGE_TBR_ADDRESS, client).verifyDoesNotExist();
 }
Esempio n. 18
0
 @Test
 public void updateBridgeRetryIntervalWrongValue() {
   page.switchToConnectionManagementTab();
   verifyIfErrorAppears("retryInterval", "-10");
 }
Esempio n. 19
0
 @Test
 public void updateBridgeReconnectAttempts() throws Exception {
   page.switchToConnectionManagementTab();
   editTextAndVerify(BRIDGE_ADDRESS, "reconnectAttempts", "reconnect-attempts", -1);
 }
Esempio n. 20
0
 @Test
 public void updateBridgeRetryInterval() throws Exception {
   page.switchToConnectionManagementTab();
   editTextAndVerify(BRIDGE_ADDRESS, "retryInterval", "retry-interval", 1L);
 }
Esempio n. 21
0
 @Test
 public void updateBridgePassword() throws Exception {
   page.switchToConnectionManagementTab();
   editTextAndVerify(BRIDGE_ADDRESS, "password", "pwd1");
 }
 @Test
 public void removeJmsTopics() throws Exception {
   page.getConfig().topicsConfig();
   page.remove(TOPIC_TBR);
   new ResourceVerifier(TOPIC_TBR_ADDRESS, client).verifyDoesNotExist();
 }
 @Test
 public void addJmsQueue() throws Exception {
   page.addQueue(QUEUE_TBA, JNDI_NAME);
   new ResourceVerifier(QUEUE_TBA_ADDRESS, client).verifyExists();
 }
 @Test
 public void addJmsTopics() throws Exception {
   page.getConfig().topicsConfig();
   page.addTopic(TOPIC_TBA, JNDI_TOPICS_NAME);
   new ResourceVerifier(TOPIC_TBA_ADDRESS, client).verifyExists();
 }
Esempio n. 25
0
 @Test
 public void addBridge() throws Exception {
   page.addBridge(BRIDGE_TBA, QUEUE_CREATE_BRIDGE, "testAddress", CONNECTOR);
   new ResourceVerifier(BRIDGE_TBA_ADDRESS, client).verifyExists();
 }
 @Test
 public void removeJmsQueue() throws Exception {
   page.remove(QUEUE_TBR);
   new ResourceVerifier(QUEUE_TBR_ADDRESS, client).verifyDoesNotExist();
 }