You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ni...@arsoe-trelaze.com on 2004/06/18 16:31:05 UTC

Réf. : Problem with and in unitTest

Use the exclude only for file regexp who match the include regexp that you 
don't want to include in your unit test (**/*AbstractTest.java for 
example).
unitTestSourceDirectory must be set to your test directory (src/test)

 <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
                <unitTest>
                        <includes>
                                <include>**/*Test.java</include>
                        </includes>
                        <resources>
                                <resource>
                                        <directory>src</directory>
                                        <includes>
 <include>**/*.xml</include>
                                        </includes>
                                </resource>
                        </resources>
                </unitTest>

Nicolas,





Josip Gracin <gr...@tel.fer.hr>
18/06/2004 15:42
Veuillez répondre à "Maven Users List"

 
        Pour :  users@maven.apache.org
        cc : 
        Objet : Problem with <includes> and <excludes> in unitTest


Hello!

Could somebody please tell me why the following code from project.xml 
still 
tries to compile several hundred test classes when I run 
"maven clean test:compile"?  As far as I understand the <includes>'s and 
<excludes>'s, this should exclude all files and it should not compile 
anything, right?

                <unitTestSourceDirectory>src</unitTestSourceDirectory>
                <unitTest>
                        <includes>
                                <include>**/*Test.java</include>
                        </includes>
                        <excludes>
                                <exclude>**/*</exclude>
                        </excludes>
                        <resources>
                                <resource>
                                        <directory>src</directory>
                                        <includes>
 <include>**/*.xml</include>
                                        </includes>
                                </resource>
                        </resources>
                </unitTest>

Thanks in advance!


---------------------------------------------------------------------
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: Réf. : Problem with and in unitTest

Posted by Josip Gracin <gr...@tel.fer.hr>.
Hi, thanks for the quick reply!

On Friday 18 June 2004 16:31, Nicolas.CHALUMEAU@arsoe-trelaze.com wrote:
> Use the exclude only for file regexp who match the include regexp that you
> don't want to include in your unit test (**/*AbstractTest.java for
> example).

I see.  But here is what I want to do.  I have all the sources and tests in 
the same tree called 'src'.  Now, I want to use as tests only classes that 
match *Test.java, but at the same time don't match a group of *Test.java 
files which are located in com.company.experiments package.

<unitTestSourceDirectory>src</unitTestSourceDirectory>
<unitTest>
	<includes>
		<include>**/*Test.java</include>
	</includes>
	<excludes>
		<exclude>com/company/experiments/**/*</exclude>
	</excludes>
</unitTest>

When I use <include>**/*Test.java</include>, does this mean that only classes 
that end with Test.java will be compiled as tests?  Because it doesn't work 
for me for some reason.  This include is ignored and every possible class in 
the src directory gets included.

> unitTestSourceDirectory must be set to your test directory (src/test)

Unfortunately, this is an old project that we have and all tests are in the 
same directory as the sources.  

BTW, I use maven-1.0rc3.


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


Re: Réf. : Problem with and in unitTest

Posted by Josip Gracin <gr...@tel.fer.hr>.
I have attached the <build> element from my project.xml file.  And partial 
output of maven -X clean test:compile is available at

http://veeone.tel.fer.hr/out.txt

Best regards,
Josip