On Wed, Sep 25, 2013 at 2:21 PM, Laird Nelson <[email protected]> wrote:
> However, I would still expect to see something in the system property,
> yeah?
>
Aha, found the root issue here.
If you set a system property whose sole contents is the following literal
string:
${surefire.forkNumber}
...then at pom evaluation time that is (obviously) going to evaluate to
nothing. Consequently by the time SureFire happens along, there is no
property reference left to expand. So null gets passed through as the
value of the system property.
On the other hand, if you have a system property whose contents *include*
${surefire.forkNumber}, then something in the property expansion machinery
causes that reference to stick around, and now when Surefire happens along
it gets a chance to substitute the value.
So, in short, something like this works:
<systemPropertyVariables>
<foobar>FOOBAR_${surefire.forkNumber}</foobar> <!-- will evaluate to,
e.g. FOOBAR_1, FOOBAR_2, etc. -->
</systemPropertyVariables>
...but this will never work:
<systemPropertyVariables>
<foobar>${surefire.forkNumber}</foobar> <!-- will always evaluate to null
by the time the test class "sees" it -->
</systemPropertyVariables>
OK, closing the book on this one; thanks for bearing with me.
Best,
Laird
--
http://about.me/lairdnelson