activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARTEMIS-1537) Broker is less strict with parsing when reloading config than when parsing it on startup
Date Wed, 06 Dec 2017 10:37:00 GMT

    [ https://issues.apache.org/jira/browse/ARTEMIS-1537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16279993#comment-16279993
] 

ASF GitHub Bot commented on ARTEMIS-1537:
-----------------------------------------

Github user jdanekrh commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1688#discussion_r155199713
  
    --- Diff: tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConfigurationValidationTest.java
---
    @@ -57,4 +57,23 @@ public void testFullConfiguration() throws Exception {
     
           Assert.assertEquals(true, fc.isPersistDeliveryCountBeforeDelivery());
        }
    +
    +   @Test
    +   public void testChangeConfiguration() throws Exception {
    +      FileConfiguration fc = new FileConfiguration();
    +      FileDeploymentManager deploymentManager = new FileDeploymentManager("ConfigurationTest-full-config.xml");
    +      deploymentManager.addDeployable(fc);
    +      deploymentManager.readConfiguration();
    +
    +      boolean success = false; // test should fail because config contains wrong element
    +
    +      deploymentManager = new FileDeploymentManager("ConfigurationTest-full-config-wrong-address.xml");
    +      deploymentManager.addDeployable(fc);
    +      try {
    +         deploymentManager.readConfiguration();
    +      } catch (Exception e) {
    +         success = true;
    +      }
    +      Assert.assertTrue(success);
    --- End diff --
    
    Tests like that seem to be usually written a bit differently, like this https://github.com/apache/activemq-artemis/blob/f698a7f8189af7b70160ba18596be371642776bb/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/BodyTest.java#L66
    
    It can be worth it to name the exception variable `ignored`, not `e`, because that is
a hint to unused variable inspection in IntelliJ. https://www.reddit.com/r/ProgrammerHumor/comments/2so5tu/mildly_amusing_intellij_suggests_to_rename_a/
Not sure what it would suggest if you have multiple ignored exceptions in scope... It is less
verbose than https://docs.oracle.com/javase/7/docs/api/java/lang/SuppressWarnings.html ("unused")


> Broker is less strict with parsing when reloading config than when parsing it on startup
> ----------------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-1537
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1537
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Stanislav Knot
>            Priority: Minor
>
> 1) Start broker with default config.
> 2) Edit the <addresses> section in broker.xml with bad element
> 3) Save the config and observe successful reload in log. (The new configuration is applied.
Had there be new addresses configured, for example, they would've been created.)
> 4) Finally, stop and start again the broker. Notice that the string blah blah now causes
a failure on startup.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message