You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "David C. Hicks" <dh...@i-hicks.org> on 2009/02/16 21:29:34 UTC

Set system properties in pom.xml?

I think I already know the answer to this: No.  But, I feel like I 
should ask, just in case I've missed some vital piece of information.  
(Google is great, but sometimes it's hard to work your way through the 
chaff.)

I'd like to control some unit test features using a profile.  My current 
path was to simply set a property in my profile, thinking that I could 
then read that value in my test code using System.getProperty(key).  
That doesn't seem to be supported.

Is there some other, recommended, way of doing this kind of thing?

Thanks,
Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Set system properties in pom.xml?

Posted by "David C. Hicks" <dh...@i-hicks.org>.
Wendy, that was a great suggestion.  I should have done so sooner.

Having tossed out my changes in favor of doing something more 
productive, I went back to recreate my setup.  I must have 
mis-configured the plugin.  Now, it's working beautifully.  Sorry about 
all the fuss.

Dave


Wendy Smoak wrote:
> On Mon, Feb 16, 2009 at 6:01 PM, David C. Hicks <dh...@i-hicks.org> wrote:
>   
>> The surefire documentation is plenty clear, but the feature apparently
>> doesn't work.  At least, I have been unsuccessful with it, thus far.
>> I'm just trying to pass in a simple string for my tests to pick up.  The
>> string is set by activating a profile.
>>     
>
> It might be quicker to paste your plugin configuration and see if
> someone can spot an error, since passing properties into tests does
> work for many of us.
>
> Also, what version of Surefire are you using?
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Set system properties in pom.xml?

Posted by Wendy Smoak <ws...@gmail.com>.
On Mon, Feb 16, 2009 at 6:01 PM, David C. Hicks <dh...@i-hicks.org> wrote:
> The surefire documentation is plenty clear, but the feature apparently
> doesn't work.  At least, I have been unsuccessful with it, thus far.
> I'm just trying to pass in a simple string for my tests to pick up.  The
> string is set by activating a profile.

It might be quicker to paste your plugin configuration and see if
someone can spot an error, since passing properties into tests does
work for many of us.

Also, what version of Surefire are you using?

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Set system properties in pom.xml?

Posted by "David C. Hicks" <dh...@i-hicks.org>.
The surefire documentation is plenty clear, but the feature apparently 
doesn't work.  At least, I have been unsuccessful with it, thus far.
I'm just trying to pass in a simple string for my tests to pick up.  The 
string is set by activating a profile.

I guess I'll dig into the surefire source tree and see if I can find an 
example that shows me something different.


Dan Tran wrote:
> any how, what kind of problem you are facing? Is surefire document not
> clear enough?
>
> -D
>
> On Mon, Feb 16, 2009 at 4:33 PM, Dan Tran <da...@gmail.com> wrote:
>   
>> Actually, it is in the surefire source tree with its own module.
>>
>> -Dan
>>
>>
>> On Mon, Feb 16, 2009 at 3:45 PM, David C. Hicks <dh...@i-hicks.org> wrote:
>>     
>>> Where would I find those test cases?  I see nothing about integration tests
>>> on the SureFire page.
>>>
>>> Dan Tran wrote:
>>>       
>>>> You may want to take a look at surefire's integration test cases, I
>>>> has a bunch of examples on how push system properties into surefire.
>>>>
>>>> -D
>>>>
>>>> On Mon, Feb 16, 2009 at 1:25 PM, David C. Hicks <dh...@i-hicks.org>
>>>> wrote:
>>>>
>>>>         
>>>>> Incidentally, I did try using the <systemProperties> configuration
>>>>> element
>>>>> of the SureFire plugin.  It did not appear to do anything.
>>>>>
>>>>> David C. Hicks wrote:
>>>>>
>>>>>           
>>>>>> I think I already know the answer to this: No.  But, I feel like I
>>>>>> should
>>>>>> ask, just in case I've missed some vital piece of information.  (Google
>>>>>> is
>>>>>> great, but sometimes it's hard to work your way through the chaff.)
>>>>>>
>>>>>> I'd like to control some unit test features using a profile.  My current
>>>>>> path was to simply set a property in my profile, thinking that I could
>>>>>> then
>>>>>> read that value in my test code using System.getProperty(key).  That
>>>>>> doesn't
>>>>>> seem to be supported.
>>>>>>
>>>>>> Is there some other, recommended, way of doing this kind of thing?
>>>>>>
>>>>>> Thanks,
>>>>>> Dave
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>
>>>>>>
>>>>>>             
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>
>>>>>
>>>>>
>>>>>           
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>>         
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>       
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Set system properties in pom.xml?

Posted by Dan Tran <da...@gmail.com>.
any how, what kind of problem you are facing? Is surefire document not
clear enough?

-D

