You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jim Babka <ji...@webifysolutions.com> on 2006/02/06 18:54:03 UTC

[m2] Surefire-Plugin ignores argLine

I am trying to run tests with assertions enabled, but the surefire
plugin is apparently ignoring the argLine parameter.  If I specify the
following, assertions are not turned on:

...
  <build>
...
    <plugins>
	    <plugin>
	        <groupId>org.apache.maven.plugins</groupId>
	        <artifactId>maven-surefire-plugin</artifactId>
	        <configuration>
	            <test>**/*TestSuite*</test>
	            <useFile>false</useFile>
	            <forkMode>once</forkMode>
	            <argLine>-ea</argLine>
	        </configuration>
	    </plugin>
...
    </plugins>
  </build>
...

By the way, I did try this with -enableassertions as well (which is what
is shown in the surefire example doc), and it made no difference.

As a further example, this produces no error at all, even though it
clearly should, so this argLine parameter is really being ignored:

	    <plugin>
	        <groupId>org.apache.maven.plugins</groupId>
	        <artifactId>maven-surefire-plugin</artifactId>
	        <configuration>
	            <test>**/*TestSuite*</test>
	            <useFile>false</useFile>
	            <forkMode>once</forkMode>
	            <argLine>-xxx</argLine>
	        </configuration>
	    </plugin>

What is the right way to get surefire to run tests with assertions on?

Jim Babka
Senior Software Engineer
Main: (512) 334 3200
Direct: (512) 334 3237
Email: jim.babka@webifysolutions.com
 
Webify Solutions
Enabling the On Demand Enterprise(tm)
www.webifysolutions.com


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


Re: [m2] Surefire-Plugin ignores argLine

Posted by Carlos Sanchez <ca...@apache.org>.
No fix version means that it's not scheduled yet.
Plugins follow their own lifecycle, so you'll be able to use it in any
maven2 version

On 2/13/06, ian.d.stewart@jpmchase.com <ia...@jpmchase.com> wrote:
> Marcin,
>
> I didn't see a fix version.  Do you know if this is going to be fixed in
> Maven-2.0.3?
>
>
> Thanks,
> Ian
>
> It's better to be hated for who you are
> than loved for who you are not
>
> Ian D. Stewart
> Appl Dev Analyst-Advisory, DCS Automation
> JPMorganChase Global Technology Infrastructure
> Phone: (614) 244-2564
> Pager: (888) 260-0078
>
>
>
>                       Marcin Cetnarski
>                       <marcincet@tiger.        To:       "Maven Users List" <us...@maven.apache.org>
>                       com.pl>                  cc:
>                                                Subject:  Re: [m2] Surefire-Plugin ignores argLine
>                       02/13/2006 02:15
>                       AM
>                       Please respond to
>                       "Maven Users
>                       List"
>
>
>
>
>
> Hello Jim,
>
> Are you working on Windows? There is a bug in Surefire on Windows platform
> in
> forkMode. See http://jira.codehaus.org/browse/SUREFIRE-30. Maybe this
> will help.
>
>
>
> JB> I am trying to run tests with assertions enabled, but the surefire
> JB> plugin is apparently ignoring the argLine parameter.  If I specify the
> JB> following, assertions are not turned on:
>
> JB> ...
> JB>   <build>
> JB> ...
> JB>     <plugins>
> JB>             <plugin>
> JB>                 <groupId>org.apache.maven.plugins</groupId>
> JB>                 <artifactId>maven-surefire-plugin</artifactId>
> JB>                 <configuration>
> JB>                     <test>**/*TestSuite*</test>
> JB>                     <useFile>false</useFile>
> JB>                     <forkMode>once</forkMode>
> JB>                     <argLine>-ea</argLine>
> JB>                 </configuration>
> JB>             </plugin>
> JB> ...
> JB>     </plugins>
> JB>   </build>
> JB> ...
>
> JB> By the way, I did try this with -enableassertions as well (which is
> what
> JB> is shown in the surefire example doc), and it made no difference.
>
> JB> As a further example, this produces no error at all, even though it
> JB> clearly should, so this argLine parameter is really being ignored:
>
> JB>             <plugin>
> JB>                 <groupId>org.apache.maven.plugins</groupId>
> JB>                 <artifactId>maven-surefire-plugin</artifactId>
> JB>                 <configuration>
> JB>                     <test>**/*TestSuite*</test>
> JB>                     <useFile>false</useFile>
> JB>                     <forkMode>once</forkMode>
> JB>                     <argLine>-xxx</argLine>
> JB>                 </configuration>
> JB>             </plugin>
>
> JB> What is the right way to get surefire to run tests with assertions on?
>
> JB> Jim Babka
> JB> Senior Software Engineer
> JB> Main: (512) 334 3200
> JB> Direct: (512) 334 3237
> JB> Email: jim.babka@webifysolutions.com
> JB>
> JB> Webify Solutions
> JB> Enabling the On Demand Enterprise(tm)
> JB> www.webifysolutions.com
>
>
> JB> ---------------------------------------------------------------------
> JB> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> JB> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
> --
> Pozdrowienia,
>  Marcin Cetnarski
>
>
> ---------------------------------------------------------------------
> 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
>
>


