[jboss-dev-forums] [QA of JBoss Portal] - Re: SSO Unit Testing
julien@jboss.com
do-not-reply at jboss.com
Tue Sep 18 13:37:10 EDT 2007
there are 2 things about cargo:
- container life cycle control
- deployment
The portlet and web module use cargo to control an instance of a local container. (in addition of that the test framework has support for using cargo for deployment during the test, but it should not be used here)
In the future I want to migrate part of the sso integration in the web module and provide integrations with other platforms whenever it is possible.
Having the test case directly embed tomcat should not be done. Ant (or maven in the future) should control the life cycle of the container using the cargo start / stop.
Ant has also support for deploying into the container and also for shared classpath.
Here is an example used from the web module:
| <target name="cargo.tomcat-6.start" depends="cargo.setup">
| <cargo
| containerId="tomcat5x"
| home="${test.tomcat-6.home}"
| output="${cargo.log.dir}/cargo.${test.id}.server.log"
| log="${cargo.log.dir}/cargo.${test.id}.start.log"
| action="start"
| wait="${cargo.wait}">
| <sharedClasspath>
| <path location="${apache.log4j.lib}/log4j.jar"/>
| <path location="${oswego.concurrent.lib}/concurrent.jar"/>
| <path location="${jboss.portal/modules/common.lib}/portal-common-lib.jar"/>
| <path location="${sun.jaf.lib}/activation.jar"/>
| <path location="${junit.junit.lib}/junit.jar"/>
| <path location="${build.lib}/portal-web-lib.jar"/>
| </sharedClasspath>
| <configuration>
| <property name="cargo.servlet.port" value="8080"/>
| <property name="cargo.logging" value="high"/>
| <!--<property name="cargo.jvmargs" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"/>-->
| <deployable type="war" file="${codehaus.cargo.lib}/manager.war"/>
| <deployable type="war" file="${test.spi.server.path}"/>
| </configuration>
| </cargo>
| </target>
|
| <target name="cargo.tomcat-6.stop" depends="cargo.setup">
| <cargo
| containerId="tomcat5x"
| home="${test.tomcat-6.home}"
| log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
| action="stop">
| <configuration>
| </configuration>
| </cargo>
| </target>
|
Note the sharedClasspath attribute that is used to load classes visible by tomcat (equivalent to put jar in tomcat lib).
Note also the nested that will deploy the war files once the container has properly been started.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085650#4085650
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085650
More information about the jboss-dev-forums
mailing list