I think you need include in the project.properties the line:

maven.junit.sysproperties=myprop1 myprop2 myprop3 ....

This specifies what properties are passed on to forked tests.
Then define them on the command line, or in a properties file.

Benedict






> -----Original Message-----
> From: Tim Brazil [mailto:[EMAIL PROTECTED]
> Sent: 23 December 2004 22:06
> To: Maven Users List
> Subject: overriding the project.properties using the maven -D option
> 
> 
> I'm trying to add a new property in the project.properties file in order 
> to build in different levels of debug output for my junit tests. It's a 
> very basic idea however I cannot seem to get the correct "modified" 
> property using the System.getProperty() method. Am I missing something? 
> The following explains my problem. - Thanks in advance for any pointers. 
> - Tim
> 
> 1) I added a new property to my project.properties file called 
> smi.appliance.functest.debugLevel and set it to 0:
> 
> i.e.
> smi.appliance.functest.debugLevel=0
> 
> 2) I run my junit test using a -D properties modifier flag:
> 
> i.e.
> smimav -Dsmi.appliance.functest.debugLevel=2 
> -Dtestcase=com.sendmail.appliance.functest.syscfg.AccountNegFuncTest 
> test:single
> 
> 3) Now the output in my <testname>.xml file indicates that the value for 
> smi.appliance.functest.debugLevel has been indeed modified to 2:
> 
>  <property name="smi.appliance.functest.debugLevel" value="2"></property>
> 
> 4) However my method within the test still thinks it the default 
> "project.properties" value.
> 
>       String debugLevel = 
> System.getProperty("smi.appliance.functest.debugLevel");
>       System.out.print("DEBUG: 
> "+debugLevel+"\n");                          <----- this will still 
> print 0 and not the 2 "modified" value
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.822 / Virus Database: 560 - Release Date: 22/12/2004
> 
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.822 / Virus Database: 560 - Release Date: 22/12/2004


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to