1 2 Previous Next 22 Replies Latest reply on Apr 14, 2007 11:26 PM by ryan.campbell Go to original post
      • 15. Re: Updating the server task to detect OutOfMemoryErrors

        How is this supposed to be run between each test case? As it is, it could only be run at the end of a junit task, which is too little, too late. This is why it needs to be implemented by extending Ant's TestRunner.

        As for the implementation you have in the task itself (ie, the code which calls the mbean), this looks good.

        But let's get it in the right place first.

        • 16. Re: Updating the server task to detect OutOfMemoryErrors

          Looking at your code attached to the JIRA, it looks like the right approach (nice job), I just have a few comments:

          - If a server is low on memory, the exception thrown should indicate *which* server was low.
          - The package for your new classes should be org.jboss.tools.ant.taskdefs not org.apache.tools.ant.taskdefs
          - Are you following JBoss code convetions? http://docs.jboss.org/process-guide/en/html/coding.html
          - You add this in the jboss-test project here: https://svn.jboss.org/repos/jbossas/projects/test/trunk/
          -

          Testing

          - There should be a "test-mem-check-runner" in the jboss-test project. This target should test the following scenarios:
          - two servers with plenty of memory
          - two servers: one low, one normal
          - two servers: both low

          - Have someone else reproduce your test results after committing to thee test project.

          Deployment
          - Once the tests pass and someone has reviewed it, commit it to /trunk. Once it has been in /trunk for a week, we can talk about deployment to other branches.

          • 17. Re: Updating the server task to detect OutOfMemoryErrors
            mvecera

            I don't know how to put the JUnitMemCheckTestRunner under the org.jboss.... package, becouse there are several other JUnit source files that must be modified in order to use the new test runner instead of the old one. Should I rewrite them and put them in the new package as well? If so, wasn't it be easier to copy the original JUnit ant task sources to the org.jboss.... and rewrite them directly instead of extending JUnitTestRunner?

            It is not possible to move only the modified sources to org.jboss.... package because of package visibility dependencies.

            • 18. Re: Updating the server task to detect OutOfMemoryErrors
              mvecera

              There are several problems about the JUnitMemCheckTestRunner. It works now perfetcly, but it was needed to take the whole junit ant task, copy it under org.jboss.... package and change several classes to use the new extended JUnitTestRunner (JUnitMemCheckTestRunner). I would call this solution a bit weird. But I don't have any idea, how to make it better. Do you have any idea or do you consider this solution good?

              For the JUnitMemCheckTestRunner you also have to change a configuration file inside ant.jar (please see file atteched to JBAS-4211).

              Now I would like to ask you about adding it to jboss-test project:
              1) Where should the new target be? build-test.xml or examples/build.xml?
              2) What server configurations should be used? Could it be 'all'?
              3) What test cases should be run on the servers for the JUnitMemCheckTestRunner to check the memory?

              • 19. Re: Updating the server task to detect OutOfMemoryErrors

                I don't understand why putting your custom Junit runner in an org.jboss package requires cloning the other Junit classes to this package. Can you please explain this? Why can't they be used from their existing package?

                Also, instead of overwriting the properties file in the ant-junit.jar, couldn't you extend the JUnit Ant task with our own JUnit task? We shouldn't have to munge third party jars.

                • 20. Re: Updating the server task to detect OutOfMemoryErrors
                  mvecera

                  The problem is with method visibility:
                  JUnitMemCheckTask.java:1222: setOutfile(java.io.File) is not public in org.apache.tools.ant.taskdefs.optional.junit.FormatterElement; cannot be accessed from outside package [fe.setOutfile(outFile);]

                  JUnitMemCheckTask.java:1318: addFormattersTo(java.util.Vector) is not public in org.apache.tools.ant.taskdefs.optional.junit.JUnitTest; cannot be accessed from outside package [test.addFormattersTo(feVector);]

                  Ant JUnit task classes are not ready for extending at all. Every time I tried to solve the visibility problems I ended up with something similar to the original package clone :-(

                  But I found a brand new solution that works with no cloning! We can extend JUnitResultFormatter which has endTask() method with no problem. I'll attach the solution to JBAS-4211 as soon as possible.

                  • 21. Re: Updating the server task to detect OutOfMemoryErrors
                    mvecera

                    So the solution is attached to JBAS-4211. Could anybody have a look on it?

                    No the main build.xml of JBoss test project depends on jboss.home property pointing to JBossAS build. And because of this I don't know if I can commit the changes to SVN.

                    The project depends on JBoss AS RMIAdaptor class, which can be found in jmx-adaptor-plugin.jar or in jbossall-client.jar. None of theese can be downloaded from http://repository.jboss.com as other components in build-thirdparty.xml...

                    • 22. Re: Updating the server task to detect OutOfMemoryErrors

                      If visibility problems are pushing the cloning of all of these classes, then we should put it back in the org.apache namespace.

                      1 2 Previous Next