You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Farrukh Najmi <fa...@wellfleetsoftware.com> on 2007/08/23 00:54:09 UTC

Junit testing of webapps in maven

I have recently started using maven-jetty6-plugin for my webapp project.
A common problem is that the webapp needs to be deployed in order for
the junit tests to work. At present I manually start jetty6 server using 
"maven jetty6:run" and then manually run the junit tests in a separate 
process.

What is the best solution in maven for automatically testing a webapp 
such that the web container gets started, webapp gets deployed / 
hot-deployed and junit tests run as and wehn required?

Thanks for some guidance on this.

-- 
Regards,
Farrukh

Web: http://www.wellfleetsoftware.com



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


Re: Junit testing of webapps in maven

Posted by ml...@planwerk6.de.
Hi,

i think you meant "integration tests" and not unit tests. Take a look at the 
great maven book here:

http://www.sonatype.com/book/j2ee.html#integration_testing

If you need more help, please ask.

kind regards,
janning

Am Donnerstag, 23. August 2007 00:54 schrieb Farrukh Najmi:
> I have recently started using maven-jetty6-plugin for my webapp project.
> A common problem is that the webapp needs to be deployed in order for
> the junit tests to work. At present I manually start jetty6 server using
> "maven jetty6:run" and then manually run the junit tests in a separate
> process.
>
> What is the best solution in maven for automatically testing a webapp
> such that the web container gets started, webapp gets deployed /
> hot-deployed and junit tests run as and wehn required?
>
> Thanks for some guidance on this.




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


Re: Junit testing of webapps in maven

Posted by Michael McCallum <gh...@apache.org>.
junit and testng are testing tools if you use them to test little bits of code 
thats a unit test

if you use it to test the function of something e.g. via selenium then its a 
functional test

I test everything

easymock + testng + hsqldb + hibernate + jsf +selenium == testing from db to 
view

On Thursday 23 August 2007 16:49, noon wrote:
> I think the webapp doesn't prohibit to use the unit tests in any matter.
> Unit tests are just unit tests which purpose is to test a single method in
> a class. Unit tests shouldn't be depended on any other external tools like
> web server or database. If you like to to test the DAO layer, you can use
> e.g. the HSQL inmemory database as a datasource.
>
> Then there are other tools which "acts" like Http Server which allows you
> to test the controller (web layer) and JSP pages.
>
> Personally I don't test the controller layer atall... yet. I might start
> testing the jsp pages but for now I'm focusing on writing unit tests on the
> manager (business) level.

-- 
Michael McCallum
Enterprise Engineer
mailto:gholam@apache.org

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


Re: Junit testing of webapps in maven

Posted by noon <ra...@gmail.com>.
I think the webapp doesn't prohibit to use the unit tests in any matter. Unit
tests are just unit tests which purpose is to test a single method in a
class. Unit tests shouldn't be depended on any other external tools like web
server or database. If you like to to test the DAO layer, you can use e.g.
the HSQL inmemory database as a datasource.

Then there are other tools which "acts" like Http Server which allows you to
test the controller (web layer) and JSP pages. 

Personally I don't test the controller layer atall... yet. I might start
testing the jsp pages but for now I'm focusing on writing unit tests on the
manager (business) level. 
-- 
View this message in context: http://www.nabble.com/Junit-testing-of-webapps-in-maven-tf4314531s177.html#a12287522
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: Junit testing of webapps in maven

Posted by Maria Odea Ching <oc...@exist.com>.
Hi,

I haven't tried running unit tests on webapps before, but I would 
suggest you take a look at selenium-maven-plugin:

http://mojo.codehaus.org/selenium-maven-plugin/index.html

It's for integration testing and that might be more appropriate for 
testing webapps :)
You may want to look at Continuum's continuum-webapp-test module as an 
example.

Thanks,
Deng


Farrukh Najmi wrote:
>
> I have recently started using maven-jetty6-plugin for my webapp project.
> A common problem is that the webapp needs to be deployed in order for
> the junit tests to work. At present I manually start jetty6 server 
> using "maven jetty6:run" and then manually run the junit tests in a 
> separate process.
>
> What is the best solution in maven for automatically testing a webapp 
> such that the web container gets started, webapp gets deployed / 
> hot-deployed and junit tests run as and wehn required?
>
> Thanks for some guidance on this.
>


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


RE: Junit testing of webapps in maven

Posted by Robbrecht van Amerongen <Ro...@AMIS.nl>.
You can use JMeter for these functional tests. Use the Cargo pluigin to
deploy your application 
Then use the maven-jmeter-plugin.
http://wiki.apache.org/jakarta-jmeter/JMeterMavenPlugin to run your
functional tests. 

On http://technology.amis.nl/blog/?p=2364 you can find an article to get
this plugin running. 

Regards, 

Robbrecht


 

-----Original Message-----
From: Farrukh Najmi [mailto:farrukh@wellfleetsoftware.com] 
Sent: donderdag 23 augustus 2007 0:54
To: Maven Users List
Subject: Junit testing of webapps in maven


I have recently started using maven-jetty6-plugin for my webapp project.
A common problem is that the webapp needs to be deployed in order for
the junit tests to work. At present I manually start jetty6 server using

"maven jetty6:run" and then manually run the junit tests in a separate 
process.

What is the best solution in maven for automatically testing a webapp 
such that the web container gets started, webapp gets deployed / 
hot-deployed and junit tests run as and wehn required?

Thanks for some guidance on this.

-- 
Regards,
Farrukh

Web: http://www.wellfleetsoftware.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