Qpid
  1. Qpid
  2. QPID-4496

[Java client] Improve error reporting for invalid addresses

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.18, 0.20
    • Fix Version/s: 0.21
    • Component/s: Java Client
    • Labels:

      Description

      In the following example, the second address should throw an exception notifying that the request type is different from the already present object

      1. java -cp $

      {CLASSPATH} org.apache.qpid.example.Spout "ex;{create:sender, node: {type:topic,x-declare:{type:topic}}}"
      2. java -cp ${CLASSPATH}

      org.apache.qpid.example.Spout "ex;{create:sender, node: {type:topic,x-declare:

      {type:fanout}

      }}"

      Also we need to provide a clear messages when an assertion is false.
      Ex.
      1. java -cp $

      {CLASSPATH} org.apache.qpid.example.Spout "ex;{create:sender, node: {type:topic,x-declare:{type:topic}}}"
      2. java -cp ${CLASSPATH}

      org.apache.qpid.example.Spout "ex;{assert:sender, node: {type:topic,x-declare:

      {type:fanout}

      }}"

      All though we currently throw an exception, the message is not very useful.

        Activity

        Hide
        Robbie Gemmell added a comment -

        Regarding http://svn.apache.org/viewvc?view=revision&revision=1418539

        There is a typo in the spelling of Assert in the new exceptions. Can we respect the code style and not have if statements on a single line and without braces?

        The swapping of the assert and create operation ordering seems reasonable, since create implicitly asserts and if you had requested both previously it presumably wouldnt have actually created given the prior ordering.

        This seems like a change that should have tests?

        Robbie

        Show
        Robbie Gemmell added a comment - Regarding http://svn.apache.org/viewvc?view=revision&revision=1418539 There is a typo in the spelling of Assert in the new exceptions. Can we respect the code style and not have if statements on a single line and without braces? The swapping of the assert and create operation ordering seems reasonable, since create implicitly asserts and if you had requested both previously it presumably wouldnt have actually created given the prior ordering. This seems like a change that should have tests? Robbie
        Hide
        Rajith Attapattu added a comment -

        I have fixed the typo and corrected the code to conform to the coding style.
        Some of the existing tests implicitly covers this.

        However I think we need to add some tests that specifically tests for error handling, not just this particular issue.
        I'm looking into it now.

        Show
        Rajith Attapattu added a comment - I have fixed the typo and corrected the code to conform to the coding style. Some of the existing tests implicitly covers this. However I think we need to add some tests that specifically tests for error handling, not just this particular issue. I'm looking into it now.

          People

          • Assignee:
            Rajith Attapattu
            Reporter:
            Rajith Attapattu
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development