--
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

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


Re: [m2] Surefire-Plugin ignores argLine

Posted by ia...@jpmchase.com.
Marcin,

I didn't see a fix version.  Do you know if this is going to be fixed in
Maven-2.0.3?


Thanks,
Ian

It's better to be hated for who you are
than loved for who you are not

Ian D. Stewart
Appl Dev Analyst-Advisory, DCS Automation
JPMorganChase Global Technology Infrastructure
Phone: (614) 244-2564
Pager: (888) 260-0078


                                                                                                                                       
                      Marcin Cetnarski                                                                                                 
                      <marcincet@tiger.        To:       "Maven Users List" <us...@maven.apache.org>                                   
                      com.pl>                  cc:                                                                                     
                                               Subject:  Re: [m2] Surefire-Plugin ignores argLine                                      
                      02/13/2006 02:15                                                                                                 
                      AM                                                                                                               
                      Please respond to                                                                                                
                      "Maven Users                                                                                                     
                      List"                                                                                                            
                                                                                                                                       




Hello Jim,

Are you working on Windows? There is a bug in Surefire on Windows platform
in
forkMode. See http://jira.codehaus.org/browse/SUREFIRE-30. Maybe this
will help.



JB> I am trying to run tests with assertions enabled, but the surefire
JB> plugin is apparently ignoring the argLine parameter.  If I specify the
JB> following, assertions are not turned on:

JB> ...
JB>   <build>
JB> ...
JB>     <plugins>
JB>             <plugin>
JB>                 <groupId>org.apache.maven.plugins</groupId>
JB>                 <artifactId>maven-surefire-plugin</artifactId>
JB>                 <configuration>
JB>                     <test>**/*TestSuite*</test>
JB>                     <useFile>false</useFile>
JB>                     <forkMode>once</forkMode>
JB>                     <argLine>-ea</argLine>
JB>                 </configuration>
JB>             </plugin>
JB> ...
JB>     </plugins>
JB>   </build>
JB> ...

JB> By the way, I did try this with -enableassertions as well (which is
what
JB> is shown in the surefire example doc), and it made no difference.

JB> As a further example, this produces no error at all, even though it
JB> clearly should, so this argLine parameter is really being ignored:

JB>             <plugin>
JB>                 <groupId>org.apache.maven.plugins</groupId>
JB>                 <artifactId>maven-surefire-plugin</artifactId>
JB>                 <configuration>
JB>                     <test>**/*TestSuite*</test>
JB>                     <useFile>false</useFile>
JB>                     <forkMode>once</forkMode>
JB>                     <argLine>-xxx</argLine>
JB>                 </configuration>
JB>             </plugin>

JB> What is the right way to get surefire to run tests with assertions on?

JB> Jim Babka
JB> Senior Software Engineer
JB> Main: (512) 334 3200
JB> Direct: (512) 334 3237
JB> Email: jim.babka@webifysolutions.com
JB>
JB> Webify Solutions
JB> Enabling the On Demand Enterprise(tm)
JB> www.webifysolutions.com


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



--
Pozdrowienia,
 Marcin Cetnarski


---------------------------------------------------------------------
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: [m2] Surefire-Plugin ignores argLine

