You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Niranjan Rao <nh...@gmail.com> on 2015/02/12 17:27:04 UTC

Sanity testing of the web application using jetty

Greetings,

Looking for ideas/suggestions to sanity test the web application. I had 
a junit test working in eclipse, but it does not work when running mvn 
test.  My eventual goal was to run this test as integration test on jenkins.

My web application needs access to a properties file to read 
configuration information. A master working copy of properties file is 
committed to src/test/resources folder. Different teams have created 
HSQLDB test databases relating to their tests and are available at well 
known locations.

My current test case the "setup" function copies the database to temp 
directory,  creates the copy of master properties file and changes the 
properties file to use copied database. It then starts jetty, loads the 
web application and then runs the html unit tests.

It works perfectly in eclipse, but when executing mvn test, jetty server 
starts but application does not work because many libraries are missing 
- e.g. it complains about not finding JSP library. My reasoning is it 
has to do between differences of class path between eclipse and maven.

I read about jetty plugin, but not sure if I can configure maven to do 
copy/replace part so that web application has proper properties file 
before it starts.

Is this the right way to run this kind of test? I want tests to work 
against copy of database as many actions are modifying  database. Can I 
somehow convince maven to allow me modification of properties file.

Alternatively, since test is working in eclipse (with m2e), can I 
convince maven to use same classpath so that test runs using mvn command?

Regards,

Niranjan




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


RE: Sanity testing of the web application using jetty

Posted by Martin Gainty <mg...@hotmail.com>.


> Date: Thu, 12 Feb 2015 08:27:04 -0800
> From: nhrdls@gmail.com
> To: users@maven.apache.org
> Subject: Sanity testing of the web application using jetty
> 
> Greetings,
> 
> Looking for ideas/suggestions to sanity test the web application. I had 
> a junit test working in eclipse, but it does not work when running mvn 
> test.  My eventual goal was to run this test as integration test on jenkins.
> 
> My web application needs access to a properties file to read 
> configuration information. A master working copy of properties file is 
> committed to src/test/resources folder. Different teams have created 
> HSQLDB test databases relating to their tests and are available at well 
> known locations.
> 
> My current test case the "setup" function copies the database to temp 
> directory,  creates the copy of master properties file and changes the 
> properties file to use copied database. It then starts jetty, loads the 
> web application and then runs the html unit tests.
> 
> It works perfectly in eclipse, but when executing mvn test, jetty server 
> starts but application does not work because many libraries are missing 
> - e.g. it complains about not finding JSP library. My reasoning is it 
> has to do between differences of class path between eclipse and maven.
> 
> I read about jetty plugin, but not sure if I can configure maven to do 
> copy/replace part so that web application has proper properties file 
> before it starts.
> 
> Is this the right way to run this kind of test? I want tests to work 
> against copy of database as many actions are modifying  database. Can I 
> somehow convince maven to allow me modification of properties file.
> 
> Alternatively, since test is working in eclipse (with m2e), can I 
> convince maven to use same classpath so that test runs using mvn command?

MG>Resolving Maven dependencies from the Eclipse workspace without installing to local Maven MG>repository..Have you looked at using the m2e plugin?
MG>doc: http://eclipse.org/m2e/
MG>eclipse plugin: http://download.eclipse.org/technology/m2e/releases
> 
> Regards,
> 
> Niranjan
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>