org.apache.tomcat.maven.it
Class AbstractWarProjectIT

java.lang.Object
  extended by org.apache.tomcat.maven.it.AbstractWarProjectIT
Direct Known Subclasses:
AbstractDeployWarOnlyProjectIT, AbstractDeployWarProjectIT, AbstractSimpleWarProjectIT, AbstractTomcatRunMultiConfigIT, AbstractUsageContextpathIT

public abstract class AbstractWarProjectIT
extends Object

Base class for all tests which have a war-project using the tomcat-maven-plugin below project-resources.

Author:
Mark Michaelis

Field Summary
protected  org.slf4j.Logger logger
           
protected  org.apache.maven.it.Verifier verifier
          Helper for Maven-Integration-Tests.
protected  File webappHome
          Where the war project got placed to.
 
Constructor Summary
AbstractWarProjectIT()
           
 
Method Summary
protected  String executeVerifyWithGet()
          Executes mvn verify and retrieves the response from the web application.
protected static String getAjpItPort()
           
protected  List<String> getCliOptions()
           
protected  String getGoal()
           
protected static String getHttpItPort()
           
protected static String getHttpsItPort()
           
protected  int getTimeout()
           
protected abstract  String getWarArtifactId()
          Artifact ID of the war project.
protected abstract  String getWebappUrl()
          This URL will be queried for content.
 void setUp()
           
 void tearDown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected org.slf4j.Logger logger

verifier

protected org.apache.maven.it.Verifier verifier
Helper for Maven-Integration-Tests.


webappHome

protected File webappHome
Where the war project got placed to.

Constructor Detail

AbstractWarProjectIT

public AbstractWarProjectIT()
Method Detail

getWebappUrl

protected abstract String getWebappUrl()
This URL will be queried for content. It will also be used to wait for the startup of the webapp.

Returns:
the URL to ping

getWarArtifactId

protected abstract String getWarArtifactId()
Artifact ID of the war project. Needed to uninstall any artifacts.

Returns:
artifact ID of the war project under test

setUp

public void setUp()
           throws Exception
Throws:
Exception

tearDown

public void tearDown()
              throws Exception
Throws:
Exception

executeVerifyWithGet

protected final String executeVerifyWithGet()
                                     throws org.apache.maven.it.VerificationException,
                                            InterruptedException,
                                            IOException
Executes mvn verify and retrieves the response from the web application.

Returns:
the response given
Throws:
org.apache.maven.it.VerificationException - if the verifier failed to execute the goal
InterruptedException - if the execution got interrupted in some way
IOException

getGoal

protected String getGoal()

getCliOptions

protected List<String> getCliOptions()

getTimeout

protected int getTimeout()

getHttpItPort

protected static String getHttpItPort()

getHttpsItPort

protected static String getHttpsItPort()

getAjpItPort

protected static String getAjpItPort()


Copyright © 2005–2014 The Apache Software Foundation. All rights reserved.