So how are you liking Maven now? -K

On Apr 3, 2008, at 2:19 PM, Chad La Joie wrote:
Alright, one of our developers located the problem.

It appears that when surefire runs it creates a TestSuite from all concrete classes that match the default includes pattern (**/ Test*.java, **/*Test.java, **/*TestCase.java). In this project there was a non-abstract base class that all tests were inheriting from called BaseTestCase (in the other projects this class was abstract). This matched the include rule, but wasn't a valid test case and this is what caused the error.

The error message in the summary report wasn't at all helpful and I missed the line in "<<< FAILURE!" line in the scrolling text as the tests were ran. A better error message would really help here. I think just reporting, in the summary, the "TestCase" class that didn't actually contain tests would probably be sufficient.

Chad La Joie wrote:
Martin, thanks for the reply, unfortunately the debug output didn't help, but it did lead me to look at something else. I have other projects that use Maven as well and none of them exhibit this problem, so it seems like it must be something with this project's POM. However, if I diff this project's POM with another project the only differences are the dependencies and project information (like name, version, etc.). The other portions are all the same. In both cases (this project with the error and the other projects without it) when I run Maven on debug and without explicitly configuring surefire in my POM, surefire doesn't report an excludes property (so surefire must use its default setting in absence of the list rather than adding the default value to the list if no other value is presented). If I add back in the snippet below the plugin correctly reports list of exclusions but still exclude TestSuite. So, certainly it would seem to be something wrong with my POM, but I sure can't see what it is. I'm pretty new to Maven, so I don't know its guts. Does it cache configuration information somewhere that wouldn't be removed by a clean? I know about the SuperPOM but its settings don't touch this plugin and my settings.xml only contains a single property pointing to my gpg signing key so that shouldn't be overriding anything And, if either of these were to blame it would show up in more than just this one project, I would think.
Martin Höller wrote:
On Thursday 03 April 2008 Chad La Joie wrote:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <testFailureIgnore>true</testFailureIgnore>
                    <excludes>
                        <exclude>**/*$*</exclude>
                        <exclude>**/TestSuite*</exclude>
<exclude>/junit/framework/TestSuite*</ exclude>
                        <exclude>/junit/**</exclude>
                    </excludes>
                </configuration>
            </plugin>

Try running maven with -X and see what surefire says about its excludes. Maybe you have to quote the dollar sign somehow.

hth,
- martin

--
SWITCH
Serving Swiss Universities
--------------------------
Chad La Joie, Software Engineer, Security
Werdstrasse 2, P.O. Box, 8021 Zürich, Switzerland
phone +41 44 268 15 75, fax +41 44 268 15 68
[EMAIL PROTECTED], http://www.switch.ch


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



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

Reply via email to