Posted by Marcin Cetnarski <ma...@tiger.com.pl>.
Hello Jim,

Are you working on Windows? There is a bug in Surefire on Windows platform in
forkMode. See http://jira.codehaus.org/browse/SUREFIRE-30. Maybe this
will help.



JB> I am trying to run tests with assertions enabled, but the surefire
JB> plugin is apparently ignoring the argLine parameter.  If I specify the
JB> following, assertions are not turned on:

JB> ...
JB>   <build>
JB> ...
JB>     <plugins>
JB>             <plugin>
JB>                 <groupId>org.apache.maven.plugins</groupId>
JB>                 <artifactId>maven-surefire-plugin</artifactId>
JB>                 <configuration>
JB>                     <test>**/*TestSuite*</test>
JB>                     <useFile>false</useFile>
JB>                     <forkMode>once</forkMode>
JB>                     <argLine>-ea</argLine>
JB>                 </configuration>
JB>             </plugin>
JB> ...
JB>     </plugins>
JB>   </build>
JB> ...

JB> By the way, I did try this with -enableassertions as well (which is what
JB> is shown in the surefire example doc), and it made no difference.

JB> As a further example, this produces no error at all, even though it
JB> clearly should, so this argLine parameter is really being ignored:

JB>             <plugin>
JB>                 <groupId>org.apache.maven.plugins</groupId>
JB>                 <artifactId>maven-surefire-plugin</artifactId>
JB>                 <configuration>
JB>                     <test>**/*TestSuite*</test>
JB>                     <useFile>false</useFile>
JB>                     <forkMode>once</forkMode>
JB>                     <argLine>-xxx</argLine>
JB>                 </configuration>
JB>             </plugin>

JB> What is the right way to get surefire to run tests with assertions on?

JB> Jim Babka
JB> Senior Software Engineer
JB> Main: (512) 334 3200
JB> Direct: (512) 334 3237
JB> Email: jim.babka@webifysolutions.com
JB>  
JB> Webify Solutions
JB> Enabling the On Demand Enterprise(tm)
JB> www.webifysolutions.com


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



-- 
Pozdrowienia,
 Marcin Cetnarski


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


Re: [m2] Surefire-Plugin ignores argLine

Posted by David Sag <ds...@epo.org>.
Hi Jim,

to get this to work I have set up an environment variable MAVEN_OPTS=-ea 
in my .profile  (I am on MacOSX - do whatever you need to do to set up env 
variables on your platform)

it's less than ideal but for now I have been told this is the only way.

Kind regards,
Dave Sag 




 

"Jim Babka" <ji...@webifysolutions.com> wrote on 06-02-2006 18:54:03:

> I am trying to run tests with assertions enabled, but the surefire
> plugin is apparently ignoring the argLine parameter.  If I specify the
> following, assertions are not turned on:
> 
> ...
>   <build>
> ...
>     <plugins>
>        <plugin>
>            <groupId>org.apache.maven.plugins</groupId>
>            <artifactId>maven-surefire-plugin</artifactId>
>            <configuration>
>                <test>**/*TestSuite*</test>
>                <useFile>false</useFile>
>                <forkMode>once</forkMode>
>                <argLine>-ea</argLine>
>            </configuration>
>        </plugin>
> ...
>     </plugins>
>   </build>
> ...
> 
> By the way, I did try this with -enableassertions as well (which is what
> is shown in the surefire example doc), and it made no difference.
> 
> As a further example, this produces no error at all, even though it
> clearly should, so this argLine parameter is really being ignored:
> 
>        <plugin>
>            <groupId>org.apache.maven.plugins</groupId>
>            <artifactId>maven-surefire-plugin</artifactId>
>            <configuration>
>                <test>**/*TestSuite*</test>
>                <useFile>false</useFile>
>                <forkMode>once</forkMode>
>                <argLine>-xxx</argLine>
>            </configuration>
>        </plugin>
> 
> What is the right way to get surefire to run tests with assertions on?
> 
> Jim Babka
> Senior Software Engineer
> Main: (512) 334 3200
> Direct: (512) 334 3237
> Email: jim.babka@webifysolutions.com
> 
> Webify Solutions
> Enabling the On Demand Enterprise(tm)
> www.webifysolutions.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>