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: [EMAIL PROTECTED]
 
Webify Solutions
Enabling the On Demand Enterprise(tm)
www.webifysolutions.com


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

Reply via email to