5 Replies Latest reply on May 17, 2007 12:55 PM by timfox

    JGroups configuration (JBMESSAGING-960)

    sergeypk

      I removed all bind_addr attributes from clustered XML files since normally the bind address would be set for us by JBoss AS through system properties that JGroups will pick up.

      I added a test case that checks that JGroups for the post office is configured correctly (more test methods can be added to it), according to what Brian described in http://jira.jboss.com/jira/browse/JBMESSAGING-960.

      I don't like the way the test looks now though since it has to access post office private fields through reflection. And at this point the test basically only tests JGroups functionality (possibly also making sure Messaging doesn't prevent JGroups from doing the right thing). I doubt this is actually something we need to test.

        • 1. Re: JGroups configuration (JBMESSAGING-960)
          timfox

          True, we are basically just testing JGroups functionality, but there is no harm ion having more tests.

          BTW you could avoid the nasty private field inspection by subclassing ClusteredPersistenceServiceConfigFileJChannelFactory and adding an getter for the JChannel, this would be cleaner.

          Anyway this is not critical for now.

          • 2. Re: JGroups configuration (JBMESSAGING-960)
            sergeypk

            Ok so I'm going to add other similar tests to check the rest of Brian's points. I don't want to use CPSCFJChannelFactory in the tests because it's a test-related object and I'd rather test the real thing. I could make DefaultClusteredPostOffice.syncChannel and asyncChannel fields protected, derive a test class from it exposing those fields and then use that class, but it looks like a lot of work for little payoff.

            • 3. Re: JGroups configuration (JBMESSAGING-960)
              clebert.suconic

              I'm adding -Djgroups.bind_addr=127.0.0.1 on places where we are starting JVMs on the testsuite, then we would use 127.0.0.1 as we used to do.

              I couldn't find a way to open UDP on my wireless router, so I guess this would be better for our testing.

              • 4. Re: JGroups configuration (JBMESSAGING-960)
                clebert.suconic

                Errr.. Never mind... Sergey had already done the same exact change! :-)

                Actuallly.. kind of funny Sergey's change was on the same line.. same spacing... It is kind of a simple change.. but I felt funny the same way!

                • 5. Re: JGroups configuration (JBMESSAGING-960)
                  timfox

                  I think Clebert invented the alter ego of Sergey, so he could receive a double salary. ;)