Saturday, August 28, 2010

Cargo, Maven and the benefits of integrated functional testing

I little while back an ex-colleague mentioned that I should have a look at an open source project called Cargo. So what is Cargo, their mission statement states "Cargo is a thin wrapper that allows you to manipulate Java EE containers in a standard way." and that is exactly what they do.

In 2 of my previous posts:
Some useful Maven configurations
and
Your POM is quite nice

I went through some maven configurations and practices along with the concept of continuous integration. This article and Cargo make a logical "Part 3". In the above 2 articles there is a lot of emphasis on continuous testing, but with some very large / legacy systems total unit test coverage is something of a luxury and quite often neglected. Depending on the size, type and deployment of the application there will be certain circumstances where to quickly gain, promote and gauge system stability, integration or functional testing will be a much faster and more beneficial practice than retro fitting unit test coverage.

Tools like Selenium, QTP (QuickTestPro) a number of others, allow you to simply record, playback and validate the application. In my current environment and I am sure in a lot of other places, these types of tests are run by people outside the development team, namely testing teams, clients or even business analysts. I personally feel to gain the most benefit out of functional testing and automation tools these need to happen at build time. Having these tests run outside of the standard development environment add extra unneeded iterations, and more external dependencies that can delay a software project. Bringing these type of tests into you build process allow you detect, maintain and repair system issues before influencing the world outside the development environment.

Like everything else surrounding the "continuous integration" philosophy, automation is key. This is were Cargo helps you out. If you already have the other tools like Maven and Hudson setup it is very quick to integrate and benefit from Cargo.

My environment runs on Weblogic, so that is what I will be using as my example, but Cargo supports about all the major web and application servers used. So this should work for anyone.

Maven has the concept of phases which can be thought of like a collection of goals. A full list of the phases of Maven is available here: Lifecycle Reference

The 3 we are interesting in with regards to Cargo are:
pre-integration-test
perform actions required before integration tests are executed. This may involve things such as setting up the required environment.
integration-test
Process and deploy the package if necessary into an environment where integration tests can be run.
post-integration-test
Perform actions required after integration tests have been executed. This may including cleaning up the environment.

So any phase higher than ’pre-integration-test’ will trigger the deployment to your application server.

Cargo can only stop and start local application servers, deployments can take place remotely, not all application servers have "deployers", detail for these are on the Cargo site. The one feature I am very happy with is the server properties. You can from within you POM configure all the required, JDBC, JMS, and JVM settings you require for your application server to function, which is awesome. In my examples I just needed JVM and JDBC settings, but theoretically you should be able to configure most things you may require.

You could integrate the Cargo plugin into your existing POMs, I prefer to keep it separate. I am not including any Selenium configuration to keep this post about Cargo. However here is a very nice Maven Selenium Guide.

So for the local server configuration, this will startup the application server, create the JDBC configuration and deploy the war.

35 comments:

  1. Nice..Its informative...You have clearly explained about the concept..Its very useful for me to understand..Keep on sharing..
    Selenium training in chennai

    ReplyDelete
  2. Nice post.. Really you are done a wonderful job. Thanks for sharing such wonderful information with us. Please keep on updating...
    Excellent Summer Courses for Business Administration in Chennai | Perfect Summer Courses in Guindy

    ReplyDelete
  3. Excellent explanation about new technology., its very interesting to read.. Thanks for sharing such a nice article...
    Good Summer Courses for Hardware and Networking in Chennai | Perfect Vacation Courses in Chennai

    ReplyDelete
  4. Impressive blog with lovely information. really very useful article for us thanks for sharing such a wonderful blog... 
    Summer Camp for Kids in Chennai | Summer courses in Shozhinganallur | Summer classes in Chennai

    ReplyDelete
  5. This is a really good list to reference. It spawns ideas, especially for me. I haven’t started blogging yet, but I have been thinking about it.
    Best Multimedia Vacation Course in Chennai | No.1 Summer Courses in Porur

    ReplyDelete
  6. Impressive blog with lovely information. really very useful article for us thanks for sharing such a wonderful blog... 
    Summer Courses in Perungudi | Summer Courses in OMR | Summer Courses in Velachery

    ReplyDelete
  7. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information, this is useful to me…
    Software Testing Summer Courses in Adyar | Summer Courses in Velachery | Java Summer Courses in Perungudi

    ReplyDelete
  8. Thanks for this grateful information. all this information is very important to all the users and can be used good at all this process.
    Selenium Summer Courses in Velachery | Web designing summer Classes in Adyar | Android summer Courses in OMR

    ReplyDelete
  9. The information you shared is very effective for learners I have got some important suggestions from it, Keep Sharing such a nice blog.
    UIPath Exam Center in Chennai | Automation Anywhere Exam Center in Chennai | Blue Prism Exam Center in Chennai

    ReplyDelete
  10. Great Blog, The information you shared is very effective for learners I have got some important suggestions from it. Thank you...
    Cisco CCNA Certification Center in Chennai | Best Cisco Center in Guindy

    ReplyDelete
  11. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more...
    Python Certification Training Institute in Chennai | Best Python Center in Taramani

    ReplyDelete
  12. You are doing a great job. I would like to appreciate your work. clearly explained
    Regards
    Machine Learning Training

    ReplyDelete
  13. I like this blog and This content is very useful for me. I was very impressed by your written style and thanks for your brief explanation. Good job...!
    Tableau Course in Chennai
    Tableau Certification in Chennai
    Primavera Training in Chennai
    Spark Training in Chennai
    Unix Training in Chennai
    Linux Training in Chennai

    ReplyDelete

Popular Posts

Followers