You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by nani2ratna <na...@gmail.com> on 2009/03/06 08:36:16 UTC

Regarding junit test

Hi,

How does maven calls junit test cases when we run command mvn test.
and what is the surefire, how it runs, can any body send me the link of this
documentation

Thanks and regards 
ratna
-- 
View this message in context: http://www.nabble.com/Regarding-junit-test-tp22367494p22367494.html
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: Regarding junit test

Posted by Stephen Connolly <st...@gmail.com>.
2009/3/7 Juven Xu <ju...@sonatype.com>

> this should a properties file, which is available in your test classpath.
>
> your can retrieve it in your testcase, like:
>
> File testFile = new File("target/test-classes/test.properties");


noooo

access it as a resource from the classpath



>
>
> Note that all files under src/test/resources will be moved to
> target/test-classes/ when you run "mvn test"
> - Show quoted text -
>
> On Sat, Mar 7, 2009 at 7:22 AM, nani2ratna <na...@gmail.com> wrote:
>
> >
> > Hi,
> >
> > Thanks for your reply.
> > Now i understood that these tests run every time when ever we run the mvn
> > test.
> > There is a file called test.properties in the folder src/test/resources.
> > Can you tell me how can we use that.
> >
> > Thanks and Regards
> > Ratna
> >
> >
> > VanIngen, Erik (ESTG) wrote:
> > >
> > > Maven follows the convention over configuration principal.
> > >
> > > This means that by convention, all your tests within {your
> > > project}/src/test/java will be run automatically.
> > >
> > > Another convention is that Maven follows always this lifecycle:
> > >
> >
> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.htm
> > > l
> > >
> > > Running the tests is part of the Maven lifecycle.
> > >
> > > Surefire is the xml representation of the report of the build you run
> by
> > > Maven. You can find this xml in the {your
> > > project}//target/surefire-reports
> > > This xml can be used to make nice reports of the build.
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: nani2ratna [mailto:nani2ratna@gmail.com]
> > > Sent: Friday, March 06, 2009 8:36 AM
> > > To: users@maven.apache.org
> > > Subject: Regarding junit test
> > >
> > >
> > > Hi,
> > >
> > > How does maven calls junit test cases when we run command mvn test.
> > > and what is the surefire, how it runs, can any body send me the link of
> > > this
> > > documentation
> > >
> > > Thanks and regards
> > > ratna
> > > --
> > > View this message in context:
> > > http://www.nabble.com/Regarding-junit-test-tp22367494p22367494.html
> > > 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
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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/Regarding-junit-test-tp22367494p22382323.html
> > 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
> >
> >
>
>
> --
> - juven
>

Re: Regarding junit test

Posted by Juven Xu <ju...@sonatype.com>.
this should a properties file, which is available in your test classpath.

your can retrieve it in your testcase, like:

File testFile = new File("target/test-classes/test.properties");

Note that all files under src/test/resources will be moved to
target/test-classes/ when you run "mvn test"

On Sat, Mar 7, 2009 at 7:22 AM, nani2ratna <na...@gmail.com> wrote:

>
> Hi,
>
> Thanks for your reply.
> Now i understood that these tests run every time when ever we run the mvn
> test.
> There is a file called test.properties in the folder src/test/resources.
> Can you tell me how can we use that.
>
> Thanks and Regards
> Ratna
>
>
> VanIngen, Erik (ESTG) wrote:
> >
> > Maven follows the convention over configuration principal.
> >
> > This means that by convention, all your tests within {your
> > project}/src/test/java will be run automatically.
> >
> > Another convention is that Maven follows always this lifecycle:
> >
> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.htm
> > l
> >
> > Running the tests is part of the Maven lifecycle.
> >
> > Surefire is the xml representation of the report of the build you run by
> > Maven. You can find this xml in the {your
> > project}//target/surefire-reports
> > This xml can be used to make nice reports of the build.
> >
> >
> >
> > -----Original Message-----
> > From: nani2ratna [mailto:nani2ratna@gmail.com]
> > Sent: Friday, March 06, 2009 8:36 AM
> > To: users@maven.apache.org
> > Subject: Regarding junit test
> >
> >
> > Hi,
> >
> > How does maven calls junit test cases when we run command mvn test.
> > and what is the surefire, how it runs, can any body send me the link of
> > this
> > documentation
> >
> > Thanks and regards
> > ratna
> > --
> > View this message in context:
> > http://www.nabble.com/Regarding-junit-test-tp22367494p22367494.html
> > 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
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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/Regarding-junit-test-tp22367494p22382323.html
> 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
>
>


