Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

The following examples demonstrate how to configure Resin 3.0.15 to start in target/resin3x and deploy a WAR located in path/to/simple.war using the Java API. The default port is 8080. Please note that the container.start() and container.stop() methods wait until the container is fully started and fully stopped before continuing. Thus, for any action you are executing after, you are assured the container is completely operational.

Info
titleANT tasks and Maven2 plugin

CARGO can be used using its Java API as it is shown here. In addition to a Java API, CARGO also has ANT tasks and a Maven2 plugin:

Static deployment

Static deployment means that the Deployable is deployed before the container is started. Here's an example using the strongly typed Java API:

Wiki Markup
{snippet:lang=java|id=qs-typed|url=http://svn.codehaus.org/cargo/core/trunk/documentation/src/main/java/org/codehaus/cargo/documentation/Snippets.java}

Here's the same example using the generic untyped API (which we recommend as it leads to more generic code):

Wiki Markup
{snippet:lang=java|id=qs-untyped|url=http://svn.codehaus.org/cargo/core/trunk/documentation/src/main/java/org/codehaus/cargo/documentation/Snippets.java}

Hot deployment

Hot deployment means that the Deployable is deployed after the container is started.

Wiki Markup
{snippet:lang=java|id=qs-deploy|url=http://svn.codehaus.org/cargo/core/trunk/documentation/src/main/java/org/codehaus/cargo/documentation/Snippets.java}

Functional tests

For a detailed documentation on how to use Cargo for executing functional tests on a container, directly from your Java unit test classes (JUnit, TestNG, etc), read our Functional testing page.