Author: mwringe
Date: 2009-09-30 23:58:59 -0400 (Wed, 30 Sep 2009)
New Revision: 220
Added:
components/wci/trunk/.settings/
components/wci/trunk/exo/
components/wci/trunk/exo/pom.xml
components/wci/trunk/exo/src/
components/wci/trunk/exo/src/main/
components/wci/trunk/exo/src/main/java/
components/wci/trunk/exo/src/main/java/org/
components/wci/trunk/exo/src/main/java/org/exoplatform/
components/wci/trunk/exo/src/main/java/org/exoplatform/services/
components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/
components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/
components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/
components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/PortletApplicationListener.java
components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/ServletWrapper.java
components/wci/trunk/jetty/
components/wci/trunk/jetty/pom.xml
components/wci/trunk/jetty/src/
components/wci/trunk/jetty/src/main/
components/wci/trunk/jetty/src/main/java/
components/wci/trunk/jetty/src/main/java/org/
components/wci/trunk/jetty/src/main/java/org/gatein/
components/wci/trunk/jetty/src/main/java/org/gatein/wci/
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6Handler.java
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6WebAppContext.java
components/wci/trunk/test/
components/wci/trunk/test/.project
components/wci/trunk/test/pom.xml
components/wci/trunk/test/src/
components/wci/trunk/test/src/test/
components/wci/trunk/test/src/test/build.xml
components/wci/trunk/test/src/test/java/
components/wci/trunk/test/src/test/resources/
components/wci/trunk/tomcat/
components/wci/trunk/tomcat/pom.xml
components/wci/trunk/tomcat/src/
components/wci/trunk/tomcat/src/main/
components/wci/trunk/tomcat/src/main/java/
components/wci/trunk/tomcat/src/main/java/org/
components/wci/trunk/tomcat/src/main/java/org/gatein/
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ContainerServlet.java
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6LifecycleListener.java
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6WebAppContext.java
components/wci/trunk/wci/src/main/java/org/gatein/wci/api/GateInServletListener.java
Removed:
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/jetty/
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/tomcat/
components/wci/trunk/wci/src/test/build.xml
components/wci/trunk/wci/src/test/java/
components/wci/trunk/wci/src/test/resources/
Modified:
components/wci/trunk/build/pom.xml
components/wci/trunk/pom.xml
components/wci/trunk/wci/pom.xml
components/wci/trunk/wci/src/main/java/org/gatein/wci/api/GateInServlet.java
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/generic/GenericServletContainerContext.java
Log:
Split up wci component into multiple submodules.
Modified: components/wci/trunk/build/pom.xml
===================================================================
--- components/wci/trunk/build/pom.xml 2009-10-01 03:25:02 UTC (rev 219)
+++ components/wci/trunk/build/pom.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -23,6 +23,9 @@
<name>GateIn - Web Container Integration component (parent)</name>
<properties>
+ <maven.compiler.source>1.5</maven.compiler.source>
+ <maven.compiler.target>1.5</maven.compiler.target>
+
<version.concurrent>1.3.4</version.concurrent>
<version.servlet.api>2.5</version.servlet.api>
<version.apache.tomcat>6.0.16</version.apache.tomcat>
Added: components/wci/trunk/exo/pom.xml
===================================================================
--- components/wci/trunk/exo/pom.xml (rev 0)
+++ components/wci/trunk/exo/pom.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,25 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>module-parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>wci-exo</artifactId>
+ <packaging>jar</packaging>
+ <name>GateIn - WCI eXo backwards compatibility component</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-wci</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ </properties>
+
+</project>
Added:
components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/PortletApplicationListener.java
===================================================================
---
components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/PortletApplicationListener.java
(rev 0)
+++
components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/PortletApplicationListener.java 2009-10-01
03:58:59 UTC (rev 220)
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.portletcontainer.impl.servlet;
+
+import javax.servlet.ServletContextEvent;
+import org.gatein.wci.api.GateInServletListener;
+
+/**
+ * <p>This class is used as a wrapper around the GateInServletListener. This class
+ * only exists to provide backwards compatiblity for portlets that have been setup to be
+ * deployable on versions of eXo portal.</p>
+ *
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class PortletApplicationListener extends GateInServletListener {
+}
Added:
components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/ServletWrapper.java
===================================================================
---
components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/ServletWrapper.java
(rev 0)
+++
components/wci/trunk/exo/src/main/java/org/exoplatform/services/portletcontainer/impl/servlet/ServletWrapper.java 2009-10-01
03:58:59 UTC (rev 220)
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.portletcontainer.impl.servlet;
+
+import org.gatein.wci.command.CommandServlet;
+
+/**
+ * This class is just an empty wrapper around the generic bootstrap servlet. This class
+ * exists to provide backwards compatiblity with portlets that were deployable with the
eXo portal.
+ *
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class ServletWrapper extends CommandServlet {
+
+}
Added: components/wci/trunk/jetty/pom.xml
===================================================================
--- components/wci/trunk/jetty/pom.xml (rev 0)
+++ components/wci/trunk/jetty/pom.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,25 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>module-parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>wci-jetty</artifactId>
+ <packaging>jar</packaging>
+ <name>GateIn - WCI Jetty compatibility component</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-wci</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ </properties>
+
+</project>
Copied: components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6Handler.java
(from rev 217,
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/jetty/Jetty6Handler.java)
===================================================================
--- components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6Handler.java
(rev 0)
+++
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6Handler.java 2009-10-01
03:58:59 UTC (rev 220)
@@ -0,0 +1,47 @@
+//package org.jboss.portal.web.impl.jetty;
+//
+//import java.io.IOException;
+//
+//import javax.servlet.ServletException;
+//import javax.servlet.http.HttpServletRequest;
+//import javax.servlet.http.HttpServletResponse;
+//
+//import org.mortbay.jetty.Server;
+//import org.mortbay.jetty.handler.AbstractHandler;
+//
+//public class Jetty6Handler extends AbstractHandler
+//{
+// Server server;
+// Jetty6ServletContainerContext containerContext;
+//
+// public Jetty6Handler (Server server)
+// {
+// this.server = server;
+// System.out.println("SERVER : " + server);
+// server.addHandler(this);
+// }
+//
+// protected void doStart() throws Exception {
+// super.doStart();
+// containerContext = new Jetty6ServletContainerContext(server);
+// containerContext.start();
+// }
+//
+// protected void doStop() throws Exception {
+// super.doStop();
+//
+// if (containerContext != null)
+// {
+// containerContext.stop();
+// containerContext = null;
+// }
+// }
+//
+// public void handle(String target, HttpServletRequest request,
+// HttpServletResponse response, int dispatch) throws IOException,
+// ServletException {
+// // Do Nothing for now. This doesn't actually handle anything, but needs to be a
handler
+// // to tie in the jetty lifecycle and to be able to have access to the server
object..
+// }
+//
+//}
\ No newline at end of file
Copied:
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java
(from rev 217,
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/jetty/Jetty6ServletContainerContext.java)
===================================================================
---
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java
(rev 0)
+++
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java 2009-10-01
03:58:59 UTC (rev 220)
@@ -0,0 +1,255 @@
+//package org.jboss.portal.web.impl.jetty;
+//
+//import java.io.IOException;
+//import java.util.HashSet;
+//import java.util.Set;
+//
+//import javax.servlet.ServletContext;
+//import javax.servlet.ServletException;
+//import javax.servlet.http.HttpServletRequest;
+//import javax.servlet.http.HttpServletResponse;
+//
+//import org.jboss.portal.web.RequestDispatchCallback;
+//import org.jboss.portal.web.command.CommandDispatcher;
+//import org.jboss.portal.web.impl.DefaultServletContainerFactory;
+//import org.jboss.portal.web.spi.ServletContainerContext;
+//import org.mortbay.component.Container;
+//import org.mortbay.component.LifeCycle;
+//import org.mortbay.component.LifeCycle.Listener;
+//import org.mortbay.component.Container.Relationship;
+//import org.mortbay.jetty.Handler;
+//import org.mortbay.jetty.Server;
+//import org.mortbay.jetty.handler.ContextHandlerCollection;
+//import org.mortbay.jetty.webapp.WebAppContext;
+//
+//public class Jetty6ServletContainerContext implements ServletContainerContext,
org.mortbay.component.Container.Listener, LifeCycle.Listener
+//{
+//
+// private Registration registration;
+//
+// private Container container;
+// private Server server;
+// private ContextHandlerCollection chc;
+//
+// /** The monitored contexts. */
+// private final Set<String> monitoredContexts = new HashSet<String>();
+//
+// private final Set<String> monitoredContextHandlerCollection = new
HashSet<String>();
+//
+// public Jetty6ServletContainerContext(Server server) {
+// this.server = server;
+// this.container = server.getContainer();
+// }
+//
+// /** . */
+// private final CommandDispatcher dispatcher = new CommandDispatcher();
+//
+// public Object include(ServletContext targetServletContext,
+// HttpServletRequest request, HttpServletResponse response,
+// RequestDispatchCallback callback, Object handback)
+// throws ServletException, IOException
+// {
+// return dispatcher.include(targetServletContext, request, response,
+// callback, handback);
+// }
+//
+// public void setCallback(Registration registration) {
+// this.registration = registration;
+// }
+//
+// public void unsetCallback(Registration registration) {
+// this.registration = null;
+// }
+//
+//
+// public void start()
+// {
+// DefaultServletContainerFactory.registerContext(this);
+//
+// Handler[] children =
server.getChildHandlersByClass(ContextHandlerCollection.class);
+// for (int i = 0; i < children.length; i++)
+// {
+// ContextHandlerCollection chc = (ContextHandlerCollection)children[i];
+// registerContextHandlerCollection(chc);
+// }
+// container.addEventListener(this);
+// }
+//
+// public void stop()
+// {
+// container.removeEventListener(this);
+//
+// Handler[] children = server.getChildHandlersByClass(ContextHandlerCollection.class);
+// for (int i=0; i< children.length; i++)
+// {
+// ContextHandlerCollection chc = (ContextHandlerCollection)children[i];
+// unregisterContextHandlerCollection(chc);
+// }
+//
+// registration.cancel();
+// registration = null;
+// }
+//
+// public void addBean(Object bean)
+// {
+// if (bean instanceof ContextHandlerCollection)
+// {
+// ContextHandlerCollection chc = (ContextHandlerCollection)bean;
+// registerContextHandlerCollection(chc);
+// }
+// else if (bean instanceof WebAppContext)
+// {
+// WebAppContext wac = (WebAppContext)bean;
+// registerWebAppContext(wac);
+// }
+// }
+//
+// public void removeBean(Object bean)
+// {
+// if (bean instanceof ContextHandlerCollection)
+// {
+// ContextHandlerCollection chc = (ContextHandlerCollection)bean;
+// unregisterContextHandlerCollection(chc);
+// }
+// else if (bean instanceof WebAppContext)
+// {
+// WebAppContext wac = (WebAppContext)bean;
+// unregisterWebAppContext(wac);
+// }
+// }
+//
+// public void add(Relationship relationship)
+// {
+// //ignore event for now
+// }
+//
+// public void remove(Relationship relationship)
+// {
+// //ignore event for now
+// }
+//
+// private void startWebAppContext(WebAppContext webappContext)
+// {
+// try
+// {
+// Jetty6WebAppContext context = new Jetty6WebAppContext(webappContext);
+//
+// //
+// if (registration != null)
+// {
+// registration.registerWebApp(context);
+// }
+// }
+// catch (Exception e)
+// {
+// e.printStackTrace();
+// }
+//
+// }
+//
+// private void stopWebAppContext(WebAppContext webappContext)
+// {
+// try
+// {
+// if (registration != null)
+// {
+// registration.unregisterWebApp(webappContext.getContextPath());
+// }
+// }
+// catch (Exception e)
+// {
+// e.printStackTrace();
+// }
+// }
+//
+// private void registerWebAppContext(WebAppContext wac)
+// {
+// // using servletContext since its the standard object and not jetty specific
+// // (need standard object when using ServletContextListener).
+// if (!monitoredContexts.contains(wac.getServletContext().getServletContextName()))
+// {
+// wac.addLifeCycleListener(this);
+// if (wac.isStarted())
+// {
+// startWebAppContext(wac);
+// }
+//
+// monitoredContexts.add(wac.getContextPath());
+// }
+// }
+//
+// private void unregisterWebAppContext(WebAppContext wac)
+// {
+// System.out.println("UNREGISTERWEBAPPCONTEXT : " + wac);
+// if (monitoredContexts.contains(wac.getServletContext().getServletContextName()))
+// {
+// monitoredContexts.remove(wac.getServletContext().getServletContextName());
+//
+// //
+// if (wac.isStarted())
+// {
+// stopWebAppContext(wac);
+// }
+//
+// //TODO: remove event listener from the webappcontext
+// wac.removeLifeCycleListener(this);
+// }
+// }
+//
+// private void registerContextHandlerCollection(ContextHandlerCollection chc)
+// {
+// if (!monitoredContextHandlerCollection.contains(chc.toString()))
+// {
+// Handler[] children = chc.getChildHandlersByClass(WebAppContext.class);
+// for (int i = 0; i < children.length; i++)
+// {
+// WebAppContext webAppContext = (WebAppContext)children[i];
+// registerWebAppContext(webAppContext);
+// }
+// }
+//
+// monitoredContextHandlerCollection.add(chc.toString());
+// }
+//
+// private void unregisterContextHandlerCollection(ContextHandlerCollection chc)
+// {
+// if (monitoredContextHandlerCollection.contains(chc.toString()))
+// {
+// monitoredContextHandlerCollection.remove(chc.toString());
+//
+// Handler[] children = chc.getChildHandlersByClass(WebAppContext.class);
+// for (int i = 0; i < children.length; i++)
+// {
+// WebAppContext webAppContext = (WebAppContext)children[i];
+// unregisterWebAppContext(webAppContext);
+// }
+// }
+// }
+//
+// public void lifeCycleFailure(LifeCycle lifeCycle, Throwable t)
+// {
+// //ignore event
+// }
+//
+// public void lifeCycleStarted(LifeCycle lifeCycle)
+// {
+// startWebAppContext((WebAppContext)lifeCycle);
+// }
+//
+// public void lifeCycleStarting(LifeCycle lifeCycle)
+// {
+// //ignore event
+// }
+//
+// public void lifeCycleStopped(LifeCycle lifeCycle)
+// {
+// stopWebAppContext((WebAppContext)lifeCycle);
+// }
+//
+// public void lifeCycleStopping(LifeCycle lifeCycle)
+// {
+// //Ignore event
+// }
+//
+//}
+//
Copied:
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6WebAppContext.java
(from rev 217,
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/jetty/Jetty6WebAppContext.java)
===================================================================
---
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6WebAppContext.java
(rev 0)
+++
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6WebAppContext.java 2009-10-01
03:58:59 UTC (rev 220)
@@ -0,0 +1,125 @@
+///******************************************************************************
+// * JBoss, a division of Red Hat *
+// * Copyright 2006, Red Hat Middleware, LLC, and individual *
+// * contributors as indicated by the @authors tag. See the *
+// * copyright.txt in the distribution for a full listing of *
+// * individual contributors. *
+// * *
+// * This is free software; you can redistribute it and/or modify it *
+// * under the terms of the GNU Lesser General Public License as *
+// * published by the Free Software Foundation; either version 2.1 of *
+// * the License, or (at your option) any later version. *
+// * *
+// * This software is distributed in the hope that it will be useful, *
+// * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+// * Lesser General Public License for more details. *
+// * *
+// * You should have received a copy of the GNU Lesser General Public *
+// * License along with this software; if not, write to the Free *
+// * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+// * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+// ******************************************************************************/
+//package org.jboss.portal.web.impl.jetty;
+//
+//import org.w3c.dom.Document;
+//import org.jboss.portal.web.command.CommandServlet;
+//import org.jboss.portal.web.spi.WebAppContext;
+//import org.mortbay.jetty.handler.ContextHandlerCollection;
+//import org.mortbay.jetty.servlet.Context;
+//import org.mortbay.jetty.servlet.ServletHolder;
+//
+//import javax.servlet.ServletContext;
+//import java.io.InputStream;
+//import java.io.IOException;
+//
+//public class Jetty6WebAppContext implements WebAppContext
+//{
+//
+// /** The logger. */
+//// protected final Logger log = Logger.getLogger(getClass());
+//
+// /** . */
+// private Document descriptor;
+//
+// /** . */
+// private ServletContext servletContext;
+//
+// /** . */
+// private ClassLoader loader;
+//
+// /** . */
+// private String contextPath;
+//
+// /** . */
+// private final Context context;
+//
+// /** . */
+// private ServletHolder commandServlet;
+//
+// Jetty6WebAppContext(Context context) throws Exception
+// {
+// this.context = context;
+// //
+// servletContext = context.getServletContext();
+// loader = context.getClassLoader();
+// contextPath = context.getContextPath();
+// }
+//
+// public void start() throws Exception
+// {
+// try
+// {
+// commandServlet = new ServletHolder();
+// commandServlet.setName("JBossServlet");
+// commandServlet.setInitOrder(0);
+// commandServlet.setClassName(CommandServlet.class.getName());
+// context.addServlet(commandServlet, "/jbossportlet");
+// }
+// catch (Exception e)
+// {
+// cleanup();
+// throw e;
+// }
+// }
+//
+// public void stop()
+// {
+// cleanup();
+// }
+//
+// private void cleanup()
+// {
+// if (commandServlet != null)
+// {
+// try
+// {
+// commandServlet.getServletHandler();
+// commandServlet.stop();
+// }
+// catch (Exception e)
+// {
+// }
+// }
+// }
+//
+// public ServletContext getServletContext()
+// {
+// return servletContext;
+// }
+//
+// public ClassLoader getClassLoader()
+// {
+// return loader;
+// }
+//
+// public String getContextPath()
+// {
+// return contextPath;
+// }
+//
+// public boolean importFile(String parentDirRelativePath, String name, InputStream
source, boolean overwrite) throws IOException
+// {
+// return false;
+// }
+//}
Modified: components/wci/trunk/pom.xml
===================================================================
--- components/wci/trunk/pom.xml 2009-10-01 03:25:02 UTC (rev 219)
+++ components/wci/trunk/pom.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -27,6 +27,10 @@
<modules>
<module>build</module>
<module>wci</module>
+ <module>exo</module>
+ <module>tomcat</module>
+ <module>jetty</module>
+ <module>test</module>
</modules>
<reporting>
Added: components/wci/trunk/test/.project
===================================================================
--- components/wci/trunk/test/.project (rev 0)
+++ components/wci/trunk/test/.project 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>wci-test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ </natures>
+</projectDescription>
Added: components/wci/trunk/test/pom.xml
===================================================================
--- components/wci/trunk/test/pom.xml (rev 0)
+++ components/wci/trunk/test/pom.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,297 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>module-parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>wci-test</artifactId>
+ <packaging>jar</packaging>
+ <name>GateIn - WCI test component</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-wci</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-tomcat</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>junit</artifactId>
+ <groupId>junit</groupId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-common</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-core-uberjar</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>catalina</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>apache-log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+
+ <!-- SCOPE TEST -->
+ <dependency>
+ <groupId>concurrent</groupId>
+ <artifactId>concurrent</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-mc</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-remote</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-mc</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-tooling-ant</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>portal-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>portal-test-generic</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-jdk</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.remoting</groupId>
+ <artifactId>jboss-remoting</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-serialization</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>saxpath</groupId>
+ <artifactId>saxpath</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>cargo</groupId>
+ <artifactId>cargo-manager</artifactId>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-jetty-deployer</artifactId>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-core-uberjar</artifactId>
+ <version>${version.cargo}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-ant</artifactId>
+ <version>${version.cargo}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
+ <artifactId>maven-antrun-extended-plugin</artifactId>
+ <version>1.13</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-tooling-ant</artifactId>
+ <version>${version.jboss.unit}</version>
+ </dependency>
+
+ <!--stuff to run servers for tests-->
+ <dependency>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-ant</artifactId>
+ <version>${version.cargo}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-core-uberjar</artifactId>
+ <version>${version.cargo}</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+ <executions>
+ <execution>
+ <id>test</id>
+ <phase>integration-test</phase>
+ <configuration>
+ <tasks>
+
+ <property name="compile_classpath"
refid="maven.compile.classpath"/>
+ <property name="runtime_classpath"
refid="maven.runtime.classpath"/>
+ <property name="test_classpath"
refid="maven.test.classpath"/>
+ <property name="plugin_classpath"
refid="maven.plugin.classpath"/>
+ <property name="project.version"
value="${project.version}"/>
+
+ <!-- -->
+ <property name="dependency.log4j.jar"
value="${maven.dependency.apache-log4j.log4j.jar.path}"/>
+ <property name="dependency.commons-logging.jar"
value="${maven.dependency.commons-logging.commons-logging.jar.path}"/>
+ <property name="dependency.commons-httpclient.jar"
value="${maven.dependency.commons-httpclient.commons-httpclient.jar.path}"/>
+ <property name="dependency.activation.jar"
value="${maven.dependency.javax.activation.activation.jar.path}"/>
+ <property name="dependency.junit.jar"
value="${maven.dependency.junit.junit.jar.path}"/>
+ <property name="dependency.cargo-manager.war"
value="${maven.dependency.cargo.cargo-manager.war.path}"/>
+
+ <!-- GateIn -->
+ <property name="dependency.gatein-common-common.jar"
value="${maven.dependency.org.gatein.common.common-common.jar.path}"/>
+ <property name="dependency.gatein-common-mc.jar"
value="${maven.dependency.org.gatein.common.common-mc.jar.path}"/>
+ <property name="dependency.gatein-wci-core.jar"
value="${maven.dependency.org.gatein.wci.wci-wci.jar.path}"/>
+ <property name="dependency.gatein-wci-tomcat.jar"
value="${maven.dependency.org.gatein.wci.wci-tomcat.jar.path}"/>
+
+ <!-- JBoss Unit -->
+ <property name="dependency.jboss-unit.jar"
value="${maven.dependency.org.jboss.unit.jboss-unit.jar.path}"/>
+ <property name="dependency.jboss-unit-mc.jar"
value="${maven.dependency.org.jboss.unit.jboss-unit-mc.jar.path}"/>
+ <property name="dependency.jboss-unit-remote.jar"
value="${maven.dependency.org.jboss.unit.jboss-unit-remote.jar.path}"/>
+ <property name="dependency.portal-test.jar"
value="${maven.dependency.org.jboss.unit.portal-test.jar.path}"/>
+ <property name="dependency.portal-test-generic.jar"
value="${maven.dependency.org.jboss.unit.portal-test-generic.jar.path}"/>
+ <property name="dependency.jboss-remoting.jar"
value="${maven.dependency.org.jboss.remoting.jboss-remoting.jar.path}"/>
+
+ <!-- JBoss Microcontainer -->
+ <property name="dependency.concurrent.jar"
value="${maven.dependency.concurrent.concurrent.jar.path}"/>
+ <property name="dependency.jboss-logging-spi.jar"
value="${maven.dependency.jboss.jboss-common-logging-spi.jar.path}"/>
+ <property name="dependency.jboss-logging-jdk.jar"
value="${maven.dependency.jboss.jboss-common-logging-jdk.jar.path}"/>
+ <property name="dependency.jboss-logging-log4j.jar"
value="${maven.dependency.jboss.jboss-common-logging-log4j.jar.path}"/>
+ <property name="dependency.jboss-kernel.jar"
value="${maven.dependency.org.jboss.microcontainer.jboss-kernel.jar.path}"/>
+ <property name="dependency.jboss-dependency.jar"
value="${maven.dependency.org.jboss.microcontainer.jboss-dependency.jar.path}"/>
+ <property name="dependency.jboss-reflect.jar"
value="${maven.dependency.org.jboss.jboss-reflect.jar.path}"/>
+ <property name="dependency.jboss-common-core.jar"
value="${maven.dependency.org.jboss.jboss-common-core.jar.path}"/>
+ <property name="dependency.jaxb.jar"
value="${maven.dependency.javax.xml.bind.jaxb-api.jar.path}"/>
+ <property name="dependency.jboss-mdr.jar"
value="${maven.dependency.org.jboss.jboss-mdr.jar.path}"/>
+ <property name="dependency.resolver.jar"
value="${maven.dependency.apache-xerces.resolver.jar.path}"/>
+ <property name="dependency.xercesImpl.jar"
value="${maven.dependency.apache-xerces.xercesImpl.jar.path}"/>
+ <property name="dependency.xml-apis.jar"
value="${maven.dependency.apache-xerces.xml-apis.jar.path}"/>
+ <property name="dependency.jbossxb.jar"
value="${maven.dependency.org.jboss.jbossxb.jar.path}"/>
+ <property name="dependency.jboss-serialization.jar"
value="${maven.dependency.jboss.jboss-serialization.jar.path}"/>
+
+ <!-- Cargo Jetty deployer -->
+ <property name="dependency.cargo.jetty-deployer"
value="${maven.dependency.org.codehaus.cargo.cargo-jetty-deployer.war.path}"/>
+
+ <ant antfile="${basedir}/src/test/build.xml">
+ <target name="tests"/>
+ </ant>
+
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ </properties>
+</project>
Copied: components/wci/trunk/test/src/test/build.xml (from rev 217,
components/wci/trunk/wci/src/test/build.xml)
===================================================================
--- components/wci/trunk/test/src/test/build.xml (rev 0)
+++ components/wci/trunk/test/src/test/build.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,1155 @@
+<?xml version="1.0"?>
+<project name="identity-test">
+
+ <target name="tests" unless="maven.test.skip">
+ <antcall target="_tests"/>
+ </target>
+
+ <target name="_tests" depends="prepare_env,
evaluate_properties" unless="maven.test.skip">
+
+ <echo message="compile classpath: ${compile_classpath}"/>
+ <echo message="runtime classpath: ${runtime_classpath}"/>
+ <echo message="test classpath: ${test_classpath}"/>
+ <echo message="plugin classpath: ${plugin_classpath}"/>
+ <echo message="To run tests only for containers specified with a HOME
variable use -Dtest.specified.containers"/>
+
+ <!-- -->
+ <delete dir="${test.temp.dir}"/>
+ <antcall target="package-tests"/>
+
+ <!-- -->
+ <antcall target="tests.local"/>
+ <antcall target="tests.call.single"/>
+ <antcall target="tests.call.all"/>
+
+ </target>
+
+ <target name="tests.call.all" unless="tests">
+ <antcall target="tests.jboss5"/>
+ <antcall target="tests.jboss"/>
+ <antcall target="tests.tomcat"/>
+<!-- <antcall target="tests.jetty"/> -->
+ </target>
+
+ <target name="tests.call.single" if="tests">
+ <antcall target="tests.${tests}"/>
+ </target>
+
+ <!-- Aliases for easier test execution -->
+ <target name="tests.jboss">
+ <antcall target="tests.jboss-4.2"/>
+ </target>
+ <target name="tests.jboss5">
+ <antcall target="tests.jboss-5.1"/>
+ </target>
+ <target name="tests.tomcat">
+ <antcall target="tests.tomcat-6.0"/>
+ </target>
+ <target name="tests.jetty">
+ <antcall target="tests.jetty-6.1"/>
+ </target>
+
+ <target name="prepare_env">
+
+ <!--Relative path to target dir-->
+ <property name="target" value="${basedir}/target"/>
+ <property name="test.temp.dir"
value="${target}/test/tmp"/>
+ <mkdir dir="${test.temp.dir}"/>
+ <mkdir dir="${target}/jboss-unit"/>
+
+ <property name="test.temp.lib"
value="${test.temp.dir}/lib"/>
+ <property name="test.support"
value="${test.temp.dir}/support"/>
+
+ </target>
+
+ <!--Lets make the check in one place so the build fail in the beggining instead of
end-->
+ <target name="evaluate_properties">
+
+ <property environment="env"/>
+
+ <!--If properties are not in command line check if they are set in env-->
+ <condition property="JBOSS_4_2_3_HOME"
value="${env.JBOSS_4_2_3_HOME}">
+ <and>
+ <isset property="env.JBOSS_4_2_3_HOME"/>
+ <not>
+ <isset property="JBOSS_4_2_3_HOME"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="JBOSS_4_2_2_HOME"
value="${env.JBOSS_4_2_2_HOME}">
+ <and>
+ <isset property="env.JBOSS_4_2_2_HOME"/>
+ <not>
+ <isset property="JBOSS_4_2_2_HOME"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="JBOSS_4_2_1_HOME"
value="${env.JBOSS_4_2_1_HOME}">
+ <and>
+ <isset property="env.JBOSS_4_2_1_HOME"/>
+ <not>
+ <isset property="JBOSS_4_2_1_HOME"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="JBOSS_4_2_0_HOME"
value="${env.JBOSS_4_2_0_HOME}">
+ <and>
+ <isset property="env.JBOSS_4_2_0_HOME"/>
+ <not>
+ <isset property="JBOSS_4_2_0_HOME"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="JBOSS_5_1_0_HOME"
value="${env.JBOSS_5_1_0_HOME}">
+ <and>
+ <isset property="env.JBOSS_5_1_0_HOME"/>
+ <not>
+ <isset property="JBOSS_5_1_0_HOME"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="TOMCAT_6_0_HOME"
value="${env.TOMCAT_6_0_HOME}">
+ <and>
+ <isset property="env.TOMCAT_6_0_HOME"/>
+ <not>
+ <isset property="TOMCAT_6_0_HOME"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="JETTY_6_1_HOME"
value="${env.JETTY_6_1_HOME}">
+ <and>
+ <isset property="env.JETTY_6_1_HOME"/>
+ <not>
+ <isset property="JETTY_6_1_HOME"/>
+ </not>
+ </and>
+ </condition>
+
+ <fail message="Please set the environment variable JBOSS_4_2_0_HOME or
JBOSS_4_2_1_HOME or JBOSS_4_2_2_HOME or JBOSS_4_2_3_HOME or use
-Dtest.specified.containers to only run tests for containers specified with a HOME
variable">
+ <condition>
+ <and>
+ <not>
+ <isset property="test.specified.containers"/>
+ </not>
+ <not>
+ <isset property="JBOSS_4_2_0_HOME"/>
+ </not>
+ <not>
+ <isset property="JBOSS_4_2_1_HOME"/>
+ </not>
+ <not>
+ <isset property="JBOSS_4_2_2_HOME"/>
+ </not>
+ <not>
+ <isset property="JBOSS_4_2_3_HOME"/>
+ </not>
+ </and>
+ </condition>
+ </fail>
+
+ <fail message="Please set the environment variable JBOSS_5_1_0_HOME or use
-Dtest.specified.containers to only run tests for containers specified with a HOME
variable">
+ <condition>
+ <and>
+ <not>
+ <isset property="test.specified.containers"/>
+ </not>
+ <not>
+ <isset property="JBOSS_5_1_0_HOME"/>
+ </not>
+ </and>
+ </condition>
+ </fail>
+
+ <fail message="Please set the environment variable TOMCAT_6_0_HOME or use
-Dtest.specified.containers to only run tests for containers specified with a HOME
variable">
+ <condition>
+ <and>
+ <not>
+ <isset property="test.specified.containers"/>
+ </not>
+ <not>
+ <isset property="TOMCAT_6_0_HOME"/>
+ </not>
+ </and>
+ </condition>
+ </fail>
+
+<!-- <fail message="Please set the environment variable JETTY_6_1_HOME or
use -Dtest.specified.containers to only run tests for containers specified with a HOME
variable">
+ <condition>
+ <and>
+ <not>
+ <isset property="test.specified.containers"/>
+ </not>
+ <not>
+ <isset property="JETTY_6_1_HOME"/>
+ </not>
+ </and>
+ </condition>
+ </fail> -->
+
+
+ </target>
+
+ <target name="package-tests">
+
+ <copy todir="${test.support}">
+ <fileset dir="${target}/test-classes/support"/>
+ </copy>
+
+ <path id="jboss-logging">
+ <pathelement path="${dependency.jboss-logging-spi.jar}"/>
+ <pathelement path="${dependency.jboss-logging-jdk.jar}"/>
+ <pathelement path="${dependency.jboss-logging-log4j.jar}"/>
+ </path>
+
+ <path id="jboss-microcontainer">
+ <pathelement path="${dependency.jboss-kernel.jar}"/>
+ <pathelement path="${dependency.jboss-dependency.jar}"/>
+ <pathelement path="${dependency.jboss-reflect.jar}"/>
+ <pathelement path="${dependency.jboss-common-core.jar}"/>
+ <pathelement path="${dependency.jboss-mdr.jar}"/>
+ <pathelement path="${dependency.jaxb.jar}"/>
+ <pathelement path="${dependency.jbossxb.jar}"/>
+ </path>
+
+ <path id="gatein-common">
+ <pathelement path="${dependency.gatein-common-mc.jar}"/>
+ </path>
+
+ <path id="gatein-common-shared">
+ <pathelement path="${dependency.gatein-common-common.jar}"/>
+ </path>
+
+ <path id="jboss-unit">
+ <pathelement path="${dependency.jboss-unit.jar}"/>
+ <pathelement path="${dependency.jboss-unit-mc.jar}"/>
+ <pathelement path="${dependency.jboss-unit-remote.jar}"/>
+ <pathelement path="${dependency.portal-test-generic.jar}"/>
+ <pathelement path="${dependency.portal-test.jar}"/>
+ <pathelement path="${dependency.jboss-remoting.jar}"/>
+ </path>
+
+ <path id="jboss-4.2">
+ <path refid="gatein-common"/>
+ <path refid="jboss-unit"/>
+ <path refid="jboss-microcontainer"/>
+ </path>
+
+ <path id="jboss-4.2-shared">
+ <path refid="gatein-common-shared"/>
+ <path path="${dependency.gatein-wci-tomcat.jar}"/>
+ <path path="${dependency.gatein-wci-core.jar}"/>
+ </path>
+
+ <path id="jboss-5.1">
+ <path refid="gatein-common"/>
+ <path refid="jboss-unit"/>
+ <path refid="jboss-microcontainer"/>
+ </path>
+
+ <path id="jboss-5.1-shared">
+ <path refid="gatein-common-shared"/>
+ <path path="${dependency.gatein-wci-core.jar}"/>
+ <path path="${dependency.gatein-wci-tomcat.jar}"/>
+ </path>
+
+ <path id="tomcat-6.0">
+ <path refid="gatein-common"/>
+ <path refid="jboss-unit"/>
+ <path refid="jboss-microcontainer"/>
+ <pathelement path="${dependency.log4j.jar}"/>
+ <pathelement path="${dependency.xercesImpl.jar}"/>
+ <pathelement path="${dependency.resolver.jar}"/>
+ <pathelement path="${dependency.xml-apis.jar}"/>
+ <pathelement path="${dependency.concurrent.jar}"/>
+ </path>
+
+ <path id="tomcat-6.0-shared">
+ <path refid="jboss-logging"/>
+ <path refid="gatein-common-shared"/>
+ <path location="${dependency.log4j.jar}"/>
+ <path location="${dependency.activation.jar}"/>
+ <path location="${dependency.junit.jar}"/>
+ <path path="${dependency.gatein-wci-core.jar}"/>
+ <path path="${dependency.gatein-wci-tomcat.jar}"/>
+ <path location="${dependency.jboss-serialization.jar}"/>
+ </path>
+
+ <path id="jetty-6.1">
+ <path refid="gatein-common"/>
+ <path refid="jboss-unit"/>
+ <path refid="jboss-microcontainer"/>
+ </path>
+
+ <!-- SPI Test case-->
+
+ <mkdir dir="${test.temp.lib}"/>
+ <jar jarfile="${test.temp.lib}/portal-test-spi-lib.jar">
+ <fileset dir="${target}/test-classes/">
+ <include name="org/gatein/wci/spi/**"/>
+ <include name="org/gatein/wci/ServletTestCase.class"/>
+ <include name="org/gatein/wci/TestServlet.class"/>
+ <include name="org/gatein/wci/WebAppRegistry.class"/>
+ </fileset>
+ <fileset dir="${target}/test-classes//portal-test-spi-jar"/>
+ </jar>
+
+ <!-- **************************** -->
+ <!-- Tomcat 6.0 container servlet -->
+ <!-- **************************** -->
+
+ <copy
todir="${test.support}/tomcat-6.0-container-servlet/server-war/WEB-INF/lib"
flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/tomcat-6.0-container-servlet"/>
+ <war
jarfile="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-server.war">
+ <fileset
dir="${test.support}/tomcat-6.0-container-servlet/server-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar
jarfile="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/app-war"/>
+ </jar>
+
+ <!-- **************************** -->
+ <!-- Tomcat 6.0 lifecyle listener -->
+ <!-- **************************** -->
+
+ <copy
todir="${test.support}/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/lib"
flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/tomcat-6.0-lifecycle-listener"/>
+ <war
jarfile="${test.temp.lib}/tomcat-6.0-lifecycle-listener/test-spi-server.war">
+ <fileset
dir="${test.support}/tomcat-6.0-lifecycle-listener/server-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar
jarfile="${test.temp.lib}/tomcat-6.0-lifecycle-listener/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/app-war"/>
+ </jar>
+
+ <!-- ****************** -->
+ <!-- Tomcat 6.0 generic -->
+ <!-- ****************** -->
+
+ <!-- -->
+ <mkdir
dir="${test.support}/tomcat-6.0-generic/server-war/WEB-INF/lib"/>
+ <copy
todir="${test.support}/tomcat-6.0-generic/server-war/WEB-INF/lib"
flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/tomcat-6.0-generic"/>
+ <war
jarfile="${test.temp.lib}/tomcat-6.0-generic/test-spi-server.war">
+ <fileset dir="${test.support}/tomcat-6.0-generic/server-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar
jarfile="${test.temp.lib}/tomcat-6.0-generic/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/generic/app-war"/>
+ </jar>
+
+ <!-- **************************** -->
+ <!-- Jetty 6.1 handler -->
+ <!-- **************************** -->
+
+ <copy todir="${test.support}/jetty-6.1-handler/server-war/WEB-INF/lib"
flatten="true">
+ <path refid="jetty-6.1"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/jetty-6.1-handler"/>
+ <war
jarfile="${test.temp.lib}/jetty-6.1-handler/test-spi-server.war">
+ <fileset dir="${test.support}/jetty-6.1-handler/server-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar
jarfile="${test.temp.lib}/jetty-6.1-handler/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/app-war"/>
+ </jar>
+
+ <!-- ****************** -->
+ <!-- Jetty 6.1 generic -->
+ <!-- ****************** -->
+
+ <!-- -->
+ <mkdir
dir="${test.support}/jetty-6.1-generic/server-war/WEB-INF/lib"/>
+ <copy todir="${test.support}/jetty-6.1-generic/server-war/WEB-INF/lib"
flatten="true">
+ <path refid="jetty-6.1"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/jetty-6.1-generic"/>
+ <war
jarfile="${test.temp.lib}/jetty-6.1-generic/test-spi-server.war">
+ <fileset dir="${test.support}/jetty-6.1-generic/server-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar
jarfile="${test.temp.lib}/jetty-6.1-generic/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/generic/app-war"/>
+ </jar>
+
+ <!-- *************************** -->
+ <!-- JBoss 4.2 container servlet -->
+ <!-- *************************** -->
+
+ <!-- -->
+ <copy
todir="${test.support}/jboss-4.2-container-servlet/server-war/WEB-INF/lib"
flatten="true">
+ <path refid="jboss-4.2"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/jboss-4.2-container-servlet"/>
+ <war
jarfile="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-server.war">
+ <fileset
dir="${test.support}/jboss-4.2-container-servlet/server-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar
jarfile="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/app-war"/>
+ </jar>
+
+ <!-- ***************** -->
+ <!-- JBoss 4.2 generic -->
+ <!-- ***************** -->
+
+ <!-- -->
+ <copy todir="${test.support}/jboss-4.2-generic/server-war/WEB-INF/lib"
flatten="true">
+ <path refid="jboss-4.2"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/jboss-4.2-generic"/>
+ <war
jarfile="${test.temp.lib}/jboss-4.2-generic/test-spi-server.war">
+ <fileset dir="${test.support}/jboss-4.2-generic/server-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar
jarfile="${test.temp.lib}/jboss-4.2-generic/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/generic/app-war"/>
+ </jar>
+
+ <!--endpoint test case-->
+
+ <jar jarfile="${test.temp.lib}/portal-test-endpoint-lib.jar">
+ <fileset dir="${target}/test-classes/">
+ <include name="org/gatein/wci/endpoint/**"/>
+ <include name="org/gatein/wci/ServletTestCase.class"/>
+ <include name="org/gatein/wci/TestServlet.class"/>
+ <include name="org/gatein/wci/WebAppRegistry.class"/>
+ </fileset>
+ <fileset
dir="${target}/test-classes/portal-test-endpoint-jar"/>
+ </jar>
+
+ <!-- *************************** -->
+ <!-- JBoss 5.1 container servlet -->
+ <!-- *************************** -->
+
+ <!-- -->
+ <copy
todir="${test.support}/jboss-5.1-container-servlet/server-war/WEB-INF/lib"
flatten="true">
+ <path refid="jboss-5.1"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/jboss-5.1-container-servlet"/>
+ <war
jarfile="${test.temp.lib}/jboss-5.1-container-servlet/test-spi-server.war">
+ <fileset
dir="${test.support}/jboss-5.1-container-servlet/server-war">
+ <exclude name="**/jboss-kernel*.jar"/>
+ </fileset>
+ <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar
jarfile="${test.temp.lib}/jboss-5.1-container-servlet/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/app-war"/>
+ </jar>
+
+ <!-- ***************** -->
+ <!-- JBoss 5.1 generic -->
+ <!-- ***************** -->
+
+ <copy todir="${test.support}/jboss-5.1-generic/server-war/WEB-INF/lib"
flatten="true">
+ <path refid="jboss-5.1"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/jboss-5.1-generic"/>
+ <war
jarfile="${test.temp.lib}/jboss-5.1-generic/test-spi-server.war">
+ <fileset dir="${test.support}/jboss-5.1-generic/server-war">
+ <exclude name="**/jboss-kernel*.jar"/>
+ </fileset>
+ <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
+ </war>
+ <jar
jarfile="${test.temp.lib}/jboss-5.1-generic/test-spi-app.war">
+ <fileset dir="${target}/test-classes/spi/generic/app-war">
+ <exclude name="**/jboss-kernel*.jar"/>
+ </fileset>
+ </jar>
+
+ <!--endpoint test case-->
+
+ <jar jarfile="${test.temp.lib}/portal-test-endpoint-lib.jar">
+ <fileset dir="${target}/test-classes/">
+ <include name="org/gatein/wci/endpoint/**"/>
+ <include name="org/gatein/wci/ServletTestCase.class"/>
+ <include name="org/gatein/wci/TestServlet.class"/>
+ <include name="org/gatein/wci/WebAppRegistry.class"/>
+ </fileset>
+ <fileset
dir="${target}/test-classes/portal-test-endpoint-jar"/>
+ </jar>
+
+ <!-- ********** -->
+ <!-- Tomcat 6.0 -->
+ <!-- ********** -->
+
+ <mkdir dir="${test.temp.lib}/tomcat-6.0"/>
+
+ <copy
todir="${test.support}/tomcat-6.0-endpoint/default-servlet-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <war
jarfile="${test.temp.lib}/tomcat-6.0/default-servlet-mapping.war">
+ <fileset
dir="${test.support}/tomcat-6.0-endpoint/default-servlet-mapping-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy
todir="${test.support}/tomcat-6.0-endpoint/path-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/tomcat-6.0/path-mapping.war">
+ <fileset
dir="${test.support}/tomcat-6.0-endpoint/path-mapping-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy
todir="${test.support}/tomcat-6.0-endpoint/root-path-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/tomcat-6.0/root-path-mapping.war">
+ <fileset
dir="${test.support}/tomcat-6.0-endpoint/root-path-mapping-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <!-- ********* -->
+ <!-- JETTY 6.1 -->
+ <!-- ********* -->
+ <mkdir dir="${test.temp.lib}/jetty-6.1"/>
+
+ <copy
todir="${test.support}/jetty-6.1-endpoint/default-servlet-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="jetty-6.1"/>
+ </copy>
+ <war
jarfile="${test.temp.lib}/jetty-6.1/default-servlet-mapping.war">
+ <fileset
dir="${test.support}/jetty-6.1-endpoint/default-servlet-mapping-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy
todir="${test.support}/jetty-6.1-endpoint/path-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="jetty-6.1"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jetty-6.1/path-mapping.war">
+ <fileset
dir="${test.support}/jetty-6.1-endpoint/path-mapping-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy
todir="${test.support}/jetty-6.1-endpoint/root-path-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="jetty-6.1"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jetty-6.1/root-path-mapping.war">
+ <fileset
dir="${test.support}/jetty-6.1-endpoint/root-path-mapping-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <!-- ********* -->
+ <!-- JBoss 4.2 -->
+ <!-- ********* -->
+
+ <mkdir dir="${test.temp.lib}/jboss-4.2"/>
+
+ <copy
todir="${test.support}/jboss-4.2-endpoint/default-servlet-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="jboss-4.2"/>
+ </copy>
+ <war
jarfile="${test.temp.lib}/jboss-4.2/default-servlet-mapping.war">
+ <fileset
dir="${test.support}/jboss-4.2-endpoint/default-servlet-mapping-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy
todir="${test.support}/jboss-4.2-endpoint/path-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="jboss-4.2"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jboss-4.2/path-mapping.war">
+ <fileset
dir="${test.support}/jboss-4.2-endpoint/path-mapping-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy
todir="${test.support}/jboss-4.2-endpoint/root-path-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="jboss-4.2"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jboss-4.2/root-path-mapping.war">
+ <fileset
dir="${test.support}/jboss-4.2-endpoint/root-path-mapping-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <!-- ********* -->
+ <!-- JBoss 5.1 -->
+ <!-- ********* -->
+
+ <mkdir dir="${test.temp.lib}/jboss-5.1"/>
+
+ <copy
todir="${test.support}/jboss-5.1-endpoint/default-servlet-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="jboss-5.1"/>
+ </copy>
+ <war
jarfile="${test.temp.lib}/jboss-5.1/default-servlet-mapping.war">
+ <fileset
dir="${test.support}/jboss-5.1-endpoint/default-servlet-mapping-war">
+ <exclude name="**/jboss-kernel*.jar"/>
+ </fileset>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy
todir="${test.support}/jboss-5.1-endpoint/path-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="jboss-5.1"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jboss-5.1/path-mapping.war">
+ <fileset
dir="${test.support}/jboss-5.1-endpoint/path-mapping-war">
+ <exclude name="**/jboss-kernel*.jar"/>
+ </fileset>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy
todir="${test.support}/jboss-5.1-endpoint/root-path-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="jboss-5.1"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jboss-5.1/root-path-mapping.war">
+ <fileset
dir="${test.support}/jboss-5.1-endpoint/root-path-mapping-war">
+ <exclude name="**/jboss-kernel*.jar"/>
+ </fileset>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <!--Strip cargo manager war filename-->
+ <copy file="${dependency.cargo-manager.war}"
tofile="${test.temp.lib}/manager.war"/>
+ <!-- unjar the war -->
+ <unzip src="${test.temp.lib}/manager.war"
dest="${test.temp.lib}/manager"/>
+
+ </target>
+
+ <target name="cargo.setup">
+ <property name="cargo.log.dir"
value="${target}/test/cargo"/>
+ <mkdir dir="${cargo.log.dir}"/>
+ <taskdef resource="cargo.tasks">
+ <classpath>
+ <pathelement path="${plugin_classpath}"/>
+ </classpath>
+ </taskdef>
+ </target>
+
+
+ <target name="cargo.jboss-4.2.start" depends="cargo.setup">
+ <!-- The lib portal-test-lib.jar must be loaded at the shared level rather than
in the war file
+ otherwise it is somehow inspected and produce a NoClassDefFoundError in the
web service integration
+ layer on the class
org/jboss/portal/test/framework/driver/remote/RemoteTestDriver for some unknown
+ reason, the class initiating the loading of the RemoteTestDriver class is
+
org.jboss.ws.integration.jboss42.DeployerInterceptorJSE.isWebserviceDeployment(DeployerInterceptorJSE.java:84)
+ -->
+
+ <cargo
+ containerId="jboss42x"
+ home="${test.jboss-4.2.home}"
+ log="${cargo.log.dir}/cargo.${test.id}.startup.log"
+ output="${cargo.log.dir}/cargo.${test.id}.server.log"
+ action="start"
+ wait="${cargo.wait}">
+ <sharedClasspath>
+
+ <path refid="jboss-4.2-shared"/>
+
+ </sharedClasspath>
+ <configuration home="${target}/cargo">
+ <property name="cargo.rmi.port" value="1299"/>
+ <property name="cargo.servlet.port" value="8080"/>
+ <property name="cargo.logging" value="high"/>
+ <deployable type="war" file="${cargo.war}"/>
+<!-- <property name="cargo.jvmargs" value="-Xdebug
-Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8222"/> -->
+ </configuration>
+ </cargo>
+ </target>
+
+ <target name="cargo.jboss-4.2.stop" depends="cargo.setup">
+ <cargo
+ containerId="jboss42x"
+ home="${test.jboss-4.2.home}"
+ log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
+ action="stop">
+ <configuration home="${target}/cargo">
+ <property name="cargo.rmi.port" value="1299"/>
+ </configuration>
+ </cargo>
+ </target>
+
+ <target name="tests.jboss-4.2.execute"
unless="tests.jboss-4.2.execute.skip">
+ <echo message="Starting JBoss 4.2 ${test.jboss-4.2.name} with
${test.jboss-4.2.home} to execute ${test.id} tests"/>
+ <antcall target="cargo.jboss-4.2.start">
+ <param name="cargo.wait" value="false"/>
+ <param name="cargo.war" value="${test.war}"/>
+ </antcall>
+ <antcall target="tests.remote">
+ <param name="test.remote.server.name"
value="${test.jboss-4.2.name}"/>
+ <param name="test.remote.archive.path"
value="${test.archive.path}"/>
+ </antcall>
+ <antcall target="cargo.jboss-4.2.stop">
+ </antcall>
+ </target>
+
+ <target name="tests.jboss-4.2.spi">
+ <condition property="tests.jboss-4.2.execute.skip">
+ <not>
+ <available file="${test.jboss-4.2.home}"
type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.jboss-4.2.execute">
+ <param name="test.id"
value="${test.jboss-4.2.name}-spi-container-servlet"/>
+ <param name="test.war"
value="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-server.war"/>
+ <param name="test.archive.path"
value="jboss-4.2-container-servlet"/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.execute">
+ <param name="test.id"
value="${test.jboss-4.2.name}-spi-generic"/>
+ <param name="test.war"
value="${test.temp.lib}/jboss-4.2-generic/test-spi-server.war"/>
+ <param name="test.archive.path"
value="jboss-4.2-generic"/>
+ </antcall>
+ </target>
+
+ <target name="tests.jboss-4.2.endpoint">
+ <condition property="tests.jboss-4.2.execute.skip">
+ <not>
+ <available file="${test.jboss-4.2.home}"
type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.jboss-4.2.execute">
+ <param name="test.id"
value="${test.jboss-4.2.name}-endpoint-default-servlet-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/jboss-4.2/default-servlet-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.execute">
+ <param name="test.id"
value="${test.jboss-4.2.name}-endpoint-path-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/jboss-4.2/path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.execute">
+ <param name="test.id"
value="${test.jboss-4.2.name}-endpoint-root-path-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/jboss-4.2/root-path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ </target>
+
+ <target name="tests.jboss-4.2">
+
+ <!-- spi tests -->
+
+ <antcall target="tests.jboss-4.2.spi">
+ <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_0"/>
+ <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_0_HOME}"/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.spi">
+ <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_1"/>
+ <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_1_HOME}"/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.spi">
+ <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_2"/>
+ <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_2_HOME}"/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.spi">
+ <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_3"/>
+ <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_3_HOME}"/>
+ </antcall>
+
+ <!-- endpoint tests -->
+
+ <antcall target="tests.jboss-4.2.endpoint">
+ <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_0"/>
+ <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_0_HOME}"/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.endpoint">
+ <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_1"/>
+ <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_1_HOME}"/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.endpoint">
+ <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_2"/>
+ <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_2_HOME}"/>
+ </antcall>
+ <antcall target="tests.jboss-4.2.endpoint">
+ <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_3"/>
+ <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_3_HOME}"/>
+ </antcall>
+ </target>
+
+ <target name="cargo.jboss-5.1.start" depends="cargo.setup">
+ <!-- The lib portal-test-lib.jar must be loaded at the shared level rather than
in the war file
+ otherwise it is somehow inspected and produce a NoClassDefFoundError in the
web service integration
+ layer on the class
org/jboss/portal/test/framework/driver/remote/RemoteTestDriver for some unknown
+ reason, the class initiating the loading of the RemoteTestDriver class is
+
org.jboss.ws.integration.jboss42.DeployerInterceptorJSE.isWebserviceDeployment(DeployerInterceptorJSE.java:84)
+ -->
+
+ <cargo
+ containerId="jboss51x"
+ home="${test.jboss-5.1.home}"
+ log="${cargo.log.dir}/cargo.${test.id}.startup.log"
+ output="${cargo.log.dir}/cargo.${test.id}.server.log"
+ action="start"
+ wait="false">
+ <sharedClasspath>
+
+ <path refid="jboss-5.1-shared"/>
+
+ </sharedClasspath>
+ <configuration home="${target}/cargo">
+ <property name="cargo.rmi.port" value="1099"/>
+ <property name="cargo.servlet.port" value="8080"/>
+ <property name="cargo.logging" value="high"/>
+ <deployable type="war" file="${cargo.war}"/>
+<!-- <property name="cargo.jvmargs" value="-Xdebug
-Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8222"/> -->
+ </configuration>
+ </cargo>
+ </target>
+
+ <target name="cargo.jboss-5.1.stop" depends="cargo.setup">
+ <cargo
+ containerId="jboss51x"
+ home="${test.jboss-5.1.home}"
+ log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
+ action="stop">
+ <configuration home="${target}/cargo">
+ <property name="cargo.rmi.port" value="1099"/>
+ </configuration>
+ </cargo>
+ </target>
+
+ <target name="tests.jboss-5.1.execute"
unless="tests.jboss-5.1.execute.skip">
+ <echo message="Starting JBoss 5.1 ${test.jboss-5.1.name} with
${test.jboss-5.1.home} to execute ${test.id} tests"/>
+ <antcall target="cargo.jboss-5.1.start">
+ <param name="cargo.wait" value="false"/>
+ <param name="cargo.war" value="${test.war}"/>
+ </antcall>
+ <antcall target="tests.remote">
+ <param name="test.remote.server.name"
value="${test.jboss-5.1.name}"/>
+ <param name="test.remote.archive.path"
value="${test.archive.path}"/>
+ </antcall>
+ <antcall target="cargo.jboss-5.1.stop">
+ </antcall>
+ </target>
+
+ <target name="tests.jboss-5.1.spi">
+ <condition property="tests.jboss-5.1.execute.skip">
+ <not>
+ <available file="${test.jboss-5.1.home}"
type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.jboss-5.1.execute">
+ <param name="test.id"
value="${test.jboss-5.1.name}-spi-container-servlet"/>
+ <param name="test.war"
value="${test.temp.lib}/jboss-5.1-container-servlet/test-spi-server.war"/>
+ <param name="test.archive.path"
value="jboss-5.1-container-servlet"/>
+
+ </antcall>
+ <antcall target="tests.jboss-5.1.execute">
+ <param name="test.id"
value="${test.jboss-5.1.name}-spi-generic"/>
+ <param name="test.war"
value="${test.temp.lib}/jboss-5.1-generic/test-spi-server.war"/>
+ <param name="test.archive.path"
value="jboss-5.1-generic"/>
+ </antcall>
+ </target>
+
+ <target name="tests.jboss-5.1.endpoint">
+ <condition property="tests.jboss-5.1.execute.skip">
+ <not>
+ <available file="${test.jboss-5.1.home}"
type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.jboss-5.1.execute">
+ <param name="test.id"
value="${test.jboss-5.1.name}-endpoint-default-servlet-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/jboss-5.1/default-servlet-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.jboss-5.1.execute">
+ <param name="test.id"
value="${test.jboss-5.1.name}-endpoint-path-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/jboss-5.1/path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.jboss-5.1.execute">
+ <param name="test.id"
value="${test.jboss-5.1.name}-endpoint-root-path-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/jboss-5.1/root-path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ </target>
+
+ <target name="tests.jboss-5.1">
+
+ <!-- spi tests -->
+ <antcall target="tests.jboss-5.1.spi">
+ <param name="test.jboss-5.1.name"
value="RemoteJBoss_5_1"/>
+ <param name="test.jboss-5.1.home"
value="${JBOSS_5_1_0_HOME}"/>
+ </antcall>
+
+ <!-- endpoint tests -->
+ <antcall target="tests.jboss-5.1.endpoint">
+ <param name="test.jboss-5.1.name"
value="RemoteJBoss_5_1"/>
+ <param name="test.jboss-5.1.home"
value="${JBOSS_5_1_0_HOME}"/>
+ </antcall>
+ </target>
+
+ <target name="cargo.tomcat-6.0.start"
depends="cargo.setup">
+
+ <cargo
+ containerId="tomcat6x"
+ home="${test.tomcat-6.0.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 refid="tomcat-6.0-shared"/>
+
+ </sharedClasspath>
+ <configuration home="${target}/cargo">
+ <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="${test.temp.lib}/manager.war"/>
+ <file file="${test.temp.lib}/manager"
todir="webapps/manager"/>
+ <deployable type="war" file="${cargo.war}"/>
+ </configuration>
+ </cargo>
+ </target>
+
+ <target name="cargo.tomcat-6.0.stop" depends="cargo.setup">
+ <cargo
+ containerId="tomcat6x"
+ home="${test.tomcat-6.0.home}"
+ log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
+ action="stop">
+ <configuration home="${target}/cargo">
+ </configuration>
+ </cargo>
+ </target>
+
+ <target name="tests.tomcat-6.0.execute"
unless="tests.tomcat-6.0.execute.skip">
+ <echo message="Starting Tomcat 6.0 ${test.tomcat-6.0.name} with
${test.tomcat-6.0.home} to execute ${test.id} tests"/>
+ <antcall target="cargo.tomcat-6.0.start">
+ <param name="cargo.wait" value="false"/>
+ <param name="cargo.war" value="${test.war}"/>
+ </antcall>
+ <antcall target="tests.remote">
+ <param name="test.remote.server.name"
value="${test.tomcat-6.0.name}"/>
+ <param name="test.remote.archive.path"
value="${test.archive.path}"/>
+ </antcall>
+ <antcall target="cargo.tomcat-6.0.stop">
+ </antcall>
+ </target>
+
+ <target name="tests.tomcat-6.0.spi">
+ <condition property="tests.tomcat-6.0.execute.skip">
+ <not>
+ <available file="${test.tomcat-6.0.home}"
type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.tomcat-6.0.execute">
+ <param name="test.id"
value="${test.tomcat-6.0.name}-spi-container-servlet"/>
+ <param name="test.war"
value="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-server.war"/>
+ <param name="test.archive.path"
value="tomcat-6.0-container-servlet"/>
+ </antcall>
+ <antcall target="tests.tomcat-6.0.execute">
+ <param name="test.id"
value="${test.tomcat-6.0.name}-spi-generic"/>
+ <param name="test.war"
value="${test.temp.lib}/tomcat-6.0-generic/test-spi-server.war"/>
+ <param name="test.archive.path"
value="tomcat-6.0-generic"/>
+ </antcall>
+ </target>
+
+ <target name="tests.tomcat-6.0.endpoint">
+ <condition property="tests.tomcat-6.0.execute.skip">
+ <not>
+ <available file="${test.tomcat-6.0.home}"
type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.tomcat-6.0.execute">
+ <param name="test.id"
value="${test.tomcat-6.0.name}-endpoint-default-servlet-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/tomcat-6.0/default-servlet-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.tomcat-6.0.execute">
+ <param name="test.id"
value="${test.tomcat-6.0.name}-endpoint-root-path-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/tomcat-6.0/root-path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.tomcat-6.0.execute">
+ <param name="test.id"
value="${test.tomcat-6.0.name}-endpoint-path-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/tomcat-6.0/path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ </target>
+
+ <target name="tests.tomcat-6.0">
+ <!-- spi tests -->
+ <antcall target="tests.tomcat-6.0.spi">
+ <param name="test.tomcat-6.0.name"
value="RemoteTomcat_6_0"/>
+ <param name="test.tomcat-6.0.home"
value="${TOMCAT_6_0_HOME}"/>
+ </antcall>
+
+ <!-- endpoint tests -->
+
+ <antcall target="tests.tomcat-6.0.endpoint">
+ <param name="test.tomcat-6.0.name"
value="RemoteTomcat_6_0"/>
+ <param name="test.tomcat-6.0.home"
value="${TOMCAT_6_0_HOME}"/>
+ </antcall>
+
+ </target>
+
+ <target name="cargo.jetty-6.1.start" depends="cargo.setup">
+ <cargo
+ containerId="jetty6x"
+ home="${test.jetty-6.1.home}"
+ output="${cargo.log.dir}/cargo.${test.id}.server.log"
+ log="${cargo.log.dir}/cargo.${test.id}.start.log"
+ action="start"
+ wait="${cargo.wait}">
+ <extraClasspath>
+ <path location="${dependency.gatein-common-common.jar}"/>
+ <path location="${dependency.jboss-unit.jar}"/>
+ <path location="${dependency.jboss-unit-remote.jar}"/>
+ <path location="${target}/wci-wci-${project.version}.jar"/>
+
+ <path location="${dependency.log4j.jar}"/>
+ <path location="${dependency.concurrent.jar}"/>
+ <path location="${dependency.gatein-common.jar}"/>
+ <path location="${dependency.activation.jar}"/>
+ <path location="${dependency.junit.jar}"/>
+ <path location="${dependency.jboss-logging-spi.jar}"/>
+
+ <path location="${target}/wci-wci-${project.version}.jar"/>
+
+ </extraClasspath>
+ <configuration home="${target}/cargo">
+ <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=n,address=8222"/>
+ <!-- overwrite these files to give jetty the propery security setup
-->
+ <configfile
file="${basedir}/src/test/resources/config/jetty/jetty.xml"
todir="etc"/>
+ <configfile
file="${basedir}/src/test/resources/config/jetty/realm.properties"
todir="etc"/>
+ <deployable type="war" file="${cargo.war}"/>
+ <deployable type="war"
file="${dependency.cargo.jetty-deployer}">
+ <property name="context"
value="cargo-jetty-deployer"/>
+ </deployable>
+ </configuration>
+ </cargo>
+ </target>
+
+ <target name="cargo.jetty-6.1.stop" depends="cargo.setup">
+ <cargo
+ containerId="jetty6x"
+ home="${test.jetty-6.1.home}"
+ log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
+ action="stop">
+ <configuration home="${target}/cargo">
+ </configuration>
+ </cargo>
+ </target>
+
+ <target name="tests.jetty-6.1.execute"
unless="tests.jetty-6.1.execute.skip">
+ <echo message="Starting Jetty 6.1 ${test.jetty-6.1.name} with
${test.jetty-6.1.home} to execute ${test.id} tests"/>
+ <antcall target="cargo.jetty-6.1.start">
+ <param name="cargo.wait" value="false"/>
+ <param name="cargo.war" value="${test.war}"/>
+ </antcall>
+ <antcall target="tests.remote">
+ <param name="test.remote.server.name"
value="${test.jetty-6.1.name}"/>
+ <param name="test.remote.archive.path"
value="${test.archive.path}"/>
+ </antcall>
+ <antcall target="cargo.jetty-6.1.stop">
+ </antcall>
+ </target>
+
+ <target name="tests.jetty-6.1.spi">
+ <condition property="tests.jetty-6.1.execute.skip">
+ <not>
+ <available file="${test.jetty-6.1.home}"
type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.jetty-6.1.execute">
+ <param name="test.id"
value="${test.jetty-6.1.name}-spi-handler"/>
+ <param name="test.war"
value="${test.temp.lib}/jetty-6.1-handler/test-spi-server.war"/>
+ <param name="test.archive.path"
value="jetty-6.1-handler"/>
+ </antcall>
+ <antcall target="tests.jetty-6.1.execute">
+ <param name="test.id"
value="${test.jetty-6.1.name}-spi-generic"/>
+ <param name="test.war"
value="${test.temp.lib}/jetty-6.1-generic/test-spi-server.war"/>
+ <param name="test.archive.path"
value="jetty-6.1-generic"/>
+ </antcall>
+ </target>
+
+ <target name="tests.jetty-6.1.endpoint">
+ <condition property="tests.jetty-6.1.execute.skip">
+ <not>
+ <available file="${test.jetty-6.1.home}"
type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.jetty-6.1.execute">
+ <param name="test.id"
value="${test.jetty-6.1.name}-endpoint-default-servlet-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/jetty-6.1/default-servlet-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.jetty-6.1.execute">
+ <param name="test.id"
value="${test.jetty-6.1.name}-endpoint-root-path-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/jetty-6.1/root-path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.jetty-6.1.execute">
+ <param name="test.id"
value="${test.jetty-6.1.name}-endpoint-path-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/jetty-6.1/path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ </target>
+
+ <target name="tests.jetty-6.1">
+ <!-- spi tests -->
+ <antcall target="tests.jetty-6.1.spi">
+ <param name="test.jetty-6.1.name"
value="RemoteJetty_6_1"/>
+ <param name="test.jetty-6.1.home"
value="${JETTY_6_1_HOME}"/>
+ </antcall>
+
+ <!-- endpoint tests -->
+ <antcall target="tests.jetty-6.1.endpoint">
+ <param name="test.jetty-6.1.name"
value="RemoteJetty_6_1"/>
+ <param name="test.jetty-6.1.home"
value="${JETTY_6_1_HOME}"/>
+ </antcall>
+ </target>
+
+ <target name="tests.local">
+
+ <taskdef name="jboss-unit"
classname="org.jboss.unit.tooling.ant.JBossUnitTask"
classpath="${plugin_classpath}"/>
+
+ <jboss-unit>
+
+ <tests config="${target}/test-classes/local-jboss-unit.xml">
+ </tests>
+
+ <reports>
+ <xml toDir="${target}/test/reports/local/xml/local"/>
+ <html toDir="${target}/test/reports/local/html/local"/>
+ </reports>
+
+ <classpath>
+ <pathelement location="${target}/test-classes/config"/>
+ <pathelement location="${target}/test-classes"/>
+
+ <pathelement path="${test_classpath}"/>
+ </classpath>
+
+ </jboss-unit>
+
+ </target>
+
+
+ <target name="tests.remote">
+
+ <echo message="test.temp.lib : ${test.temp.lib}"/>
+ <echo message="test.remote.archive.path :
${test.remote.archive.path}"/>
+
+ <taskdef name="jboss-unit"
classname="org.jboss.unit.tooling.ant.JBossUnitTask"
classpath="${plugin_classpath}"/>
+
+ <jboss-unit>
+
+ <tests config="${target}/test-classes/remote-jboss-unit.xml">
+ <property name="archivePath"
value="${test.temp.lib}/${test.remote.archive.path}"/>
+ <property name="serverName"
value="${test.remote.server.name}"/>
+ </tests>
+
+ <reports>
+ <xml toDir="${target}/test/reports/${test.id}/xml/local"/>
+ <html toDir="${target}/test/reports/${test.id}/html/local"/>
+ </reports>
+
+ <classpath>
+ <pathelement location="${target}/test-classes/config"/>
+ <pathelement location="${target}/classes"/>
+ <pathelement location="${target}/test-classes"/>
+
+ <pathelement path="${test_classpath}"/>
+ </classpath>
+
+ </jboss-unit>
+
+ </target>
+
+</project>
Copied: components/wci/trunk/test/src/test/java (from rev 217,
components/wci/trunk/wci/src/test/java)
Copied: components/wci/trunk/test/src/test/resources (from rev 217,
components/wci/trunk/wci/src/test/resources)
Added: components/wci/trunk/tomcat/pom.xml
===================================================================
--- components/wci/trunk/tomcat/pom.xml (rev 0)
+++ components/wci/trunk/tomcat/pom.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -0,0 +1,25 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>module-parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>wci-tomcat</artifactId>
+ <packaging>jar</packaging>
+ <name>GateIn - WCI Tomcat compatibility component</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-wci</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ </properties>
+
+</project>
Copied:
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ContainerServlet.java
(from rev 217,
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/tomcat/TC6ContainerServlet.java)
===================================================================
---
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ContainerServlet.java
(rev 0)
+++
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ContainerServlet.java 2009-10-01
03:58:59 UTC (rev 220)
@@ -0,0 +1,127 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.gatein.wci.tomcat;
+
+import org.apache.catalina.ContainerServlet;
+import org.apache.catalina.Wrapper;
+import org.apache.catalina.Container;
+import org.apache.catalina.Engine;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.ServletException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TC6ContainerServlet extends HttpServlet implements ContainerServlet
+{
+
+ /** . */
+ private Wrapper wrapper;
+
+ /** . */
+ private TC6ServletContainerContext containerContext;
+
+ /** . */
+ private boolean started;
+
+ public Wrapper getWrapper()
+ {
+ return wrapper;
+ }
+
+ public void setWrapper(Wrapper wrapper)
+ {
+ this.wrapper = wrapper;
+
+ //
+ if (wrapper != null)
+ {
+ attemptStart();
+ }
+ else
+ {
+ attemptStop();
+ }
+ }
+
+ public void init() throws ServletException
+ {
+ started = true;
+
+ //
+ attemptStart();
+ }
+
+ public void destroy()
+ {
+ started = false;
+
+ //
+ attemptStop();
+ }
+
+ private void attemptStart()
+ {
+ if (started && wrapper != null)
+ {
+ start();
+ }
+ }
+
+ private void attemptStop()
+ {
+ if (!started || wrapper == null)
+ {
+ stop();
+ }
+ }
+
+ private void start()
+ {
+ Container container = wrapper;
+ while (container.getParent() != null)
+ {
+ container = container.getParent();
+ if (container instanceof Engine)
+ {
+ Engine engine = (Engine)container;
+ containerContext = new TC6ServletContainerContext(engine);
+ containerContext.start();
+ break;
+ }
+ }
+ }
+
+ private void stop()
+ {
+ if (containerContext != null)
+ {
+ containerContext.stop();
+
+ //
+ containerContext = null;
+ }
+ }
+}
Copied:
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6LifecycleListener.java
(from rev 217,
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/tomcat/TC6LifecycleListener.java)
===================================================================
---
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6LifecycleListener.java
(rev 0)
+++
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6LifecycleListener.java 2009-10-01
03:58:59 UTC (rev 220)
@@ -0,0 +1,97 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.gatein.wci.tomcat;
+
+import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.Server;
+import org.apache.catalina.Service;
+import org.apache.catalina.Container;
+import org.apache.catalina.Engine;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TC6LifecycleListener implements LifecycleListener
+{
+
+ /** . */
+ private TC6ServletContainerContext containerContext;
+
+ public synchronized void lifecycleEvent(LifecycleEvent event)
+ {
+ Lifecycle lifecycle = event.getLifecycle();
+
+ //
+ if (lifecycle instanceof Server)
+ {
+ Server server = (Server)lifecycle;
+
+ //
+ Engine engine = getEngine(server);
+
+ //
+ if (engine != null)
+ {
+ if (Lifecycle.START_EVENT.equals(event.getType()))
+ {
+ containerContext = new TC6ServletContainerContext(engine);
+ containerContext.start();
+ }
+ else if (Lifecycle.STOP_EVENT.equals(event.getType()))
+ {
+ if (containerContext != null)
+ {
+ containerContext.stop();
+ }
+ }
+ }
+ }
+ }
+
+ private Engine getEngine(Server server)
+ {
+ Service[] services = server.findServices();
+ for (int i = 0; i < services.length; i++)
+ {
+ Service service = services[i];
+ Engine engine = getEngine(service.getContainer());
+ if (engine != null)
+ {
+ return engine;
+ }
+ }
+ return null;
+ }
+
+ private Engine getEngine(Container container)
+ {
+ if (container instanceof Engine)
+ {
+ return (Engine)container;
+ }
+ return null;
+ }
+}
Copied:
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java
(from rev 217,
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/tomcat/TC6ServletContainerContext.java)
===================================================================
---
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java
(rev 0)
+++
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java 2009-10-01
03:58:59 UTC (rev 220)
@@ -0,0 +1,305 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.gatein.wci.tomcat;
+
+import org.apache.catalina.Container;
+import org.apache.catalina.ContainerEvent;
+import org.apache.catalina.ContainerListener;
+import org.apache.catalina.Context;
+import org.apache.catalina.Engine;
+import org.apache.catalina.Host;
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.LifecycleListener;
+import org.gatein.wci.RequestDispatchCallback;
+import org.gatein.wci.command.CommandDispatcher;
+import org.gatein.wci.impl.DefaultServletContainerFactory;
+import org.gatein.wci.spi.ServletContainerContext;
+import org.apache.catalina.core.StandardContext;
+import org.apache.log4j.Logger;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * An implementation of the <code>ServletContainerContext</code> for Tomcat.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TC6ServletContainerContext implements ServletContainerContext,
ContainerListener, LifecycleListener
+{
+ private final static Logger log = Logger.getLogger(TC6ServletContainerContext.class);
+
+ /** . */
+ private final CommandDispatcher dispatcher = new
CommandDispatcher("/tomcatgateinservlet");
+
+ /** The monitored hosts. */
+ private final Set<String> monitoredHosts = new HashSet<String>();
+
+ /** The monitored contexts. */
+ private final Set<String> monitoredContexts = new HashSet<String>();
+
+ /** . */
+ private final Engine engine;
+
+ /** . */
+ private Registration registration;
+
+ public TC6ServletContainerContext(Engine engine)
+ {
+ this.engine = engine;
+ }
+
+ public Object include(
+ ServletContext targetServletContext,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ RequestDispatchCallback callback,
+ Object handback) throws ServletException, IOException
+ {
+ return dispatcher.include(targetServletContext, request, response, callback,
handback);
+ }
+
+ public void setCallback(Registration registration)
+ {
+ this.registration = registration;
+ }
+
+ public void unsetCallback(Registration registration)
+ {
+ this.registration = null;
+ }
+
+ public synchronized void containerEvent(ContainerEvent event)
+ {
+ if (event.getData() instanceof Host)
+ {
+ Host host = (Host)event.getData();
+
+ //
+ if (Container.ADD_CHILD_EVENT.equals(event.getType()))
+ {
+ registerHost(host);
+ }
+ else if (Container.REMOVE_CHILD_EVENT.equals(event.getType()))
+ {
+ unregisterHost(host);
+ }
+ }
+ else if (event.getData() instanceof StandardContext)
+ {
+ StandardContext context = (StandardContext)event.getData();
+
+ //
+ if (Container.ADD_CHILD_EVENT.equals(event.getType()))
+ {
+ registerContext(context);
+ }
+ else if (Container.REMOVE_CHILD_EVENT.equals(event.getType()))
+ {
+ unregisterContext(context);
+ }
+ }
+ }
+
+ public void lifecycleEvent(LifecycleEvent event)
+ {
+ if (event.getSource() instanceof Context)
+ {
+ Context context = (Context)event.getSource();
+
+ //
+ if (Lifecycle.AFTER_START_EVENT.equals(event.getType()))
+ {
+ start(context);
+ }
+ else if (Lifecycle.BEFORE_STOP_EVENT.equals(event.getType()))
+ {
+ stop(context);
+ }
+ }
+ }
+
+ void start()
+ {
+ DefaultServletContainerFactory.registerContext(this);
+
+ //
+ Container[] childrenContainers = engine.findChildren();
+ for (Container childContainer : childrenContainers)
+ {
+ if (childContainer instanceof Host)
+ {
+ Host host = (Host)childContainer;
+ registerHost(host);
+ }
+ }
+
+ //
+ engine.addContainerListener(this);
+ }
+
+ void stop()
+ {
+ engine.removeContainerListener(this);
+
+ //
+ Container[] childrenContainers = engine.findChildren();
+ for (Container childContainer : childrenContainers)
+ {
+ if (childContainer instanceof Host)
+ {
+ Host host = (Host)childContainer;
+ unregisterHost(host);
+ }
+ }
+
+ //
+ registration.cancel();
+ registration = null;
+ }
+
+ /**
+ * Register an host for registration which means that we fire events for all the
contexts it contains and we
+ * subscribe for its life cycle events. If the host is already monitored nothing is
done.
+ *
+ * @param host the host to register for monitoring
+ */
+ private void registerHost(Host host)
+ {
+ if (!monitoredHosts.contains(host.getName()))
+ {
+ Container[] childrenContainers = host.findChildren();
+ for (Container childContainer : childrenContainers)
+ {
+ if (childContainer instanceof StandardContext)
+ {
+ StandardContext context = (StandardContext)childContainer;
+ registerContext(context);
+ }
+ }
+
+ //
+ host.addContainerListener(this);
+
+ //
+ monitoredHosts.add(host.getName());
+ }
+ }
+
+ private void unregisterHost(Host host)
+ {
+ if (monitoredHosts.contains(host.getName()))
+ {
+ monitoredHosts.remove(host.getName());
+
+ //
+ host.removeContainerListener(this);
+
+ //
+ Container[] childrenContainers = host.findChildren();
+ for (Container childContainer : childrenContainers)
+ {
+ if (childContainer instanceof StandardContext)
+ {
+ StandardContext context = (StandardContext)childContainer;
+ unregisterContext(context);
+ }
+ }
+ }
+ }
+
+ private void registerContext(StandardContext context)
+ {
+ if (!monitoredContexts.contains(context.getName()))
+ {
+ context.addLifecycleListener(this);
+
+ //
+ if (context.getState() == 1)
+ {
+ start(context);
+ }
+
+ //
+ monitoredContexts.add(context.getName());
+ }
+ }
+
+ private void unregisterContext(StandardContext context)
+ {
+ if (monitoredContexts.contains(context.getName()))
+ {
+ monitoredContexts.remove(context.getName());
+
+ //
+ if (context.getState() == 1)
+ {
+ stop(context);
+ }
+
+ //
+ context.removeLifecycleListener(this);
+ }
+ }
+
+ private void start(Context context)
+ {
+ try
+ {
+ log.debug("Context added " + context.getPath());
+ TC6WebAppContext webAppContext = new TC6WebAppContext(context);
+
+ //
+ if (registration != null)
+ {
+ registration.registerWebApp(webAppContext);
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ private void stop(Context context)
+ {
+ try
+ {
+ if (registration != null)
+ {
+ registration.unregisterWebApp(context.getPath());
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+}
Copied:
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6WebAppContext.java
(from rev 217,
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/tomcat/TC6WebAppContext.java)
===================================================================
--- components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6WebAppContext.java
(rev 0)
+++
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6WebAppContext.java 2009-10-01
03:58:59 UTC (rev 220)
@@ -0,0 +1,130 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.gatein.wci.tomcat;
+
+import org.w3c.dom.Document;
+import org.apache.catalina.Context;
+import org.apache.catalina.Wrapper;
+import org.gatein.wci.command.CommandServlet;
+import org.gatein.wci.spi.WebAppContext;
+
+import javax.servlet.ServletContext;
+import java.io.InputStream;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TC6WebAppContext implements WebAppContext
+{
+
+ /** The logger. */
+// protected final Logger log = Logger.getLogger(getClass());
+
+ /** . */
+ private Document descriptor;
+
+ /** . */
+ private ServletContext servletContext;
+
+ /** . */
+ private ClassLoader loader;
+
+ /** . */
+ private String contextPath;
+
+ /** . */
+ private final Context context;
+
+ /** . */
+ private Wrapper commandServlet;
+
+ TC6WebAppContext(Context context) throws Exception
+ {
+ this.context = context;
+
+ //
+ servletContext = context.getServletContext();
+ loader = context.getLoader().getClassLoader();
+ contextPath = context.getPath();
+ }
+
+ public void start() throws Exception
+ {
+ try
+ {
+ commandServlet = context.createWrapper();
+ commandServlet.setName("TomcatGateInServlet");
+ commandServlet.setLoadOnStartup(0);
+ commandServlet.setServletClass(CommandServlet.class.getName());
+ context.addChild(commandServlet);
+ context.addServletMapping("/tomcatgateinservlet",
"TomcatGateInServlet");
+ }
+ catch (Exception e)
+ {
+ cleanup();
+ throw e;
+ }
+ }
+
+ public void stop()
+ {
+ cleanup();
+ }
+
+ private void cleanup()
+ {
+ if (commandServlet != null)
+ {
+ try
+ {
+ context.removeServletMapping("tomcatgateinservlet");
+ context.removeChild(commandServlet);
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+
+ public ServletContext getServletContext()
+ {
+ return servletContext;
+ }
+
+ public ClassLoader getClassLoader()
+ {
+ return loader;
+ }
+
+ public String getContextPath()
+ {
+ return contextPath;
+ }
+
+ public boolean importFile(String parentDirRelativePath, String name, InputStream
source, boolean overwrite) throws IOException
+ {
+ return false;
+ }
+}
Modified: components/wci/trunk/wci/pom.xml
===================================================================
--- components/wci/trunk/wci/pom.xml 2009-10-01 03:25:02 UTC (rev 219)
+++ components/wci/trunk/wci/pom.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -179,107 +179,6 @@
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
- <artifactId>maven-antrun-extended-plugin</artifactId>
- <version>1.13</version>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.unit</groupId>
- <artifactId>jboss-unit-tooling-ant</artifactId>
- <version>${version.jboss.unit}</version>
- </dependency>
-
- <!--stuff to run servers for tests-->
- <dependency>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-ant</artifactId>
- <version>${version.cargo}</version>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-core-uberjar</artifactId>
- <version>${version.cargo}</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
- <executions>
- <execution>
- <id>test</id>
- <phase>integration-test</phase>
- <configuration>
- <tasks>
-
- <property name="compile_classpath"
refid="maven.compile.classpath"/>
- <property name="runtime_classpath"
refid="maven.runtime.classpath"/>
- <property name="test_classpath"
refid="maven.test.classpath"/>
- <property name="plugin_classpath"
refid="maven.plugin.classpath"/>
- <property name="project.version"
value="${project.version}"/>
-
- <!-- -->
- <property name="dependency.log4j.jar"
value="${maven.dependency.apache-log4j.log4j.jar.path}"/>
- <property name="dependency.commons-logging.jar"
value="${maven.dependency.commons-logging.commons-logging.jar.path}"/>
- <property name="dependency.commons-httpclient.jar"
value="${maven.dependency.commons-httpclient.commons-httpclient.jar.path}"/>
- <property name="dependency.activation.jar"
value="${maven.dependency.javax.activation.activation.jar.path}"/>
- <property name="dependency.junit.jar"
value="${maven.dependency.junit.junit.jar.path}"/>
- <property name="dependency.cargo-manager.war"
value="${maven.dependency.cargo.cargo-manager.war.path}"/>
-
- <!-- GateIn -->
- <property name="dependency.gatein-common-common.jar"
value="${maven.dependency.org.gatein.common.common-common.jar.path}"/>
- <property name="dependency.gatein-common-mc.jar"
value="${maven.dependency.org.gatein.common.common-mc.jar.path}"/>
-
- <!-- JBoss Unit -->
- <property name="dependency.jboss-unit.jar"
value="${maven.dependency.org.jboss.unit.jboss-unit.jar.path}"/>
- <property name="dependency.jboss-unit-mc.jar"
value="${maven.dependency.org.jboss.unit.jboss-unit-mc.jar.path}"/>
- <property name="dependency.jboss-unit-remote.jar"
value="${maven.dependency.org.jboss.unit.jboss-unit-remote.jar.path}"/>
- <property name="dependency.portal-test.jar"
value="${maven.dependency.org.jboss.unit.portal-test.jar.path}"/>
- <property name="dependency.portal-test-generic.jar"
value="${maven.dependency.org.jboss.unit.portal-test-generic.jar.path}"/>
- <property name="dependency.jboss-remoting.jar"
value="${maven.dependency.org.jboss.remoting.jboss-remoting.jar.path}"/>
-
- <!-- JBoss Microcontainer -->
- <property name="dependency.concurrent.jar"
value="${maven.dependency.concurrent.concurrent.jar.path}"/>
- <property name="dependency.jboss-logging-spi.jar"
value="${maven.dependency.jboss.jboss-common-logging-spi.jar.path}"/>
- <property name="dependency.jboss-logging-jdk.jar"
value="${maven.dependency.jboss.jboss-common-logging-jdk.jar.path}"/>
- <property name="dependency.jboss-logging-log4j.jar"
value="${maven.dependency.jboss.jboss-common-logging-log4j.jar.path}"/>
- <property name="dependency.jboss-kernel.jar"
value="${maven.dependency.org.jboss.microcontainer.jboss-kernel.jar.path}"/>
- <property name="dependency.jboss-dependency.jar"
value="${maven.dependency.org.jboss.microcontainer.jboss-dependency.jar.path}"/>
- <property name="dependency.jboss-reflect.jar"
value="${maven.dependency.org.jboss.jboss-reflect.jar.path}"/>
- <property name="dependency.jboss-common-core.jar"
value="${maven.dependency.org.jboss.jboss-common-core.jar.path}"/>
- <property name="dependency.jaxb.jar"
value="${maven.dependency.javax.xml.bind.jaxb-api.jar.path}"/>
- <property name="dependency.jboss-mdr.jar"
value="${maven.dependency.org.jboss.jboss-mdr.jar.path}"/>
- <property name="dependency.resolver.jar"
value="${maven.dependency.apache-xerces.resolver.jar.path}"/>
- <property name="dependency.xercesImpl.jar"
value="${maven.dependency.apache-xerces.xercesImpl.jar.path}"/>
- <property name="dependency.xml-apis.jar"
value="${maven.dependency.apache-xerces.xml-apis.jar.path}"/>
- <property name="dependency.jbossxb.jar"
value="${maven.dependency.org.jboss.jbossxb.jar.path}"/>
- <property name="dependency.jboss-serialization.jar"
value="${maven.dependency.jboss.jboss-serialization.jar.path}"/>
-
- <!-- Cargo Jetty deployer -->
- <property name="dependency.cargo.jetty-deployer"
value="${maven.dependency.org.codehaus.cargo.cargo-jetty-deployer.war.path}"/>
-
- <ant antfile="${basedir}/src/test/build.xml">
- <target name="tests"/>
- </ant>
-
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
<properties>
</properties>
</project>
Modified: components/wci/trunk/wci/src/main/java/org/gatein/wci/api/GateInServlet.java
===================================================================
---
components/wci/trunk/wci/src/main/java/org/gatein/wci/api/GateInServlet.java 2009-10-01
03:25:02 UTC (rev 219)
+++
components/wci/trunk/wci/src/main/java/org/gatein/wci/api/GateInServlet.java 2009-10-01
03:58:59 UTC (rev 220)
@@ -39,6 +39,8 @@
/** . */
private String contextPath;
+
+ private ServletContext servletContext;
public void init() throws ServletException
{
@@ -53,8 +55,9 @@
GenericWebAppContext webAppContext = new GenericWebAppContext(servletContext,
contextPath, classLoader);
//
- GenericServletContainerContext.register(webAppContext);
+ GenericServletContainerContext.register(webAppContext,
"/gateinservlet");
this.contextPath = contextPath;
+ this.servletContext = servletContext;
}
catch (Exception e)
{
@@ -66,7 +69,8 @@
{
if (contextPath != null)
{
- GenericServletContainerContext.unregister(contextPath);
+ //GenericServletContainerContext.unregister(contextPath);
+ GenericServletContainerContext.unregister(servletContext);
}
}
}
\ No newline at end of file
Added:
components/wci/trunk/wci/src/main/java/org/gatein/wci/api/GateInServletListener.java
===================================================================
--- components/wci/trunk/wci/src/main/java/org/gatein/wci/api/GateInServletListener.java
(rev 0)
+++
components/wci/trunk/wci/src/main/java/org/gatein/wci/api/GateInServletListener.java 2009-10-01
03:58:59 UTC (rev 220)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.gatein.wci.api;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import org.gatein.wci.impl.generic.GenericServletContainerContext;
+import org.gatein.wci.impl.generic.GenericWebAppContext;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class GateInServletListener implements ServletContextListener
+{
+
+ public void contextInitialized(ServletContextEvent event)
+ {
+ ServletContext servletContext = event.getServletContext();
+
+ String contextPath = servletContext.getContextPath();
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+
+ GenericWebAppContext webAppContext = new GenericWebAppContext(servletContext,
contextPath, classLoader);
+
+ GenericServletContainerContext.register(webAppContext, "/PortletWrapper");
+ }
+
+ public void contextDestroyed(ServletContextEvent event)
+ {
+ ServletContext servletContext = event.getServletContext();
+ GenericServletContainerContext.unregister(servletContext);
+ }
+
+}
Modified:
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/generic/GenericServletContainerContext.java
===================================================================
---
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/generic/GenericServletContainerContext.java 2009-10-01
03:25:02 UTC (rev 219)
+++
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/generic/GenericServletContainerContext.java 2009-10-01
03:58:59 UTC (rev 220)
@@ -51,6 +51,8 @@
/** . */
private static GenericServletContainerContext instance;
+ private static HashMap<ServletContext, String> requestDispatchMap = new
HashMap<ServletContext, String>();
+
public static GenericServletContainerContext getInstance()
{
return instance;
@@ -63,8 +65,9 @@
{
}
- public static void register(GenericWebAppContext webAppContext)
+ public static void register(GenericWebAppContext webAppContext, String
dispatcherPath)
{
+ requestDispatchMap.put(webAppContext.getServletContext(), dispatcherPath);
if (instance != null && instance.registration != null)
{
instance.registration.registerWebApp(webAppContext);
@@ -75,8 +78,12 @@
}
}
- public static void unregister(String contextPath)
+ public static void unregister(ServletContext servletContext)
{
+ requestDispatchMap.remove(servletContext);
+
+ String contextPath = servletContext.getContextPath();
+
if (instance != null && instance.registration != null)
{
instance.registration.unregisterWebApp(contextPath);
@@ -90,7 +97,7 @@
}
/** . */
- private final CommandDispatcher dispatcher = new
CommandDispatcher("/gateinservlet");
+ //private final CommandDispatcher dispatcher = new
CommandDispatcher("/gateinservlet");
public Object include(
ServletContext targetServletContext,
@@ -99,6 +106,9 @@
RequestDispatchCallback callback,
Object handback) throws ServletException, IOException
{
+ String dispatcherPath = requestDispatchMap.get(targetServletContext);
+ CommandDispatcher dispatcher = new CommandDispatcher(dispatcherPath);
+
return dispatcher.include(targetServletContext, request, response, callback,
handback);
}
Deleted: components/wci/trunk/wci/src/test/build.xml
===================================================================
--- components/wci/trunk/wci/src/test/build.xml 2009-10-01 03:25:02 UTC (rev 219)
+++ components/wci/trunk/wci/src/test/build.xml 2009-10-01 03:58:59 UTC (rev 220)
@@ -1,1152 +0,0 @@
-<?xml version="1.0"?>
-<project name="identity-test">
-
- <target name="tests" unless="maven.test.skip">
- <antcall target="_tests"/>
- </target>
-
- <target name="_tests" depends="prepare_env,
evaluate_properties" unless="maven.test.skip">
-
- <echo message="compile classpath: ${compile_classpath}"/>
- <echo message="runtime classpath: ${runtime_classpath}"/>
- <echo message="test classpath: ${test_classpath}"/>
- <echo message="plugin classpath: ${plugin_classpath}"/>
- <echo message="To run tests only for containers specified with a HOME
variable use -Dtest.specified.containers"/>
-
- <!-- -->
- <delete dir="${test.temp.dir}"/>
- <antcall target="package-tests"/>
-
- <!-- -->
- <antcall target="tests.local"/>
- <antcall target="tests.call.single"/>
- <antcall target="tests.call.all"/>
-
- </target>
-
- <target name="tests.call.all" unless="tests">
- <antcall target="tests.jboss5"/>
- <antcall target="tests.jboss"/>
- <antcall target="tests.tomcat"/>
-<!-- <antcall target="tests.jetty"/> -->
- </target>
-
- <target name="tests.call.single" if="tests">
- <antcall target="tests.${tests}"/>
- </target>
-
- <!-- Aliases for easier test execution -->
- <target name="tests.jboss">
- <antcall target="tests.jboss-4.2"/>
- </target>
- <target name="tests.jboss5">
- <antcall target="tests.jboss-5.1"/>
- </target>
- <target name="tests.tomcat">
- <antcall target="tests.tomcat-6.0"/>
- </target>
- <target name="tests.jetty">
- <antcall target="tests.jetty-6.1"/>
- </target>
-
- <target name="prepare_env">
-
- <!--Relative path to target dir-->
- <property name="target" value="${basedir}/target"/>
- <property name="test.temp.dir"
value="${target}/test/tmp"/>
- <mkdir dir="${test.temp.dir}"/>
- <mkdir dir="${target}/jboss-unit"/>
-
- <property name="test.temp.lib"
value="${test.temp.dir}/lib"/>
- <property name="test.support"
value="${test.temp.dir}/support"/>
-
- </target>
-
- <!--Lets make the check in one place so the build fail in the beggining instead of
end-->
- <target name="evaluate_properties">
-
- <property environment="env"/>
-
- <!--If properties are not in command line check if they are set in env-->
- <condition property="JBOSS_4_2_3_HOME"
value="${env.JBOSS_4_2_3_HOME}">
- <and>
- <isset property="env.JBOSS_4_2_3_HOME"/>
- <not>
- <isset property="JBOSS_4_2_3_HOME"/>
- </not>
- </and>
- </condition>
- <condition property="JBOSS_4_2_2_HOME"
value="${env.JBOSS_4_2_2_HOME}">
- <and>
- <isset property="env.JBOSS_4_2_2_HOME"/>
- <not>
- <isset property="JBOSS_4_2_2_HOME"/>
- </not>
- </and>
- </condition>
- <condition property="JBOSS_4_2_1_HOME"
value="${env.JBOSS_4_2_1_HOME}">
- <and>
- <isset property="env.JBOSS_4_2_1_HOME"/>
- <not>
- <isset property="JBOSS_4_2_1_HOME"/>
- </not>
- </and>
- </condition>
- <condition property="JBOSS_4_2_0_HOME"
value="${env.JBOSS_4_2_0_HOME}">
- <and>
- <isset property="env.JBOSS_4_2_0_HOME"/>
- <not>
- <isset property="JBOSS_4_2_0_HOME"/>
- </not>
- </and>
- </condition>
- <condition property="JBOSS_5_1_0_HOME"
value="${env.JBOSS_5_1_0_HOME}">
- <and>
- <isset property="env.JBOSS_5_1_0_HOME"/>
- <not>
- <isset property="JBOSS_5_1_0_HOME"/>
- </not>
- </and>
- </condition>
- <condition property="TOMCAT_6_0_HOME"
value="${env.TOMCAT_6_0_HOME}">
- <and>
- <isset property="env.TOMCAT_6_0_HOME"/>
- <not>
- <isset property="TOMCAT_6_0_HOME"/>
- </not>
- </and>
- </condition>
- <condition property="JETTY_6_1_HOME"
value="${env.JETTY_6_1_HOME}">
- <and>
- <isset property="env.JETTY_6_1_HOME"/>
- <not>
- <isset property="JETTY_6_1_HOME"/>
- </not>
- </and>
- </condition>
-
- <fail message="Please set the environment variable JBOSS_4_2_0_HOME or
JBOSS_4_2_1_HOME or JBOSS_4_2_2_HOME or JBOSS_4_2_3_HOME or use
-Dtest.specified.containers to only run tests for containers specified with a HOME
variable">
- <condition>
- <and>
- <not>
- <isset property="test.specified.containers"/>
- </not>
- <not>
- <isset property="JBOSS_4_2_0_HOME"/>
- </not>
- <not>
- <isset property="JBOSS_4_2_1_HOME"/>
- </not>
- <not>
- <isset property="JBOSS_4_2_2_HOME"/>
- </not>
- <not>
- <isset property="JBOSS_4_2_3_HOME"/>
- </not>
- </and>
- </condition>
- </fail>
-
- <fail message="Please set the environment variable JBOSS_5_1_0_HOME or use
-Dtest.specified.containers to only run tests for containers specified with a HOME
variable">
- <condition>
- <and>
- <not>
- <isset property="test.specified.containers"/>
- </not>
- <not>
- <isset property="JBOSS_5_1_0_HOME"/>
- </not>
- </and>
- </condition>
- </fail>
-
- <fail message="Please set the environment variable TOMCAT_6_0_HOME or use
-Dtest.specified.containers to only run tests for containers specified with a HOME
variable">
- <condition>
- <and>
- <not>
- <isset property="test.specified.containers"/>
- </not>
- <not>
- <isset property="TOMCAT_6_0_HOME"/>
- </not>
- </and>
- </condition>
- </fail>
-
-<!-- <fail message="Please set the environment variable JETTY_6_1_HOME or
use -Dtest.specified.containers to only run tests for containers specified with a HOME
variable">
- <condition>
- <and>
- <not>
- <isset property="test.specified.containers"/>
- </not>
- <not>
- <isset property="JETTY_6_1_HOME"/>
- </not>
- </and>
- </condition>
- </fail> -->
-
-
- </target>
-
- <target name="package-tests">
-
- <copy todir="${test.support}">
- <fileset dir="${target}/test-classes/support"/>
- </copy>
-
- <path id="jboss-logging">
- <pathelement path="${dependency.jboss-logging-spi.jar}"/>
- <pathelement path="${dependency.jboss-logging-jdk.jar}"/>
- <pathelement path="${dependency.jboss-logging-log4j.jar}"/>
- </path>
-
- <path id="jboss-microcontainer">
- <pathelement path="${dependency.jboss-kernel.jar}"/>
- <pathelement path="${dependency.jboss-dependency.jar}"/>
- <pathelement path="${dependency.jboss-reflect.jar}"/>
- <pathelement path="${dependency.jboss-common-core.jar}"/>
- <pathelement path="${dependency.jboss-mdr.jar}"/>
- <pathelement path="${dependency.jaxb.jar}"/>
- <pathelement path="${dependency.jbossxb.jar}"/>
- </path>
-
- <path id="gatein-common">
- <pathelement path="${dependency.gatein-common-mc.jar}"/>
- </path>
-
- <path id="gatein-common-shared">
- <pathelement path="${dependency.gatein-common-common.jar}"/>
- </path>
-
- <path id="jboss-unit">
- <pathelement path="${dependency.jboss-unit.jar}"/>
- <pathelement path="${dependency.jboss-unit-mc.jar}"/>
- <pathelement path="${dependency.jboss-unit-remote.jar}"/>
- <pathelement path="${dependency.portal-test-generic.jar}"/>
- <pathelement path="${dependency.portal-test.jar}"/>
- <pathelement path="${dependency.jboss-remoting.jar}"/>
- </path>
-
- <path id="jboss-4.2">
- <path refid="gatein-common"/>
- <path refid="jboss-unit"/>
- <path refid="jboss-microcontainer"/>
- </path>
-
- <path id="jboss-4.2-shared">
- <path refid="gatein-common-shared"/>
- <path location="${target}/wci-wci-${project.version}.jar"/>
- </path>
-
- <path id="jboss-5.1">
- <path refid="gatein-common"/>
- <path refid="jboss-unit"/>
- <path refid="jboss-microcontainer"/>
- </path>
-
- <path id="jboss-5.1-shared">
- <path refid="gatein-common-shared"/>
- <path location="${target}/wci-wci-${project.version}.jar"/>
- </path>
-
- <path id="tomcat-6.0">
- <path refid="gatein-common"/>
- <path refid="jboss-unit"/>
- <path refid="jboss-microcontainer"/>
- <pathelement path="${dependency.log4j.jar}"/>
- <pathelement path="${dependency.xercesImpl.jar}"/>
- <pathelement path="${dependency.resolver.jar}"/>
- <pathelement path="${dependency.xml-apis.jar}"/>
- <pathelement path="${dependency.concurrent.jar}"/>
- </path>
-
- <path id="tomcat-6.0-shared">
- <path refid="jboss-logging"/>
- <path refid="gatein-common-shared"/>
- <path location="${dependency.log4j.jar}"/>
- <path location="${dependency.activation.jar}"/>
- <path location="${dependency.junit.jar}"/>
- <path location="${target}/wci-wci-${project.version}.jar"/>
- <path location="${dependency.jboss-serialization.jar}"/>
- </path>
-
- <path id="jetty-6.1">
- <path refid="gatein-common"/>
- <path refid="jboss-unit"/>
- <path refid="jboss-microcontainer"/>
- </path>
-
- <!-- SPI Test case-->
-
- <mkdir dir="${test.temp.lib}"/>
- <jar jarfile="${test.temp.lib}/portal-test-spi-lib.jar">
- <fileset dir="${target}/test-classes/">
- <include name="org/gatein/wci/spi/**"/>
- <include name="org/gatein/wci/ServletTestCase.class"/>
- <include name="org/gatein/wci/TestServlet.class"/>
- <include name="org/gatein/wci/WebAppRegistry.class"/>
- </fileset>
- <fileset dir="${target}/test-classes//portal-test-spi-jar"/>
- </jar>
-
- <!-- **************************** -->
- <!-- Tomcat 6.0 container servlet -->
- <!-- **************************** -->
-
- <copy
todir="${test.support}/tomcat-6.0-container-servlet/server-war/WEB-INF/lib"
flatten="true">
- <path refid="tomcat-6.0"/>
- </copy>
- <mkdir dir="${test.temp.lib}/tomcat-6.0-container-servlet"/>
- <war
jarfile="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-server.war">
- <fileset
dir="${test.support}/tomcat-6.0-container-servlet/server-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
- </war>
- <jar
jarfile="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/app-war"/>
- </jar>
-
- <!-- **************************** -->
- <!-- Tomcat 6.0 lifecyle listener -->
- <!-- **************************** -->
-
- <copy
todir="${test.support}/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/lib"
flatten="true">
- <path refid="tomcat-6.0"/>
- </copy>
- <mkdir dir="${test.temp.lib}/tomcat-6.0-lifecycle-listener"/>
- <war
jarfile="${test.temp.lib}/tomcat-6.0-lifecycle-listener/test-spi-server.war">
- <fileset
dir="${test.support}/tomcat-6.0-lifecycle-listener/server-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
- </war>
- <jar
jarfile="${test.temp.lib}/tomcat-6.0-lifecycle-listener/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/app-war"/>
- </jar>
-
- <!-- ****************** -->
- <!-- Tomcat 6.0 generic -->
- <!-- ****************** -->
-
- <!-- -->
- <mkdir
dir="${test.support}/tomcat-6.0-generic/server-war/WEB-INF/lib"/>
- <copy
todir="${test.support}/tomcat-6.0-generic/server-war/WEB-INF/lib"
flatten="true">
- <path refid="tomcat-6.0"/>
- </copy>
- <mkdir dir="${test.temp.lib}/tomcat-6.0-generic"/>
- <war
jarfile="${test.temp.lib}/tomcat-6.0-generic/test-spi-server.war">
- <fileset dir="${test.support}/tomcat-6.0-generic/server-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
- </war>
- <jar
jarfile="${test.temp.lib}/tomcat-6.0-generic/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/generic/app-war"/>
- </jar>
-
- <!-- **************************** -->
- <!-- Jetty 6.1 handler -->
- <!-- **************************** -->
-
- <copy todir="${test.support}/jetty-6.1-handler/server-war/WEB-INF/lib"
flatten="true">
- <path refid="jetty-6.1"/>
- </copy>
- <mkdir dir="${test.temp.lib}/jetty-6.1-handler"/>
- <war
jarfile="${test.temp.lib}/jetty-6.1-handler/test-spi-server.war">
- <fileset dir="${test.support}/jetty-6.1-handler/server-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
- </war>
- <jar
jarfile="${test.temp.lib}/jetty-6.1-handler/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/app-war"/>
- </jar>
-
- <!-- ****************** -->
- <!-- Jetty 6.1 generic -->
- <!-- ****************** -->
-
- <!-- -->
- <mkdir
dir="${test.support}/jetty-6.1-generic/server-war/WEB-INF/lib"/>
- <copy todir="${test.support}/jetty-6.1-generic/server-war/WEB-INF/lib"
flatten="true">
- <path refid="jetty-6.1"/>
- </copy>
- <mkdir dir="${test.temp.lib}/jetty-6.1-generic"/>
- <war
jarfile="${test.temp.lib}/jetty-6.1-generic/test-spi-server.war">
- <fileset dir="${test.support}/jetty-6.1-generic/server-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
- </war>
- <jar
jarfile="${test.temp.lib}/jetty-6.1-generic/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/generic/app-war"/>
- </jar>
-
- <!-- *************************** -->
- <!-- JBoss 4.2 container servlet -->
- <!-- *************************** -->
-
- <!-- -->
- <copy
todir="${test.support}/jboss-4.2-container-servlet/server-war/WEB-INF/lib"
flatten="true">
- <path refid="jboss-4.2"/>
- </copy>
- <mkdir dir="${test.temp.lib}/jboss-4.2-container-servlet"/>
- <war
jarfile="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-server.war">
- <fileset
dir="${test.support}/jboss-4.2-container-servlet/server-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
- </war>
- <jar
jarfile="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/app-war"/>
- </jar>
-
- <!-- ***************** -->
- <!-- JBoss 4.2 generic -->
- <!-- ***************** -->
-
- <!-- -->
- <copy todir="${test.support}/jboss-4.2-generic/server-war/WEB-INF/lib"
flatten="true">
- <path refid="jboss-4.2"/>
- </copy>
- <mkdir dir="${test.temp.lib}/jboss-4.2-generic"/>
- <war
jarfile="${test.temp.lib}/jboss-4.2-generic/test-spi-server.war">
- <fileset dir="${test.support}/jboss-4.2-generic/server-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
- </war>
- <jar
jarfile="${test.temp.lib}/jboss-4.2-generic/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/generic/app-war"/>
- </jar>
-
- <!--endpoint test case-->
-
- <jar jarfile="${test.temp.lib}/portal-test-endpoint-lib.jar">
- <fileset dir="${target}/test-classes/">
- <include name="org/gatein/wci/endpoint/**"/>
- <include name="org/gatein/wci/ServletTestCase.class"/>
- <include name="org/gatein/wci/TestServlet.class"/>
- <include name="org/gatein/wci/WebAppRegistry.class"/>
- </fileset>
- <fileset
dir="${target}/test-classes/portal-test-endpoint-jar"/>
- </jar>
-
- <!-- *************************** -->
- <!-- JBoss 5.1 container servlet -->
- <!-- *************************** -->
-
- <!-- -->
- <copy
todir="${test.support}/jboss-5.1-container-servlet/server-war/WEB-INF/lib"
flatten="true">
- <path refid="jboss-5.1"/>
- </copy>
- <mkdir dir="${test.temp.lib}/jboss-5.1-container-servlet"/>
- <war
jarfile="${test.temp.lib}/jboss-5.1-container-servlet/test-spi-server.war">
- <fileset
dir="${test.support}/jboss-5.1-container-servlet/server-war">
- <exclude name="**/jboss-kernel*.jar"/>
- </fileset>
- <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
- </war>
- <jar
jarfile="${test.temp.lib}/jboss-5.1-container-servlet/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/app-war"/>
- </jar>
-
- <!-- ***************** -->
- <!-- JBoss 5.1 generic -->
- <!-- ***************** -->
-
- <copy todir="${test.support}/jboss-5.1-generic/server-war/WEB-INF/lib"
flatten="true">
- <path refid="jboss-5.1"/>
- </copy>
- <mkdir dir="${test.temp.lib}/jboss-5.1-generic"/>
- <war
jarfile="${test.temp.lib}/jboss-5.1-generic/test-spi-server.war">
- <fileset dir="${test.support}/jboss-5.1-generic/server-war">
- <exclude name="**/jboss-kernel*.jar"/>
- </fileset>
- <lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
- </war>
- <jar
jarfile="${test.temp.lib}/jboss-5.1-generic/test-spi-app.war">
- <fileset dir="${target}/test-classes/spi/generic/app-war">
- <exclude name="**/jboss-kernel*.jar"/>
- </fileset>
- </jar>
-
- <!--endpoint test case-->
-
- <jar jarfile="${test.temp.lib}/portal-test-endpoint-lib.jar">
- <fileset dir="${target}/test-classes/">
- <include name="org/gatein/wci/endpoint/**"/>
- <include name="org/gatein/wci/ServletTestCase.class"/>
- <include name="org/gatein/wci/TestServlet.class"/>
- <include name="org/gatein/wci/WebAppRegistry.class"/>
- </fileset>
- <fileset
dir="${target}/test-classes/portal-test-endpoint-jar"/>
- </jar>
-
- <!-- ********** -->
- <!-- Tomcat 6.0 -->
- <!-- ********** -->
-
- <mkdir dir="${test.temp.lib}/tomcat-6.0"/>
-
- <copy
todir="${test.support}/tomcat-6.0-endpoint/default-servlet-mapping-war/WEB-INF/lib"
flatten="true">
- <path refid="tomcat-6.0"/>
- </copy>
- <war
jarfile="${test.temp.lib}/tomcat-6.0/default-servlet-mapping.war">
- <fileset
dir="${test.support}/tomcat-6.0-endpoint/default-servlet-mapping-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <copy
todir="${test.support}/tomcat-6.0-endpoint/path-mapping-war/WEB-INF/lib"
flatten="true">
- <path refid="tomcat-6.0"/>
- </copy>
- <war jarfile="${test.temp.lib}/tomcat-6.0/path-mapping.war">
- <fileset
dir="${test.support}/tomcat-6.0-endpoint/path-mapping-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <copy
todir="${test.support}/tomcat-6.0-endpoint/root-path-mapping-war/WEB-INF/lib"
flatten="true">
- <path refid="tomcat-6.0"/>
- </copy>
- <war jarfile="${test.temp.lib}/tomcat-6.0/root-path-mapping.war">
- <fileset
dir="${test.support}/tomcat-6.0-endpoint/root-path-mapping-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <!-- ********* -->
- <!-- JETTY 6.1 -->
- <!-- ********* -->
- <mkdir dir="${test.temp.lib}/jetty-6.1"/>
-
- <copy
todir="${test.support}/jetty-6.1-endpoint/default-servlet-mapping-war/WEB-INF/lib"
flatten="true">
- <path refid="jetty-6.1"/>
- </copy>
- <war
jarfile="${test.temp.lib}/jetty-6.1/default-servlet-mapping.war">
- <fileset
dir="${test.support}/jetty-6.1-endpoint/default-servlet-mapping-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <copy
todir="${test.support}/jetty-6.1-endpoint/path-mapping-war/WEB-INF/lib"
flatten="true">
- <path refid="jetty-6.1"/>
- </copy>
- <war jarfile="${test.temp.lib}/jetty-6.1/path-mapping.war">
- <fileset
dir="${test.support}/jetty-6.1-endpoint/path-mapping-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <copy
todir="${test.support}/jetty-6.1-endpoint/root-path-mapping-war/WEB-INF/lib"
flatten="true">
- <path refid="jetty-6.1"/>
- </copy>
- <war jarfile="${test.temp.lib}/jetty-6.1/root-path-mapping.war">
- <fileset
dir="${test.support}/jetty-6.1-endpoint/root-path-mapping-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <!-- ********* -->
- <!-- JBoss 4.2 -->
- <!-- ********* -->
-
- <mkdir dir="${test.temp.lib}/jboss-4.2"/>
-
- <copy
todir="${test.support}/jboss-4.2-endpoint/default-servlet-mapping-war/WEB-INF/lib"
flatten="true">
- <path refid="jboss-4.2"/>
- </copy>
- <war
jarfile="${test.temp.lib}/jboss-4.2/default-servlet-mapping.war">
- <fileset
dir="${test.support}/jboss-4.2-endpoint/default-servlet-mapping-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <copy
todir="${test.support}/jboss-4.2-endpoint/path-mapping-war/WEB-INF/lib"
flatten="true">
- <path refid="jboss-4.2"/>
- </copy>
- <war jarfile="${test.temp.lib}/jboss-4.2/path-mapping.war">
- <fileset
dir="${test.support}/jboss-4.2-endpoint/path-mapping-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <copy
todir="${test.support}/jboss-4.2-endpoint/root-path-mapping-war/WEB-INF/lib"
flatten="true">
- <path refid="jboss-4.2"/>
- </copy>
- <war jarfile="${test.temp.lib}/jboss-4.2/root-path-mapping.war">
- <fileset
dir="${test.support}/jboss-4.2-endpoint/root-path-mapping-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <!-- ********* -->
- <!-- JBoss 5.1 -->
- <!-- ********* -->
-
- <mkdir dir="${test.temp.lib}/jboss-5.1"/>
-
- <copy
todir="${test.support}/jboss-5.1-endpoint/default-servlet-mapping-war/WEB-INF/lib"
flatten="true">
- <path refid="jboss-5.1"/>
- </copy>
- <war
jarfile="${test.temp.lib}/jboss-5.1/default-servlet-mapping.war">
- <fileset
dir="${test.support}/jboss-5.1-endpoint/default-servlet-mapping-war">
- <exclude name="**/jboss-kernel*.jar"/>
- </fileset>
- <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <copy
todir="${test.support}/jboss-5.1-endpoint/path-mapping-war/WEB-INF/lib"
flatten="true">
- <path refid="jboss-5.1"/>
- </copy>
- <war jarfile="${test.temp.lib}/jboss-5.1/path-mapping.war">
- <fileset
dir="${test.support}/jboss-5.1-endpoint/path-mapping-war">
- <exclude name="**/jboss-kernel*.jar"/>
- </fileset>
- <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <copy
todir="${test.support}/jboss-5.1-endpoint/root-path-mapping-war/WEB-INF/lib"
flatten="true">
- <path refid="jboss-5.1"/>
- </copy>
- <war jarfile="${test.temp.lib}/jboss-5.1/root-path-mapping.war">
- <fileset
dir="${test.support}/jboss-5.1-endpoint/root-path-mapping-war">
- <exclude name="**/jboss-kernel*.jar"/>
- </fileset>
- <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
- </war>
-
- <!--Strip cargo manager war filename-->
- <copy file="${dependency.cargo-manager.war}"
tofile="${test.temp.lib}/manager.war"/>
- <!-- unjar the war -->
- <unzip src="${test.temp.lib}/manager.war"
dest="${test.temp.lib}/manager"/>
-
- </target>
-
- <target name="cargo.setup">
- <property name="cargo.log.dir"
value="${target}/test/cargo"/>
- <mkdir dir="${cargo.log.dir}"/>
- <taskdef resource="cargo.tasks">
- <classpath>
- <pathelement path="${plugin_classpath}"/>
- </classpath>
- </taskdef>
- </target>
-
-
- <target name="cargo.jboss-4.2.start" depends="cargo.setup">
- <!-- The lib portal-test-lib.jar must be loaded at the shared level rather than
in the war file
- otherwise it is somehow inspected and produce a NoClassDefFoundError in the
web service integration
- layer on the class
org/jboss/portal/test/framework/driver/remote/RemoteTestDriver for some unknown
- reason, the class initiating the loading of the RemoteTestDriver class is
-
org.jboss.ws.integration.jboss42.DeployerInterceptorJSE.isWebserviceDeployment(DeployerInterceptorJSE.java:84)
- -->
-
- <cargo
- containerId="jboss42x"
- home="${test.jboss-4.2.home}"
- log="${cargo.log.dir}/cargo.${test.id}.startup.log"
- output="${cargo.log.dir}/cargo.${test.id}.server.log"
- action="start"
- wait="${cargo.wait}">
- <sharedClasspath>
-
- <path refid="jboss-4.2-shared"/>
-
- </sharedClasspath>
- <configuration home="${target}/cargo">
- <property name="cargo.rmi.port" value="1299"/>
- <property name="cargo.servlet.port" value="8080"/>
- <property name="cargo.logging" value="high"/>
- <deployable type="war" file="${cargo.war}"/>
-<!-- <property name="cargo.jvmargs" value="-Xdebug
-Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8222"/> -->
- </configuration>
- </cargo>
- </target>
-
- <target name="cargo.jboss-4.2.stop" depends="cargo.setup">
- <cargo
- containerId="jboss42x"
- home="${test.jboss-4.2.home}"
- log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
- action="stop">
- <configuration home="${target}/cargo">
- <property name="cargo.rmi.port" value="1299"/>
- </configuration>
- </cargo>
- </target>
-
- <target name="tests.jboss-4.2.execute"
unless="tests.jboss-4.2.execute.skip">
- <echo message="Starting JBoss 4.2 ${test.jboss-4.2.name} with
${test.jboss-4.2.home} to execute ${test.id} tests"/>
- <antcall target="cargo.jboss-4.2.start">
- <param name="cargo.wait" value="false"/>
- <param name="cargo.war" value="${test.war}"/>
- </antcall>
- <antcall target="tests.remote">
- <param name="test.remote.server.name"
value="${test.jboss-4.2.name}"/>
- <param name="test.remote.archive.path"
value="${test.archive.path}"/>
- </antcall>
- <antcall target="cargo.jboss-4.2.stop">
- </antcall>
- </target>
-
- <target name="tests.jboss-4.2.spi">
- <condition property="tests.jboss-4.2.execute.skip">
- <not>
- <available file="${test.jboss-4.2.home}"
type="dir"/>
- </not>
- </condition>
- <antcall target="tests.jboss-4.2.execute">
- <param name="test.id"
value="${test.jboss-4.2.name}-spi-container-servlet"/>
- <param name="test.war"
value="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-server.war"/>
- <param name="test.archive.path"
value="jboss-4.2-container-servlet"/>
- </antcall>
- <antcall target="tests.jboss-4.2.execute">
- <param name="test.id"
value="${test.jboss-4.2.name}-spi-generic"/>
- <param name="test.war"
value="${test.temp.lib}/jboss-4.2-generic/test-spi-server.war"/>
- <param name="test.archive.path"
value="jboss-4.2-generic"/>
- </antcall>
- </target>
-
- <target name="tests.jboss-4.2.endpoint">
- <condition property="tests.jboss-4.2.execute.skip">
- <not>
- <available file="${test.jboss-4.2.home}"
type="dir"/>
- </not>
- </condition>
- <antcall target="tests.jboss-4.2.execute">
- <param name="test.id"
value="${test.jboss-4.2.name}-endpoint-default-servlet-mapping"/>
- <param name="test.war"
value="${test.temp.lib}/jboss-4.2/default-servlet-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- <antcall target="tests.jboss-4.2.execute">
- <param name="test.id"
value="${test.jboss-4.2.name}-endpoint-path-mapping"/>
- <param name="test.war"
value="${test.temp.lib}/jboss-4.2/path-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- <antcall target="tests.jboss-4.2.execute">
- <param name="test.id"
value="${test.jboss-4.2.name}-endpoint-root-path-mapping"/>
- <param name="test.war"
value="${test.temp.lib}/jboss-4.2/root-path-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- </target>
-
- <target name="tests.jboss-4.2">
-
- <!-- spi tests -->
-
- <antcall target="tests.jboss-4.2.spi">
- <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_0"/>
- <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_0_HOME}"/>
- </antcall>
- <antcall target="tests.jboss-4.2.spi">
- <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_1"/>
- <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_1_HOME}"/>
- </antcall>
- <antcall target="tests.jboss-4.2.spi">
- <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_2"/>
- <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_2_HOME}"/>
- </antcall>
- <antcall target="tests.jboss-4.2.spi">
- <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_3"/>
- <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_3_HOME}"/>
- </antcall>
-
- <!-- endpoint tests -->
-
- <antcall target="tests.jboss-4.2.endpoint">
- <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_0"/>
- <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_0_HOME}"/>
- </antcall>
- <antcall target="tests.jboss-4.2.endpoint">
- <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_1"/>
- <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_1_HOME}"/>
- </antcall>
- <antcall target="tests.jboss-4.2.endpoint">
- <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_2"/>
- <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_2_HOME}"/>
- </antcall>
- <antcall target="tests.jboss-4.2.endpoint">
- <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_3"/>
- <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_3_HOME}"/>
- </antcall>
- </target>
-
- <target name="cargo.jboss-5.1.start" depends="cargo.setup">
- <!-- The lib portal-test-lib.jar must be loaded at the shared level rather than
in the war file
- otherwise it is somehow inspected and produce a NoClassDefFoundError in the
web service integration
- layer on the class
org/jboss/portal/test/framework/driver/remote/RemoteTestDriver for some unknown
- reason, the class initiating the loading of the RemoteTestDriver class is
-
org.jboss.ws.integration.jboss42.DeployerInterceptorJSE.isWebserviceDeployment(DeployerInterceptorJSE.java:84)
- -->
-
- <cargo
- containerId="jboss51x"
- home="${test.jboss-5.1.home}"
- log="${cargo.log.dir}/cargo.${test.id}.startup.log"
- output="${cargo.log.dir}/cargo.${test.id}.server.log"
- action="start"
- wait="false">
- <sharedClasspath>
-
- <path refid="jboss-5.1-shared"/>
-
- </sharedClasspath>
- <configuration home="${target}/cargo">
- <property name="cargo.rmi.port" value="1099"/>
- <property name="cargo.servlet.port" value="8080"/>
- <property name="cargo.logging" value="high"/>
- <deployable type="war" file="${cargo.war}"/>
-<!-- <property name="cargo.jvmargs" value="-Xdebug
-Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8222"/> -->
- </configuration>
- </cargo>
- </target>
-
- <target name="cargo.jboss-5.1.stop" depends="cargo.setup">
- <cargo
- containerId="jboss51x"
- home="${test.jboss-5.1.home}"
- log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
- action="stop">
- <configuration home="${target}/cargo">
- <property name="cargo.rmi.port" value="1099"/>
- </configuration>
- </cargo>
- </target>
-
- <target name="tests.jboss-5.1.execute"
unless="tests.jboss-5.1.execute.skip">
- <echo message="Starting JBoss 5.1 ${test.jboss-5.1.name} with
${test.jboss-5.1.home} to execute ${test.id} tests"/>
- <antcall target="cargo.jboss-5.1.start">
- <param name="cargo.wait" value="false"/>
- <param name="cargo.war" value="${test.war}"/>
- </antcall>
- <antcall target="tests.remote">
- <param name="test.remote.server.name"
value="${test.jboss-5.1.name}"/>
- <param name="test.remote.archive.path"
value="${test.archive.path}"/>
- </antcall>
- <antcall target="cargo.jboss-5.1.stop">
- </antcall>
- </target>
-
- <target name="tests.jboss-5.1.spi">
- <condition property="tests.jboss-5.1.execute.skip">
- <not>
- <available file="${test.jboss-5.1.home}"
type="dir"/>
- </not>
- </condition>
- <antcall target="tests.jboss-5.1.execute">
- <param name="test.id"
value="${test.jboss-5.1.name}-spi-container-servlet"/>
- <param name="test.war"
value="${test.temp.lib}/jboss-5.1-container-servlet/test-spi-server.war"/>
- <param name="test.archive.path"
value="jboss-5.1-container-servlet"/>
-
- </antcall>
- <antcall target="tests.jboss-5.1.execute">
- <param name="test.id"
value="${test.jboss-5.1.name}-spi-generic"/>
- <param name="test.war"
value="${test.temp.lib}/jboss-5.1-generic/test-spi-server.war"/>
- <param name="test.archive.path"
value="jboss-5.1-generic"/>
- </antcall>
- </target>
-
- <target name="tests.jboss-5.1.endpoint">
- <condition property="tests.jboss-5.1.execute.skip">
- <not>
- <available file="${test.jboss-5.1.home}"
type="dir"/>
- </not>
- </condition>
- <antcall target="tests.jboss-5.1.execute">
- <param name="test.id"
value="${test.jboss-5.1.name}-endpoint-default-servlet-mapping"/>
- <param name="test.war"
value="${test.temp.lib}/jboss-5.1/default-servlet-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- <antcall target="tests.jboss-5.1.execute">
- <param name="test.id"
value="${test.jboss-5.1.name}-endpoint-path-mapping"/>
- <param name="test.war"
value="${test.temp.lib}/jboss-5.1/path-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- <antcall target="tests.jboss-5.1.execute">
- <param name="test.id"
value="${test.jboss-5.1.name}-endpoint-root-path-mapping"/>
- <param name="test.war"
value="${test.temp.lib}/jboss-5.1/root-path-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- </target>
-
- <target name="tests.jboss-5.1">
-
- <!-- spi tests -->
- <antcall target="tests.jboss-5.1.spi">
- <param name="test.jboss-5.1.name"
value="RemoteJBoss_5_1"/>
- <param name="test.jboss-5.1.home"
value="${JBOSS_5_1_0_HOME}"/>
- </antcall>
-
- <!-- endpoint tests -->
- <antcall target="tests.jboss-5.1.endpoint">
- <param name="test.jboss-5.1.name"
value="RemoteJBoss_5_1"/>
- <param name="test.jboss-5.1.home"
value="${JBOSS_5_1_0_HOME}"/>
- </antcall>
- </target>
-
- <target name="cargo.tomcat-6.0.start"
depends="cargo.setup">
-
- <cargo
- containerId="tomcat6x"
- home="${test.tomcat-6.0.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 refid="tomcat-6.0-shared"/>
-
- </sharedClasspath>
- <configuration home="${target}/cargo">
- <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="${test.temp.lib}/manager.war"/>
- <file file="${test.temp.lib}/manager"
todir="webapps/manager"/>
- <deployable type="war" file="${cargo.war}"/>
- </configuration>
- </cargo>
- </target>
-
- <target name="cargo.tomcat-6.0.stop" depends="cargo.setup">
- <cargo
- containerId="tomcat6x"
- home="${test.tomcat-6.0.home}"
- log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
- action="stop">
- <configuration home="${target}/cargo">
- </configuration>
- </cargo>
- </target>
-
- <target name="tests.tomcat-6.0.execute"
unless="tests.tomcat-6.0.execute.skip">
- <echo message="Starting Tomcat 6.0 ${test.tomcat-6.0.name} with
${test.tomcat-6.0.home} to execute ${test.id} tests"/>
- <antcall target="cargo.tomcat-6.0.start">
- <param name="cargo.wait" value="false"/>
- <param name="cargo.war" value="${test.war}"/>
- </antcall>
- <antcall target="tests.remote">
- <param name="test.remote.server.name"
value="${test.tomcat-6.0.name}"/>
- <param name="test.remote.archive.path"
value="${test.archive.path}"/>
- </antcall>
- <antcall target="cargo.tomcat-6.0.stop">
- </antcall>
- </target>
-
- <target name="tests.tomcat-6.0.spi">
- <condition property="tests.tomcat-6.0.execute.skip">
- <not>
- <available file="${test.tomcat-6.0.home}"
type="dir"/>
- </not>
- </condition>
- <antcall target="tests.tomcat-6.0.execute">
- <param name="test.id"
value="${test.tomcat-6.0.name}-spi-container-servlet"/>
- <param name="test.war"
value="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-server.war"/>
- <param name="test.archive.path"
value="tomcat-6.0-container-servlet"/>
- </antcall>
- <antcall target="tests.tomcat-6.0.execute">
- <param name="test.id"
value="${test.tomcat-6.0.name}-spi-generic"/>
- <param name="test.war"
value="${test.temp.lib}/tomcat-6.0-generic/test-spi-server.war"/>
- <param name="test.archive.path"
value="tomcat-6.0-generic"/>
- </antcall>
- </target>
-
- <target name="tests.tomcat-6.0.endpoint">
- <condition property="tests.tomcat-6.0.execute.skip">
- <not>
- <available file="${test.tomcat-6.0.home}"
type="dir"/>
- </not>
- </condition>
- <antcall target="tests.tomcat-6.0.execute">
- <param name="test.id"
value="${test.tomcat-6.0.name}-endpoint-default-servlet-mapping"/>
- <param name="test.war"
value="${test.temp.lib}/tomcat-6.0/default-servlet-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- <antcall target="tests.tomcat-6.0.execute">
- <param name="test.id"
value="${test.tomcat-6.0.name}-endpoint-root-path-mapping"/>
- <param name="test.war"
value="${test.temp.lib}/tomcat-6.0/root-path-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- <antcall target="tests.tomcat-6.0.execute">
- <param name="test.id"
value="${test.tomcat-6.0.name}-endpoint-path-mapping"/>
- <param name="test.war"
value="${test.temp.lib}/tomcat-6.0/path-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- </target>
-
- <target name="tests.tomcat-6.0">
- <!-- spi tests -->
- <antcall target="tests.tomcat-6.0.spi">
- <param name="test.tomcat-6.0.name"
value="RemoteTomcat_6_0"/>
- <param name="test.tomcat-6.0.home"
value="${TOMCAT_6_0_HOME}"/>
- </antcall>
-
- <!-- endpoint tests -->
-
- <antcall target="tests.tomcat-6.0.endpoint">
- <param name="test.tomcat-6.0.name"
value="RemoteTomcat_6_0"/>
- <param name="test.tomcat-6.0.home"
value="${TOMCAT_6_0_HOME}"/>
- </antcall>
-
- </target>
-
- <target name="cargo.jetty-6.1.start" depends="cargo.setup">
- <cargo
- containerId="jetty6x"
- home="${test.jetty-6.1.home}"
- output="${cargo.log.dir}/cargo.${test.id}.server.log"
- log="${cargo.log.dir}/cargo.${test.id}.start.log"
- action="start"
- wait="${cargo.wait}">
- <extraClasspath>
- <path location="${dependency.gatein-common-common.jar}"/>
- <path location="${dependency.jboss-unit.jar}"/>
- <path location="${dependency.jboss-unit-remote.jar}"/>
- <path location="${target}/wci-wci-${project.version}.jar"/>
-
- <path location="${dependency.log4j.jar}"/>
- <path location="${dependency.concurrent.jar}"/>
- <path location="${dependency.gatein-common.jar}"/>
- <path location="${dependency.activation.jar}"/>
- <path location="${dependency.junit.jar}"/>
- <path location="${dependency.jboss-logging-spi.jar}"/>
-
- <path location="${target}/wci-wci-${project.version}.jar"/>
-
- </extraClasspath>
- <configuration home="${target}/cargo">
- <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=n,address=8222"/>
- <!-- overwrite these files to give jetty the propery security setup
-->
- <configfile
file="${basedir}/src/test/resources/config/jetty/jetty.xml"
todir="etc"/>
- <configfile
file="${basedir}/src/test/resources/config/jetty/realm.properties"
todir="etc"/>
- <deployable type="war" file="${cargo.war}"/>
- <deployable type="war"
file="${dependency.cargo.jetty-deployer}">
- <property name="context"
value="cargo-jetty-deployer"/>
- </deployable>
- </configuration>
- </cargo>
- </target>
-
- <target name="cargo.jetty-6.1.stop" depends="cargo.setup">
- <cargo
- containerId="jetty6x"
- home="${test.jetty-6.1.home}"
- log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
- action="stop">
- <configuration home="${target}/cargo">
- </configuration>
- </cargo>
- </target>
-
- <target name="tests.jetty-6.1.execute"
unless="tests.jetty-6.1.execute.skip">
- <echo message="Starting Jetty 6.1 ${test.jetty-6.1.name} with
${test.jetty-6.1.home} to execute ${test.id} tests"/>
- <antcall target="cargo.jetty-6.1.start">
- <param name="cargo.wait" value="false"/>
- <param name="cargo.war" value="${test.war}"/>
- </antcall>
- <antcall target="tests.remote">
- <param name="test.remote.server.name"
value="${test.jetty-6.1.name}"/>
- <param name="test.remote.archive.path"
value="${test.archive.path}"/>
- </antcall>
- <antcall target="cargo.jetty-6.1.stop">
- </antcall>
- </target>
-
- <target name="tests.jetty-6.1.spi">
- <condition property="tests.jetty-6.1.execute.skip">
- <not>
- <available file="${test.jetty-6.1.home}"
type="dir"/>
- </not>
- </condition>
- <antcall target="tests.jetty-6.1.execute">
- <param name="test.id"
value="${test.jetty-6.1.name}-spi-handler"/>
- <param name="test.war"
value="${test.temp.lib}/jetty-6.1-handler/test-spi-server.war"/>
- <param name="test.archive.path"
value="jetty-6.1-handler"/>
- </antcall>
- <antcall target="tests.jetty-6.1.execute">
- <param name="test.id"
value="${test.jetty-6.1.name}-spi-generic"/>
- <param name="test.war"
value="${test.temp.lib}/jetty-6.1-generic/test-spi-server.war"/>
- <param name="test.archive.path"
value="jetty-6.1-generic"/>
- </antcall>
- </target>
-
- <target name="tests.jetty-6.1.endpoint">
- <condition property="tests.jetty-6.1.execute.skip">
- <not>
- <available file="${test.jetty-6.1.home}"
type="dir"/>
- </not>
- </condition>
- <antcall target="tests.jetty-6.1.execute">
- <param name="test.id"
value="${test.jetty-6.1.name}-endpoint-default-servlet-mapping"/>
- <param name="test.war"
value="${test.temp.lib}/jetty-6.1/default-servlet-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- <antcall target="tests.jetty-6.1.execute">
- <param name="test.id"
value="${test.jetty-6.1.name}-endpoint-root-path-mapping"/>
- <param name="test.war"
value="${test.temp.lib}/jetty-6.1/root-path-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- <antcall target="tests.jetty-6.1.execute">
- <param name="test.id"
value="${test.jetty-6.1.name}-endpoint-path-mapping"/>
- <param name="test.war"
value="${test.temp.lib}/jetty-6.1/path-mapping.war"/>
- <param name="test.archive.path" value=""/>
- </antcall>
- </target>
-
- <target name="tests.jetty-6.1">
- <!-- spi tests -->
- <antcall target="tests.jetty-6.1.spi">
- <param name="test.jetty-6.1.name"
value="RemoteJetty_6_1"/>
- <param name="test.jetty-6.1.home"
value="${JETTY_6_1_HOME}"/>
- </antcall>
-
- <!-- endpoint tests -->
- <antcall target="tests.jetty-6.1.endpoint">
- <param name="test.jetty-6.1.name"
value="RemoteJetty_6_1"/>
- <param name="test.jetty-6.1.home"
value="${JETTY_6_1_HOME}"/>
- </antcall>
- </target>
-
- <target name="tests.local">
-
- <taskdef name="jboss-unit"
classname="org.jboss.unit.tooling.ant.JBossUnitTask"
classpath="${plugin_classpath}"/>
-
- <jboss-unit>
-
- <tests config="${target}/test-classes/local-jboss-unit.xml">
- </tests>
-
- <reports>
- <xml toDir="${target}/test/reports/local/xml/local"/>
- <html toDir="${target}/test/reports/local/html/local"/>
- </reports>
-
- <classpath>
- <pathelement location="${target}/test-classes/config"/>
- <pathelement location="${target}/test-classes"/>
-
- <pathelement path="${test_classpath}"/>
- </classpath>
-
- </jboss-unit>
-
- </target>
-
-
- <target name="tests.remote">
-
- <echo message="test.temp.lib : ${test.temp.lib}"/>
- <echo message="test.remote.archive.path :
${test.remote.archive.path}"/>
-
- <taskdef name="jboss-unit"
classname="org.jboss.unit.tooling.ant.JBossUnitTask"
classpath="${plugin_classpath}"/>
-
- <jboss-unit>
-
- <tests config="${target}/test-classes/remote-jboss-unit.xml">
- <property name="archivePath"
value="${test.temp.lib}/${test.remote.archive.path}"/>
- <property name="serverName"
value="${test.remote.server.name}"/>
- </tests>
-
- <reports>
- <xml toDir="${target}/test/reports/${test.id}/xml/local"/>
- <html toDir="${target}/test/reports/${test.id}/html/local"/>
- </reports>
-
- <classpath>
- <pathelement location="${target}/test-classes/config"/>
- <pathelement location="${target}/classes"/>
- <pathelement location="${target}/test-classes"/>
-
- <pathelement path="${test_classpath}"/>
- </classpath>
-
- </jboss-unit>
-
- </target>
-
-</project>