[ 
http://jira.codehaus.org/browse/SUREFIRE-101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_90066
 ] 

David J. M. Karlsen commented on SUREFIRE-101:
----------------------------------------------

Weird - it only triggers when the systemproperty is read from within the static 
Test suite() method, try flipping in/out doIt:

private static void doIt()
    {
        assertEquals( "Test Value", System.getProperty( "testproperty" ) );
    }
    
    public static Test suite()
    {
        //doIt();  //fail or not fail...
        
        return new TestSuite( TestSystemProperiesWhileForkingTest.class );
    }
    
    public void testSystemProperty()
    {
        doIt();
    }

> Plugin not longer sets system properties when forking is on and debugging 
> information is not correct
> ----------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-101
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-101
>             Project: Maven Surefire
>          Issue Type: Bug
>    Affects Versions: 2.0 (2.2 plugin)
>            Reporter: Vincent Massol
>         Assigned To: Vincent Massol
>            Priority: Blocker
>             Fix For: 2.4
>
>         Attachments: MSUREFIRE-145.zip
>
>
> The following code is in SurefirePlugin.java:
> {code:java}
>         processSystemProperties( !fork.isForking() );
>         if ( getLog().isDebugEnabled() )
>         {
>             showMap( systemProperties, "system property" );
>         }
> {code}
> 2 problems:
> 1) fork.isForking() is false when forking is enabled and thus system 
> properties are not set:
> {code:java}
>     protected void processSystemProperties( boolean setInSystem )
>     {
> [...]
>         if ( setInSystem )
>         {
>             // Add all system properties configured by the user
>             Iterator iter = systemProperties.keySet().iterator();
>             while ( iter.hasNext() )
>             {
>                 String key = (String) iter.next();
>                 String value = systemProperties.getProperty( key );
>                 System.setProperty( key, value );
>             }
>         }
>     }
> {code}
> 2)  showMap() is called regardless of whether the system properties are set 
> or not, leading to the following kind of misleading logs:
> {noformat}
> [...]
> [DEBUG] Setting system property [cargo.jetty4x.port]=[8280]
> [DEBUG] Setting system property [cargo.jetty6x.port]=[8280]
> [DEBUG] Setting system property [cargo.jetty5x.port]=[8280]
> [...]
> {noformat}
> Those properties are actually NOT set.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to