Uploaded image for project: 'Apache RocketMQ'
  1. Apache RocketMQ
  2. ROCKETMQ-77

[TEST] org.apache.rocketmq.tools.* have NPEs

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.0-incubating
    • Component/s: rocketmq-tools
    • Labels:
      None

      Description

      Run mvn test and see org.apache.rocketmq.tools.* having NPEs, because no nameserver is started.

      This can be fixed by, for instance, having IntegrationTestBase staring a nameserver when tests are being run.

      In general, I would throw an exception whenever obtaining a nameserver is failed, rather than returning null, because a connection to the nameserver is a must to do any useful work in RocketMQ.

        Activity

        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 671e9a5537d941721e76efb18114e8054c9cc936 in incubator-rocketmq's branch refs/heads/master from stevenschew
        [ https://git-wip-us.apache.org/repos/asf?p=incubator-rocketmq.git;h=671e9a5 ]

        ROCKETMQ-77 [TEST] org.apache.rocketmq.tools.* have NPEs

        Show
        jira-bot ASF subversion and git services added a comment - Commit 671e9a5537d941721e76efb18114e8054c9cc936 in incubator-rocketmq's branch refs/heads/master from stevenschew [ https://git-wip-us.apache.org/repos/asf?p=incubator-rocketmq.git;h=671e9a5 ] ROCKETMQ-77 [TEST] org.apache.rocketmq.tools.* have NPEs
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 9a2de7b555b390c1c55f5a275d6fe7e251ac3f62 in incubator-rocketmq's branch refs/heads/master from yukon
        [ https://git-wip-us.apache.org/repos/asf?p=incubator-rocketmq.git;h=9a2de7b ]

        ROCKETMQ-77 Skip unaccomplished unit tests in tools module, which will be fixed in 4.1.0

        Show
        jira-bot ASF subversion and git services added a comment - Commit 9a2de7b555b390c1c55f5a275d6fe7e251ac3f62 in incubator-rocketmq's branch refs/heads/master from yukon [ https://git-wip-us.apache.org/repos/asf?p=incubator-rocketmq.git;h=9a2de7b ] ROCKETMQ-77 Skip unaccomplished unit tests in tools module, which will be fixed in 4.1.0
        Hide
        Yukon yukon added a comment -

        Hi, Roman Shtykh

        We just skip the unit tests of tools.
        IMO, start a name server isn't a good idea, it could be better that mock the connections between namesrv and tools modules, could you please polish the unit tests of tools in next release version?

        Show
        Yukon yukon added a comment - Hi, Roman Shtykh We just skip the unit tests of tools. IMO, start a name server isn't a good idea, it could be better that mock the connections between namesrv and tools modules, could you please polish the unit tests of tools in next release version?
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 9a2de7b555b390c1c55f5a275d6fe7e251ac3f62 in incubator-rocketmq's branch refs/heads/4.0.0-incubating from yukon
        [ https://git-wip-us.apache.org/repos/asf?p=incubator-rocketmq.git;h=9a2de7b ]

        ROCKETMQ-77 Skip unaccomplished unit tests in tools module, which will be fixed in 4.1.0

        Show
        jira-bot ASF subversion and git services added a comment - Commit 9a2de7b555b390c1c55f5a275d6fe7e251ac3f62 in incubator-rocketmq's branch refs/heads/4.0.0-incubating from yukon [ https://git-wip-us.apache.org/repos/asf?p=incubator-rocketmq.git;h=9a2de7b ] ROCKETMQ-77 Skip unaccomplished unit tests in tools module, which will be fixed in 4.1.0
        Hide
        roman_s Roman Shtykh added a comment -

        Hi yukon,
        Sure I can handle it

        Sure, mocking is a good approach, but I am not sure it is feasible in this case – usually you mock objects, but here you need a running nameserver to respond RemotingClient requests, so, at the first glance, it doesn't look much different to me whether you start a nameserver controller or its mocked version. Can you please explain your viewpoint?

        As an example, Apache Curator has a testing zookeeper server (see org.apache.curator.test.TestingServer), so you can use it whenever you have components that require a connection to it in your tests.
        We have IntegrationTestBase handy.

        Show
        roman_s Roman Shtykh added a comment - Hi yukon , Sure I can handle it Sure, mocking is a good approach, but I am not sure it is feasible in this case – usually you mock objects, but here you need a running nameserver to respond RemotingClient requests, so, at the first glance, it doesn't look much different to me whether you start a nameserver controller or its mocked version. Can you please explain your viewpoint? As an example, Apache Curator has a testing zookeeper server (see org.apache.curator.test.TestingServer ), so you can use it whenever you have components that require a connection to it in your tests. We have IntegrationTestBase handy.

          People

          • Assignee:
            roman_s Roman Shtykh
            Reporter:
            roman_s Roman Shtykh
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development