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.

48 comments:

  1. I agree with your post. Selenium is most used automation tool to test web application and browser. This automation tool offers precise and complete information about a software application or environment. Selenium Training in Chennai

    ReplyDelete
  2. 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
  3. The best thing is that your blog really informative thanks for your great information!
    erp in chennai

    ReplyDelete
  4. Interesting post! This is really helpful for me. I like it! Thanks for sharing!

    Webseiten Gestaltung Lüdenscheid

    ReplyDelete
  5. Interesting post! This is really helpful for me. I like it! Thanks for sharing!
    microsoft office online

    ReplyDelete
  6. Interesting post! This is really helpful for me. I like it! Thanks for sharing!
    online marketing lüdenscheid

    ReplyDelete
  7. The website is looking bit flashy and it catches the visitors eyes. A design is pretty simple .
    online marketing lüdenscheid

    ReplyDelete
  8. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
    aws training in Chennai

    ReplyDelete
  9. The website is looking bit flashy and it catches the visitors eyes. A design is pretty simple .
    regionale stellenbörse

    ReplyDelete
  10. 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
  11. 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
  12. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…
    Summer Courses for Android in Perungudi | Summer Courses for IOS in Velachery | Summer Courses in OMR

    ReplyDelete
  13. 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
  14. Nice post... Really you are done a wonderful job. Thanks for sharing such wonderful information with us. Please keep on updating... Summer Camp for Computer Science in Velachery | Summer classes for Computer Science in Chennai | Summer Courses for Computer Science in Taramani

    ReplyDelete
  15. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…
    Summer Courses for Android in Perungudi | Summer Courses for IOS in Velachery | Summer Courses in OMR

    ReplyDelete
  16. 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
  17. It is very useful information. It will help to improve my knowledge in Selenium. Thank you for sharing this awesome site.
    Selenium Training in Chennai | Selenium Training | Selenium Course in Chennai | Selenium Training Institute in Chennai

    ReplyDelete
  18. 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
  19. Really its a very good article, thanks for taking the time to discuss this, I feel happy about and I love learning more about this topic. Graphic Designing Summer Courses in Velachery | Graphic Designing Summer Courses in Chennai | Graphic Designing Summer Courses in Taramani

    ReplyDelete
  20. 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
  21. 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
  22. 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
  23. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…
    Pearson Vue Testing Center in Chennai | Java Exam Center in Velachery | Microsoft Dot net Certification in Velachery

    ReplyDelete
  24. Awesome Blog with informative concept. Really I feel happy to see this useful blog, Thanks for sharing such a nice blog. Linux Exam Center in Chennai | CCNA Exam Center in Chennai | CCNP Exam Center in Chennai

    ReplyDelete
  25. 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
  26. 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
  27. Extraordinary blog. you put Good stuff. All the themes were clarified briefly.Thanks for sharing that post.Keep in blogging…
    No.1 Software Testing Training Institute in Chennai | Best Selenium Training Institute in Chennai | Web Designing Training Institute in Chennai

    ReplyDelete
  28. Excellent post. I am really impressed the way you have written the article. I have gained some insight knowledge about the topic

    Linux Course in Chennai | Linux Training | Learn Linux | Linux Course in Adyar | Linux Course in Tambaram | Linux Course in Velachery

    ReplyDelete

Popular Posts

Followers