You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Scott Purcell <sp...@gmail.com> on 2007/07/30 22:42:23 UTC
Running a single JUnit test
Hello,
Maven 2.0.7
I have a project that encompases different projects, so I have a
parent pom with children. I created a JUnit test called
InternalDAOTest.java. In my pom, I have the following:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>
So I would think I should be able to run my file like so:
mvn -Dtest=com.xxx.xxxx.InternalDAO
but it does not run, it scans for projects and reports back
BUILD FAILURE. You must specify at least one goal.
So then I try
mvn -Dtest=com.xxx.xxxx.InternalDAO test and it runs a bunch of
other testSuites etc but not my one test.
How should it run a single JUnit test with 16 tests? Anyone?
Kind of stuck here.
Thanks,
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Running a single JUnit test
Posted by zalym <mo...@gmail.com>.
Is that supposed to be advantageous? If I want to run a lot of tests, then
yea. Otherwise I need to take care while naming my tests
Wendy Smoak-3 wrote:
>
> On 9/23/07, zalym <mo...@gmail.com> wrote:
>>
>> It works without the package name right? When I give the test with the
>> package name, it exits with a no tests to run message, where as when I
>> try
>> without the packagename, then it works.
>
> Correct. It uses a pattern like **/*${test} so you don't need the
> package name/directory path.
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Running-a-single-JUnit-test-tf4179089s177.html#a12851587
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Running a single JUnit test
Posted by Wendy Smoak <ws...@gmail.com>.
On 9/23/07, zalym <mo...@gmail.com> wrote:
>
> It works without the package name right? When I give the test with the
> package name, it exits with a no tests to run message, where as when I try
> without the packagename, then it works.
Correct. It uses a pattern like **/*${test} so you don't need the
package name/directory path.
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Running a single JUnit test
Posted by zalym <mo...@gmail.com>.
It works without the package name right? When I give the test with the
package name, it exits with a no tests to run message, where as when I try
without the packagename, then it works.
benshort wrote:
>
> *mvn -Dtest=com.xxx.xxxx.InternalDAOTest test
>
> On 7/30/07, ben short <be...@benshort.co.uk> wrote:
>> Your missing test from the end of your class name, see [1]
>>
>> mvn -Dtest=com.xxx.xxxx.InternalDAOtest test
>>
>>
>> [1]
>> http://maven.apache.org/plugins/maven-surefire-plugin/examples/single-test.html
>>
>>
>>
>> On 7/30/07, Scott Purcell <sp...@gmail.com> wrote:
>> > Hello,
>> > Maven 2.0.7
>> >
>> > I have a project that encompases different projects, so I have a
>> > parent pom with children. I created a JUnit test called
>> > InternalDAOTest.java. In my pom, I have the following:
>> >
>> >
>> > <plugin>
>> > <groupId>org.apache.maven.plugins</groupId>
>> > <artifactId>maven-surefire-plugin</artifactId>
>> > <configuration>
>> > <includes>
>> > <include>**/*Test.java</include>
>> > </includes>
>> > </configuration>
>> > </plugin>
>> >
>> > So I would think I should be able to run my file like so:
>> > mvn -Dtest=com.xxx.xxxx.InternalDAO
>> > but it does not run, it scans for projects and reports back
>> > BUILD FAILURE. You must specify at least one goal.
>> >
>> > So then I try
>> > mvn -Dtest=com.xxx.xxxx.InternalDAO test and it runs a bunch of
>> > other testSuites etc but not my one test.
>> >
>> > How should it run a single JUnit test with 16 tests? Anyone?
>> > Kind of stuck here.
>> >
>> > Thanks,
>> >
>> > ---------------------------------------------------------------------
>> > 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
>
>
>
--
View this message in context: http://www.nabble.com/Running-a-single-JUnit-test-tf4179089s177.html#a12850153
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Running a single JUnit test
Posted by ben short <be...@benshort.co.uk>.
*mvn -Dtest=com.xxx.xxxx.InternalDAOTest test
On 7/30/07, ben short <be...@benshort.co.uk> wrote:
> Your missing test from the end of your class name, see [1]
>
> mvn -Dtest=com.xxx.xxxx.InternalDAOtest test
>
>
> [1] http://maven.apache.org/plugins/maven-surefire-plugin/examples/single-test.html
>
>
>
> On 7/30/07, Scott Purcell <sp...@gmail.com> wrote:
> > Hello,
> > Maven 2.0.7
> >
> > I have a project that encompases different projects, so I have a
> > parent pom with children. I created a JUnit test called
> > InternalDAOTest.java. In my pom, I have the following:
> >
> >
> > <plugin>
> > <groupId>org.apache.maven.plugins</groupId>
> > <artifactId>maven-surefire-plugin</artifactId>
> > <configuration>
> > <includes>
> > <include>**/*Test.java</include>
> > </includes>
> > </configuration>
> > </plugin>
> >
> > So I would think I should be able to run my file like so:
> > mvn -Dtest=com.xxx.xxxx.InternalDAO
> > but it does not run, it scans for projects and reports back
> > BUILD FAILURE. You must specify at least one goal.
> >
> > So then I try
> > mvn -Dtest=com.xxx.xxxx.InternalDAO test and it runs a bunch of
> > other testSuites etc but not my one test.
> >
> > How should it run a single JUnit test with 16 tests? Anyone?
> > Kind of stuck here.
> >
> > Thanks,
> >
> > ---------------------------------------------------------------------
> > 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: Running a single JUnit test
Posted by Scott Purcell <sp...@gmail.com>.
Thanks Ben that was it.
I got screwed up because the docs say the following:
"The value for the test parameter is the name of the test class
(without the extension)."
so I assumed the extension was Test and so I kept leaving it off.
Thanks,
Mondays.....
On 7/30/07, ben short <be...@benshort.co.uk> wrote:
> Your missing test from the end of your class name, see [1]
>
> mvn -Dtest=com.xxx.xxxx.InternalDAOtest test
>
>
> [1] http://maven.apache.org/plugins/maven-surefire-plugin/examples/single-test.html
>
>
>
> On 7/30/07, Scott Purcell <sp...@gmail.com> wrote:
> > Hello,
> > Maven 2.0.7
> >
> > I have a project that encompases different projects, so I have a
> > parent pom with children. I created a JUnit test called
> > InternalDAOTest.java. In my pom, I have the following:
> >
> >
> > <plugin>
> > <groupId>org.apache.maven.plugins</groupId>
> > <artifactId>maven-surefire-plugin</artifactId>
> > <configuration>
> > <includes>
> > <include>**/*Test.java</include>
> > </includes>
> > </configuration>
> > </plugin>
> >
> > So I would think I should be able to run my file like so:
> > mvn -Dtest=com.xxx.xxxx.InternalDAO
> > but it does not run, it scans for projects and reports back
> > BUILD FAILURE. You must specify at least one goal.
> >
> > So then I try
> > mvn -Dtest=com.xxx.xxxx.InternalDAO test and it runs a bunch of
> > other testSuites etc but not my one test.
> >
> > How should it run a single JUnit test with 16 tests? Anyone?
> > Kind of stuck here.
> >
> > Thanks,
> >
> > ---------------------------------------------------------------------
> > 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Running a single JUnit test
Posted by ben short <be...@benshort.co.uk>.
Your missing test from the end of your class name, see [1]
mvn -Dtest=com.xxx.xxxx.InternalDAOtest test
[1] http://maven.apache.org/plugins/maven-surefire-plugin/examples/single-test.html
On 7/30/07, Scott Purcell <sp...@gmail.com> wrote:
> Hello,
> Maven 2.0.7
>
> I have a project that encompases different projects, so I have a
> parent pom with children. I created a JUnit test called
> InternalDAOTest.java. In my pom, I have the following:
>
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-surefire-plugin</artifactId>
> <configuration>
> <includes>
> <include>**/*Test.java</include>
> </includes>
> </configuration>
> </plugin>
>
> So I would think I should be able to run my file like so:
> mvn -Dtest=com.xxx.xxxx.InternalDAO
> but it does not run, it scans for projects and reports back
> BUILD FAILURE. You must specify at least one goal.
>
> So then I try
> mvn -Dtest=com.xxx.xxxx.InternalDAO test and it runs a bunch of
> other testSuites etc but not my one test.
>
> How should it run a single JUnit test with 16 tests? Anyone?
> Kind of stuck here.
>
> Thanks,
>
> ---------------------------------------------------------------------
> 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