On Mon, Feb 16, 2009 at 4:33 PM, Dan Tran <da...@gmail.com> wrote:
> Actually, it is in the surefire source tree with its own module.
>
> -Dan
>
>
> On Mon, Feb 16, 2009 at 3:45 PM, David C. Hicks <dh...@i-hicks.org> wrote:
>> Where would I find those test cases?  I see nothing about integration tests
>> on the SureFire page.
>>
>> Dan Tran wrote:
>>>
>>> You may want to take a look at surefire's integration test cases, I
>>> has a bunch of examples on how push system properties into surefire.
>>>
>>> -D
>>>
>>> On Mon, Feb 16, 2009 at 1:25 PM, David C. Hicks <dh...@i-hicks.org>
>>> wrote:
>>>
>>>>
>>>> Incidentally, I did try using the <systemProperties> configuration
>>>> element
>>>> of the SureFire plugin.  It did not appear to do anything.
>>>>
>>>> David C. Hicks wrote:
>>>>
>>>>>
>>>>> I think I already know the answer to this: No.  But, I feel like I
>>>>> should
>>>>> ask, just in case I've missed some vital piece of information.  (Google
>>>>> is
>>>>> great, but sometimes it's hard to work your way through the chaff.)
>>>>>
>>>>> I'd like to control some unit test features using a profile.  My current
>>>>> path was to simply set a property in my profile, thinking that I could
>>>>> then
>>>>> read that value in my test code using System.getProperty(key).  That
>>>>> doesn't
>>>>> seem to be supported.
>>>>>
>>>>> Is there some other, recommended, way of doing this kind of thing?
>>>>>
>>>>> Thanks,
>>>>> Dave
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Set system properties in pom.xml?

Posted by Dan Tran <da...@gmail.com>.
Actually, it is in the surefire source tree with its own module.

-Dan


On Mon, Feb 16, 2009 at 3:45 PM, David C. Hicks <dh...@i-hicks.org> wrote:
> Where would I find those test cases?  I see nothing about integration tests
> on the SureFire page.
>
> Dan Tran wrote:
>>
>> You may want to take a look at surefire's integration test cases, I
>> has a bunch of examples on how push system properties into surefire.
>>
>> -D
>>
>> On Mon, Feb 16, 2009 at 1:25 PM, David C. Hicks <dh...@i-hicks.org>
>> wrote:
>>
>>>
>>> Incidentally, I did try using the <systemProperties> configuration
>>> element
>>> of the SureFire plugin.  It did not appear to do anything.
>>>
>>> David C. Hicks wrote:
>>>
>>>>
>>>> I think I already know the answer to this: No.  But, I feel like I
>>>> should
>>>> ask, just in case I've missed some vital piece of information.  (Google
>>>> is
>>>> great, but sometimes it's hard to work your way through the chaff.)
>>>>
>>>> I'd like to control some unit test features using a profile.  My current
>>>> path was to simply set a property in my profile, thinking that I could
>>>> then
>>>> read that value in my test code using System.getProperty(key).  That
>>>> doesn't
>>>> seem to be supported.
>>>>
>>>> Is there some other, recommended, way of doing this kind of thing?
>>>>
>>>> Thanks,
>>>> Dave
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Set system properties in pom.xml?

Posted by "David C. Hicks" <dh...@i-hicks.org>.
Where would I find those test cases?  I see nothing about integration 
tests on the SureFire page.

Dan Tran wrote:
> You may want to take a look at surefire's integration test cases, I
> has a bunch of examples on how push system properties into surefire.
>
> -D
>
> On Mon, Feb 16, 2009 at 1:25 PM, David C. Hicks <dh...@i-hicks.org> wrote:
>   
>> Incidentally, I did try using the <systemProperties> configuration element
>> of the SureFire plugin.  It did not appear to do anything.
>>
>> David C. Hicks wrote:
>>     
>>> I think I already know the answer to this: No.  But, I feel like I should
>>> ask, just in case I've missed some vital piece of information.  (Google is
>>> great, but sometimes it's hard to work your way through the chaff.)
>>>
>>> I'd like to control some unit test features using a profile.  My current
>>> path was to simply set a property in my profile, thinking that I could then
>>> read that value in my test code using System.getProperty(key).  That doesn't
>>> seem to be supported.
>>>
>>> Is there some other, recommended, way of doing this kind of thing?
>>>
>>> Thanks,
>>> Dave
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Set system properties in pom.xml?

Posted by Dan Tran <da...@gmail.com>.
You may want to take a look at surefire's integration test cases, I
has a bunch of examples on how push system properties into surefire.

-D

On Mon, Feb 16, 2009 at 1:25 PM, David C. Hicks <dh...@i-hicks.org> wrote:
> Incidentally, I did try using the <systemProperties> configuration element
> of the SureFire plugin.  It did not appear to do anything.
>
> David C. Hicks wrote:
>>
>> I think I already know the answer to this: No.  But, I feel like I should
>> ask, just in case I've missed some vital piece of information.  (Google is
>> great, but sometimes it's hard to work your way through the chaff.)
>>
>> I'd like to control some unit test features using a profile.  My current
>> path was to simply set a property in my profile, thinking that I could then
>> read that value in my test code using System.getProperty(key).  That doesn't
>> seem to be supported.
>>
>> Is there some other, recommended, way of doing this kind of thing?
>>
>> Thanks,
>> Dave
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Set system properties in pom.xml?

Posted by "David C. Hicks" <dh...@i-hicks.org>.
Incidentally, I did try using the <systemProperties> configuration 
element of the SureFire plugin.  It did not appear to do anything.

David C. Hicks wrote:
> I think I already know the answer to this: No.  But, I feel like I 
> should ask, just in case I've missed some vital piece of information.  
> (Google is great, but sometimes it's hard to work your way through the 
> chaff.)
>
> I'd like to control some unit test features using a profile.  My 
> current path was to simply set a property in my profile, thinking that 
> I could then read that value in my test code using 
> System.getProperty(key).  That doesn't seem to be supported.
>
> Is there some other, recommended, way of doing this kind of thing?
>
> Thanks,
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org