-- 
- juven

RE: Regarding junit test

Posted by nani2ratna <na...@gmail.com>.
Hi,

Thanks for your reply.
Now i understood that these tests run every time when ever we run the mvn
test.
There is a file called test.properties in the folder src/test/resources.
Can you tell me how can we use that.

Thanks and Regards
Ratna


VanIngen, Erik (ESTG) wrote:
> 
> Maven follows the convention over configuration principal. 
> 
> This means that by convention, all your tests within {your
> project}/src/test/java will be run automatically. 
> 
> Another convention is that Maven follows always this lifecycle:
> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.htm
> l
> 
> Running the tests is part of the Maven lifecycle. 
> 
> Surefire is the xml representation of the report of the build you run by
> Maven. You can find this xml in the {your
> project}//target/surefire-reports
> This xml can be used to make nice reports of the build. 
> 
> 
> 
> -----Original Message-----
> From: nani2ratna [mailto:nani2ratna@gmail.com] 
> Sent: Friday, March 06, 2009 8:36 AM
> To: users@maven.apache.org
> Subject: Regarding junit test
> 
> 
> Hi,
> 
> How does maven calls junit test cases when we run command mvn test.
> and what is the surefire, how it runs, can any body send me the link of
> this
> documentation
> 
> Thanks and regards 
> ratna
> -- 
> View this message in context:
> http://www.nabble.com/Regarding-junit-test-tp22367494p22367494.html
> 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
> 
> 
> 
> ---------------------------------------------------------------------
> 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/Regarding-junit-test-tp22367494p22382323.html
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: Regarding junit test

Posted by "VanIngen, Erik (ESTG)" <Er...@fao.org>.
Maven follows the convention over configuration principal. 

This means that by convention, all your tests within {your
project}/src/test/java will be run automatically. 

Another convention is that Maven follows always this lifecycle:
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.htm
l

Running the tests is part of the Maven lifecycle. 

Surefire is the xml representation of the report of the build you run by
Maven. You can find this xml in the {your project}//target/surefire-reports
This xml can be used to make nice reports of the build. 



-----Original Message-----
From: nani2ratna [mailto:nani2ratna@gmail.com] 
Sent: Friday, March 06, 2009 8:36 AM
To: users@maven.apache.org
Subject: Regarding junit test


Hi,

How does maven calls junit test cases when we run command mvn test.
and what is the surefire, how it runs, can any body send me the link of this
documentation

Thanks and regards 
ratna
-- 
View this message in context:
http://www.nabble.com/Regarding-junit-test-tp22367494p22367494.html
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



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


Re: Regarding junit test

Posted by Juven Xu <ju...@sonatype.com>.
http://maven.apache.org/plugins/maven-surefire-plugin/

On Fri, Mar 6, 2009 at 3:36 PM, nani2ratna <na...@gmail.com> wrote:

>
> Hi,
>
> How does maven calls junit test cases when we run command mvn test.
> and what is the surefire, how it runs, can any body send me the link of
> this
> documentation
>
> Thanks and regards
> ratna
> --
> View this message in context:
> http://www.nabble.com/Regarding-junit-test-tp22367494p22367494.html
> 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
>
>


-- 
- juven