Maven implements Web application integration test Automation-Deployment Automation (WebTest Maven Plugin)

Source: Internet
Author: User
Tags jboss

Previous: Maven implementation of Web application integration test Automation-Test automation (WebTest Maven Plugin)

Before describing how to use the WebTest plug-in to implement Web integration testing in Maven, here's a legacy issue where the Web app is already deployed in the container in service state when performing MAVEN's intergation test. Can the deployment of Web applications be automated? In our company's system, because of the use of WebLogic cluster, wrote their footsteps to achieve deployment, cost a lot of manpower and resources, in fact, Java Web applications have long been the gospel, is a plug-in artifact for automating the installation of containers and deploying applications: Cargo-maven2-plugin, which is compatible with all current mainstream servers such as JBoss, Tomcat, GlassFish, Jetty, and more.

Its configuration is simple, add cargo-maven2-plugin in Build, in order to implement integration test automation, declare the integration test phase before calling Cargo:start launch container and deploy the application, call Cargo:stop close the container after the integration test is finished. The default start container ends at the end of the Maven life cycle, and sometimes, for debugging convenience, you can call Cargo:run to start the container and deploy the app, and then run it through CTRL + C when needed.

In order to implement container start-up and deployment automation, you also need to provide some configuration parameters to plug-ins, here is an example, cargo there are many other features, for reference: Cargo automatic deployment of the official website

                     <plugin> <groupid>org.codehaus.cargo</gr Oupid> <artifactId>cargo-maven2-plugin</artifactId> <versio                                    N>${project.cargopluginversion}</version> <configuration> <!--definition Container--<container> <!--Co Ntainer Type Jetty/tomcat/weblogic/jboss etc--and <containerid>${project.cargo.contain                                 er}</containerid> <!--Specify the container download path, save the path, unzip the path, and place it in the target directory, which can be automatically erased when clean. <zipUrlInstaller> <url>${project.cargo.container. Url}</url> <downloaddir>${project.build.directory}/${project.cargo.contain Er}/downloads</downloAddir> <extractdir>${project.build.directory}/${project.cargo.container}/extr Acts</extractdir> </zipUrlInstaller> <!--c                                         Argo Log Storage-<log>${project.build.directory}/logs/cargo.log</log> <!--container Log storage--<output>${project.bu                            Ild.directory}/logs/container.out</output> </container>  <!--add container related configuration information-<configuration> <!-- Set deploy home--

Maven implements Web application integration test Automation-Deployment Automation (WebTest Maven Plugin)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.