4.3.0: Issues with plugin unit testing; oracle plugin integration

Elias Ross genman at noderunner.net
Thu Nov 3 19:02:10 UTC 2011


On Thu, Nov 3, 2011 at 10:56 AM, Ian Springer <ian.springer at redhat.com> wrote:
> Hi,
>
> Have you looked at some of the other plugins that have integration tests
> (e.g. the jboss-as plugin)? In those, we do a bunch of filesystem setup
> for the tests to make sure the plugin container can find the plugin
> being tested, other dependent plugins, and the platform plugin (which is
> always required), as well as the SIGAR native libs.

Now that you mention it, I noticed some stuff going on with copy to
target/itest, but with the 'snmptrapd' plugin which I worked on (and
does similar stuff) I don't bother with any copying and tests work
fine there.

And so...I went and deleted the whole element:

      <profile>
         <id>integration-tests</id>

and deleted the files under test/itest

and now it works fine! As such, I don't really see it as necessary to
bother with all the file copying for test purpose. (It does kind of
raise the question, can't this stuff be put into a parent pom or
something?)

It seems if the plugin doesn't really need to access the platform
information--many of them do not--then it's basically worthless to
have this step.

It would be nice if there was a definitive document on unit testing
your plugin. Anyway, I'm working (or trying to) on a base test class
for doing testing. 'snmptrapd' has a simple version of what I had in
mind.


More information about the rhq-devel mailing list