unitTestPlugin: tests in a different module

Hi there,

Is it possible to have the tests in a different module? If so, how would
the mapping pattern look like (I tried playing with the directory part, but
no joy).

TIA,
Andrei


6 comments

I have a number of modules where i have different patterns for both, the plugin determines from your idea settings which are valid options for different modules if the test directories are parallel to the src directories.

An example:
module A has TestedClass=src/$DIRECTORY$/$CLASS$ and TestClass=tests/$DIRECTORY$/$CLASS$Test

Module B has TestedClass=src/$DIRECTORY$/$CLASS$ and perhaps
TestClass=remote-tests/$DIRECTORY$/$CLASS$Test

the directory structures are as so:
c:/project/moduleA/src
c:/project/moduleA/tests

c:/project/moduleB/src
c:project/moduleB/remote-tests

then when creating a test case for moduleA you will be offered the option of tests/package/classTest
and in moduleB remote-tests/package/classTest

Is this clear?

if the patterns are TestedClass=src/$CLASS$ TestClass=tests/$CLASS$Test then all modules will have these path patterns as the test path is within the src path.

Hope this helped
Bronwen

0

Hello Bronwen,

That's not exactly what I'm looking for (I used those types of structures
in the past, and all was fine). However, here's what I have now:

Source files: c:/proj/com.whatever/src/com/whatever/Class
Test files: c:/proj/com.whatever.test/src/com/whatever/ClassTest

Where com.whatever and com.whatever.test are the names of the modules as
well (for source and test files respectively). So, somehow, I need to factor
the module name into the pattern, or at least I'd need to be able to use
two DIRECTORY variables (one to compose the module name, and the other one
for the package name).

I can't figure out how to map that using the current mapping capabilities.

Thx,
Andrei

P.S. And if you wonder how on earth would one end up with such a source/test
structure, it's yet another one of the "blessings" the eclipse oriented minds
feel like inflicting on the rest of the world. :)


0

Sorry Andrei,

I misunderstood your initial query!

We do not support tests in a different module. I can add it as an ER, but i am not sure if this is a common enough requirement? Get some votes and i'll add it ;)

Cheers
Bronwen

0

Hello Bronwen,

BC> We do not support tests in a different module.

Hmm, I thought so. :(

BC> ER, but i am not sure if this is a common enough requirement? Get
BC> some votes and i'll add it ;)

How many votes do I need? :)

There must be some other tormented souls out there (judging by how wide-spread
eclipse has become), so I think there's just a matter of time before more
people will have to deal with this structure.

So, as Rob would put it, think of where the puck will be. ;)

Thx,
Andrei


0

:) Great i have the patterns you need. Bear with me i have only recently taken over the dev of this plugin, at least while Jacques is busy ;-). I chatted to him and these are the patterns you need to support your needs, just tried it out myself and it seems fine.
The patterns:

TestClass -> com/whatever/src/$DIRECTORY$/$CLASS$ TestedClass -> com/whatever/test/src/$DIRECTORY$/$CLASS$Test

try it and yell

Bronwen

0

Hello Bronwen,

Indeed, it works! Thanks a lot for your assistance (both to you and Jacques).

Best,
Andrei

P.S. BTW, what I ended up with is:
com.whatever/src/$DIRECTORY$/$CLASS$ for tested class
com.whatever.test/src/$DIRECTORY$/$CLASS$Test for the test class




BC> :) Great i have the patterns you need. Bear with me i have only
BC> recently taken over the dev of this plugin, at least while Jacques
BC> is busy ;-). I chatted to him and these are the patterns you need to
BC> support your needs, just tried it out myself and it seems fine.
BC>
BC> The patterns:
BC>
BC> TestClass -> com/whatever/src/$DIRECTORY$/$CLASS$ TestedClass ->
BC> com/whatever/test/src/$DIRECTORY$/$CLASS$Test
BC>
BC> try it and yell
BC>
BC> Bronwen
BC>


0

Please sign in to leave a comment.