On Thu, Apr 29, 2010 at 11:32 AM, Suhothayan Sriskandarajah <[email protected]> wrote: > On 28 April 2010 12:30, Avdhesh Yadav <[email protected]> wrote: >> >> Updated to Dojo 1.4.2 >> > thanks Avidash, > > I'm now integrating HtmlUnit with PhotArk. > but when I'm doing so I encountered this problem.. > > For the HtmlUnit test to pass we should first start the server before > testing. > Otherwise the test case fails saying that it couldn't connect to the server. > > the problem is, when automating HtmlUnit testing we cant always start the > server > and if we don't start the server the build will be failing. > > here we cannot use > > maven.skip.test=true > > or smiler alternatives because they will skip all the tests. > > Therefore I'm suggesting the to rename these htmlunit test cases as > XXXXTestBrwser > by renaming these the maven-surefire-plugin wont test these test cases. > this is because we have defined test as > <include>**/*TestCase.java</include> > > and it we want to test these HtmlUnit test cases > we can start the server and run > > mvn -Dtest=*TestBrwser test > > which will only run the test cases wish ends with TestBrwser.java > > Please give your suggesting and let me know whether I'm implementing this in > the correct way ? > > Regards > Suho > >
This seems like chicken/egg thing, but mainly because the test is being added together with the UI module. Here are some possible ideas to overcome this issue : - Move tests to a integration test folder (e.g /iTest/photark) - Use some maven plugin that would handle the integration with the application server (and manage the lifecycle for example) and run the tests afterwards (e.g cargo plugin [1]) I hope this can give you some ideas on how to solve the problem, but i understand it does not have all the details... [1] http://cargo.codehaus.org/Maven2+plugin [2] http://cargo.codehaus.org/Tomcat+6.x -- Luciano Resende http://people.apache.org/~lresende http://twitter.com/lresende1975 http://lresende.blogspot.com/
