com.xebialabs.deployit.test.support.onthefly
Class WarOnTheFly
java.lang.Object
com.xebialabs.deployit.test.support.onthefly.JarOnTheFly
com.xebialabs.deployit.test.support.onthefly.WarOnTheFly
public class WarOnTheFly
- extends JarOnTheFly
Constructs a WAR for testing, accepting multiple resources and test servlets
as entries. Test servlets are automatically mapped to a path that is the servlet class' simple name,
so e.g. a com.acme.package.TestJeeResourceServlet will be bound to http://myhost:myport/context-root/TestJeeResourceServlet.
The actual WAR file is finally written to a temporary directory. Example:
WarOnTheFly warOnTheFly = new WarOnTheFly("myWar");
warOnTheFly.addFile("foo", someFile);
warOnTheFly.addFile("bar", someResource);
...
warOnTheFly.addServlet(FooServlet.class); // will be mapped to http://myhost:myport/context-root/FooServlet
warOnTheFly.addServlet(BarServlet.class);
...
File war = warOnTheFly.writeToTemporaryFile(); // something like myWarXX.war
See also "
Middleware integration testing with JUnit, Maven and VMware: part 2".
- See Also:
JarOnTheFly
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WarOnTheFly
public WarOnTheFly(java.lang.String name)
addServlet
public void addServlet(java.lang.Class<? extends javax.servlet.Servlet> servletClass)
writeToTemporaryFile
public java.io.File writeToTemporaryFile()
throws java.io.IOException
- Throws:
java.io.IOException
addWebXml
public void addWebXml()
getName
public java.lang.String getName()
Copyright © 2010. All Rights Reserved.