[jboss-cvs] JBossAS SVN: r89965 - in projects/spider/trunk: deployers and 20 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jun 8 08:49:21 EDT 2009
Author: wolfc
Date: 2009-06-08 08:49:21 -0400 (Mon, 08 Jun 2009)
New Revision: 89965
Added:
projects/spider/trunk/deployers/
projects/spider/trunk/deployers/.classpath
projects/spider/trunk/deployers/.project
projects/spider/trunk/deployers/.settings/
projects/spider/trunk/deployers/.settings/org.eclipse.jdt.core.prefs
projects/spider/trunk/deployers/.settings/org.maven.ide.eclipse.prefs
projects/spider/trunk/deployers/pom.xml
projects/spider/trunk/deployers/src/
projects/spider/trunk/deployers/src/main/
projects/spider/trunk/deployers/src/main/java/
projects/spider/trunk/deployers/src/main/java/org/
projects/spider/trunk/deployers/src/main/java/org/jboss/
projects/spider/trunk/deployers/src/main/java/org/jboss/spider/
projects/spider/trunk/deployers/src/main/java/org/jboss/spider/deployers/
projects/spider/trunk/deployers/src/test/
projects/spider/trunk/deployers/src/test/java/
projects/spider/trunk/deployers/src/test/java/org/
projects/spider/trunk/deployers/src/test/java/org/jboss/
projects/spider/trunk/deployers/src/test/java/org/jboss/spider/
projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/
projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/
projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/common/
projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/common/AbstractWebTestCase.java
projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/common/DummyPersistenceUnitDependencyResolver.java
projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/servlet/
projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/servlet/GreeterServlet.java
projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/servlet/unit/
projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/servlet/unit/BasicServletTestCase.java
projects/spider/trunk/deployers/src/test/resources/
projects/spider/trunk/deployers/src/test/resources/conf/
projects/spider/trunk/deployers/src/test/resources/conf/bootstrap.xml
projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/
projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/deployers.xml
projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/jmx-jdk.xml
projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/jpa.xml
projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/war-deployers.xml
projects/spider/trunk/deployers/src/test/resources/log4j.xml
Log:
JBAS-7001: initial build structure (+ failing unit test)
Property changes on: projects/spider/trunk/deployers
___________________________________________________________________
Name: svn:ignore
+ eclipse-target
target
Added: projects/spider/trunk/deployers/.classpath
===================================================================
--- projects/spider/trunk/deployers/.classpath (rev 0)
+++ projects/spider/trunk/deployers/.classpath 2009-06-08 12:49:21 UTC (rev 89965)
@@ -0,0 +1,8 @@
+<classpath>
+ <classpathentry kind="src" path="src/test/java" output="eclipse-target/test-classes" including="**/*.java"/>
+ <classpathentry kind="src" path="src/test/resources" output="eclipse-target/test-classes" excluding="**/*.java"/>
+ <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+ <classpathentry kind="output" path="eclipse-target/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+</classpath>
\ No newline at end of file
Added: projects/spider/trunk/deployers/.project
===================================================================
--- projects/spider/trunk/deployers/.project (rev 0)
+++ projects/spider/trunk/deployers/.project 2009-06-08 12:49:21 UTC (rev 89965)
@@ -0,0 +1,17 @@
+<projectDescription>
+ <name>jboss-spider-deployers</name>
+ <comment>VDF Deployers that deploy JBossWeb Servlets.</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added: projects/spider/trunk/deployers/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/spider/trunk/deployers/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ projects/spider/trunk/deployers/.settings/org.eclipse.jdt.core.prefs 2009-06-08 12:49:21 UTC (rev 89965)
@@ -0,0 +1,5 @@
+#Mon Jun 08 10:39:45 CEST 2009
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
Added: projects/spider/trunk/deployers/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/spider/trunk/deployers/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ projects/spider/trunk/deployers/.settings/org.maven.ide.eclipse.prefs 2009-06-08 12:49:21 UTC (rev 89965)
@@ -0,0 +1,8 @@
+#Mon Jun 08 11:47:30 CEST 2009
+activeProfiles=eclipse
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=false
+resourceFilterGoals=process-resources resources\:testResources
+version=1
Added: projects/spider/trunk/deployers/pom.xml
===================================================================
--- projects/spider/trunk/deployers/pom.xml (rev 0)
+++ projects/spider/trunk/deployers/pom.xml 2009-06-08 12:49:21 UTC (rev 89965)
@@ -0,0 +1,76 @@
+<!--
+ vi:ts=2:sw=2:expandtab
+-->
+<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 -->
+ <parent>
+ <groupId>org.jboss.spider</groupId>
+ <artifactId>jboss-spider</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- Artifact Configuration -->
+ <groupId>org.jboss.spider</groupId>
+ <artifactId>jboss-spider-deployers</artifactId>
+ <name>JBoss Spider Deployers</name>
+ <description>
+ VDF Deployers that deploy JBossWeb Servlets.
+ </description>
+
+ <properties>
+ <version.org.jboss.deployers>2.0.7.GA</version.org.jboss.deployers>
+ <version.jboss.web>2.1.3.GA</version.jboss.web>
+ </properties>
+
+ <!-- Dependencies -->
+ <dependencies>
+
+ <dependency>
+ <groupId>jboss.web</groupId>
+ <artifactId>jbossweb</artifactId>
+ <version>${version.jboss.web}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss.web</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${version.jboss.web}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap-impl-mc</artifactId>
+ <version>0.1.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- TODO: the real goal is to get rid of this dependency -->
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-tomcat</artifactId>
+ <version>5.1.0.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.metadata</groupId>
+ <artifactId>jboss-metadata</artifactId>
+ <version>1.0.1.GA</version>
+ </dependency>
+
+ <!-- Deployers SPI -->
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-spi</artifactId>
+ <version>${version.org.jboss.deployers}</version>
+ </dependency>
+ </dependencies>
+</project>
Added: projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/common/AbstractWebTestCase.java
===================================================================
--- projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/common/AbstractWebTestCase.java (rev 0)
+++ projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/common/AbstractWebTestCase.java 2009-06-08 12:49:21 UTC (rev 89965)
@@ -0,0 +1,215 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spider.deployers.test.common;
+
+import java.io.IOException;
+import java.lang.reflect.AnnotatedElement;
+import java.net.URL;
+import java.util.Arrays;
+
+import org.jboss.bootstrap.spi.lifecycle.LifecycleState;
+import org.jboss.bootstrap.spi.mc.config.MCServerConfig;
+import org.jboss.bootstrap.spi.mc.config.MCServerConfigFactory;
+import org.jboss.bootstrap.spi.mc.server.MCServer;
+import org.jboss.bootstrap.spi.mc.server.MCServerFactory;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.client.spi.main.MainDeployer;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.attachments.MutableAttachments;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.annotation.creator.web.Web25MetaDataCreator;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.annotation.finder.DefaultAnnotationFinder;
+import org.jboss.metadata.web.spec.Web25MetaData;
+import org.jboss.spider.deployers.test.servlet.unit.BasicServletTestCase;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class AbstractWebTestCase
+{
+ private static final Logger log = Logger.getLogger(BasicServletTestCase.class);
+
+ private static MCServer server;
+ private static Kernel kernel;
+ private static MainDeployer mainDeployer;
+
+ @AfterClass
+ public static void afterClass() throws Exception
+ {
+ if(server != null && server.getState() == LifecycleState.STARTED)
+ server.shutdown();
+ server = null;
+ }
+
+ @BeforeClass
+ public static void beforeClass() throws Exception
+ {
+ VFS.init();
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ // or via jboss-cl
+// VirtualFile roots[] = { };
+// classLoader = ClassLoaderSystem.getInstance().registerClassLoaderPolicy(VFSClassLoaderPolicy.createVFSClassLoaderPolicy("preboot-cl", roots));
+ MCServerConfig config = MCServerConfigFactory.createServerConfig(classLoader);
+ config.bootstrapHome("file:src/test/resources/conf");
+ server = MCServerFactory.createServer(classLoader);
+ server.setConfiguration(config);
+ server.initialize();
+ ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(classLoader);
+ try
+ {
+ server.start();
+
+ kernel = server.getKernel();
+
+ mainDeployer = getBean("MainDeployer", ControllerState.INSTALLED, MainDeployer.class);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(oldClassLoader);
+ }
+ }
+
+ /**
+ * Deploy a single deployment.
+ *
+ * @param deployment the deployment to deploy
+ * @return the deployed deployment
+ * @throws DeploymentException if deploying fails
+ */
+ protected static Deployment deploy(Deployment deployment) throws DeploymentException
+ {
+ log.info("Deploying " + deployment.getName());
+ mainDeployer.deploy(deployment);
+ mainDeployer.checkComplete(deployment);
+ return deployment;
+ }
+
+ /**
+ * Deploy multiple deployments.
+ *
+ * @param deployments the deployments to deploy
+ * @throws DeploymentException if deploying fails
+ */
+ protected static void deploy(Deployment... deployments) throws DeploymentException
+ {
+ for(Deployment deployment : deployments)
+ {
+ deploy(deployment);
+ }
+ }
+
+ /**
+ * Create a virtual deployment with a single attachment.
+ *
+ * @param <T> the attachment type
+ * @param name the name of the deployment
+ * @param attachmentType the type of attachment
+ * @param attachment the attachment
+ * @return the virtual deployment
+ */
+ protected static <T> Deployment deployment(String name, Class<T> attachmentType, T attachment)
+ {
+ try
+ {
+ URL url = new URL("vfsmemory", name, "");
+ VirtualFile root = VFS.getRoot(url);
+ VFSDeployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(root);
+ MutableAttachments attachments = (MutableAttachments) deployment.getPredeterminedManagedObjects();
+ attachments.addAttachment(attachmentType, attachment);
+ return deployment;
+ }
+ catch(IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Get a bean
+ *
+ * @param name the name of the bean
+ * @param state the state of the bean
+ * @return the bean
+ * @throws IllegalStateException when the bean does not exist at that state
+ */
+ protected static Object getBean(final Object name, final ControllerState state) throws IllegalStateException
+ {
+ KernelControllerContext context = getControllerContext(name, state);
+ return context.getTarget();
+ }
+
+ /**
+ * Get a bean
+ *
+ * @param <T> the expected type
+ * @param name the name of the bean
+ * @param state the state of the bean
+ * @param expected the expected type
+ * @return the bean
+ * @throws ClassCastException when the bean can not be cast to the expected type
+ * @throws IllegalStateException when the bean does not exist at that state
+ */
+ protected static <T> T getBean(final Object name, final ControllerState state, final Class<T> expected) throws ClassCastException, IllegalStateException
+ {
+ if (expected == null)
+ throw new IllegalArgumentException("Null expected");
+ Object bean = getBean(name, state);
+ return expected.cast(bean);
+ }
+
+ /**
+ * Get a context
+ *
+ * @param name the name of the bean
+ * @param state the state of the bean
+ * @return the context
+ * @throws IllegalStateException when the context does not exist at that state
+ */
+ protected static KernelControllerContext getControllerContext(final Object name, final ControllerState state) throws IllegalStateException
+ {
+ KernelController controller = kernel.getController();
+ KernelControllerContext context = (KernelControllerContext) controller.getContext(name, state);
+ if (context == null)
+ throw new IllegalStateException("Bean not found " + name + " at state " + state + " in controller " + controller);
+ return context;
+ }
+
+ protected static Web25MetaData servlets(Class<?>... servlets)
+ {
+ AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
+ Web25MetaDataCreator creator = new Web25MetaDataCreator(finder);
+ return creator.create(Arrays.asList(servlets));
+ }
+}
Added: projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/common/DummyPersistenceUnitDependencyResolver.java
===================================================================
--- projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/common/DummyPersistenceUnitDependencyResolver.java (rev 0)
+++ projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/common/DummyPersistenceUnitDependencyResolver.java 2009-06-08 12:49:21 UTC (rev 89965)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spider.deployers.test.common;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.jpa.resolvers.PersistenceUnitDependencyResolver;
+
+/**
+ * Doesn't do anything useful, gives a RuntimeException.
+ *
+ * This should not be here, JBoss Spider should have no compile / runtime dependencies on
+ * jboss-jpa-deployers.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class DummyPersistenceUnitDependencyResolver implements PersistenceUnitDependencyResolver
+{
+
+ public String createBeanName(DeploymentUnit deploymentUnit, String persistenceUnitName)
+ {
+ throw new RuntimeException("NYI");
+ }
+
+ public String resolvePersistenceUnitSupplier(DeploymentUnit deploymentUnit, String persistenceUnitName)
+ {
+ throw new RuntimeException("NYI");
+ }
+
+}
Added: projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/servlet/GreeterServlet.java
===================================================================
--- projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/servlet/GreeterServlet.java (rev 0)
+++ projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/servlet/GreeterServlet.java 2009-06-08 12:49:21 UTC (rev 89965)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spider.deployers.test.servlet;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Yeah good old basic greeter service.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class GreeterServlet extends HttpServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ String name = req.getParameter("name");
+
+ resp.setContentType("text/plain");
+ PrintWriter writer = resp.getWriter();
+ writer.println("Hello " + name);
+ }
+}
Added: projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/servlet/unit/BasicServletTestCase.java
===================================================================
--- projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/servlet/unit/BasicServletTestCase.java (rev 0)
+++ projects/spider/trunk/deployers/src/test/java/org/jboss/spider/deployers/test/servlet/unit/BasicServletTestCase.java 2009-06-08 12:49:21 UTC (rev 89965)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spider.deployers.test.servlet.unit;
+
+import org.jboss.metadata.web.spec.WebMetaData;
+import org.jboss.spider.deployers.test.common.AbstractWebTestCase;
+import org.junit.Test;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class BasicServletTestCase extends AbstractWebTestCase
+{
+ @Test
+ public void test1() throws Exception
+ {
+ deploy(deployment("servlet", WebMetaData.class, servlets(BasicServletTestCase.class)));
+ }
+}
Added: projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/deployers.xml
===================================================================
--- projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/deployers.xml (rev 0)
+++ projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/deployers.xml 2009-06-08 12:49:21 UTC (rev 89965)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ A very minimalistic MainDeployer setup.
+ -->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <!-- The MainDeployer -->
+ <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+ <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+ <property name="deployers"><inject bean="Deployers"/></property>
+ <!--
+ <property name="mgtDeploymentCreator"><inject bean="ManagedDeploymentCreator"/></property>
+ <property name="comparator"><inject bean="topContextComparator"/></property>
+ -->
+ </bean>
+
+ <!-- The holder for deployers that determine structure -->
+ <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+ <property name="structureBuilder">
+ <!-- The consolidator of the structure information -->
+ <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder"/>
+ </property>
+ <!-- Accept any implementor of structure deployer -->
+ <incallback method="addDeployer"/>
+ <uncallback method="removeDeployer"/>
+ </bean>
+
+ <!-- The holder for deployers that do real deployment -->
+ <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+ <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+ <!-- Accept any implementor of deployer -->
+ <incallback method="addDeployer"/>
+ <uncallback method="removeDeployer"/>
+ </bean>
+
+ <!-- File Structure -->
+ <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure"/>
+
+ <!-- JAR Structure -->
+ <bean name="JARStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure"/>
+</deployment>
\ No newline at end of file
Added: projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/jmx-jdk.xml
===================================================================
--- projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/jmx-jdk.xml (rev 0)
+++ projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/jmx-jdk.xml 2009-06-08 12:49:21 UTC (rev 89965)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <bean name="MBeanServer" class="javax.management.MBeanServer">
+ <constructor factoryClass="javax.management.MBeanServerFactory" factoryMethod="createMBeanServer">
+ <parameter class="java.lang.String">jboss</parameter>
+ </constructor>
+ </bean>
+</deployment>
\ No newline at end of file
Added: projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/jpa.xml
===================================================================
--- projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/jpa.xml (rev 0)
+++ projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/jpa.xml 2009-06-08 12:49:21 UTC (rev 89965)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Make sure we have a PUDepResolver (which does nothing)
+ -->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <bean name="DummyPersistenceUnitDependencyResolver" class="org.jboss.spider.deployers.test.common.DummyPersistenceUnitDependencyResolver"/>
+</deployment>
\ No newline at end of file
Added: projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/war-deployers.xml
===================================================================
--- projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/war-deployers.xml (rev 0)
+++ projects/spider/trunk/deployers/src/test/resources/conf/bootstrap/war-deployers.xml 2009-06-08 12:49:21 UTC (rev 89965)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ -->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <bean name="WarDeployer" class="org.jboss.web.tomcat.service.deployers.TomcatDeployer">
+ </bean>
+
+ <bean name="MergedJBossWebMetaDataDeployer" class="org.jboss.web.deployers.MergedJBossWebMetaDataDeployer"/>
+</deployment>
\ No newline at end of file
Added: projects/spider/trunk/deployers/src/test/resources/conf/bootstrap.xml
===================================================================
--- projects/spider/trunk/deployers/src/test/resources/conf/bootstrap.xml (rev 0)
+++ projects/spider/trunk/deployers/src/test/resources/conf/bootstrap.xml 2009-06-08 12:49:21 UTC (rev 89965)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ The list of URLs for mc beans to load during bootstrap.
+-->
+<bootstrap xmlns="urn:jboss:bootstrap:1.0">
+ <!-- This is the regular AS bootstrap
+ <url>bootstrap/logging.xml</url>
+ <url>bootstrap/vfs.xml</url>
+ <url>bootstrap/classloader.xml</url>
+ <url>bootstrap/aop.xml</url>
+ <url>bootstrap/jmx.xml</url>
+ <url>bootstrap/deployers.xml</url>
+ <url>bootstrap/bindings.xml</url>
+ <url>bootstrap/profile.xml</url>
+ -->
+
+ <url>bootstrap/jmx-jdk.xml</url>
+ <url>bootstrap/deployers.xml</url>
+ <url>bootstrap/jpa.xml</url>
+ <url>bootstrap/war-deployers.xml</url>
+</bootstrap>
Added: projects/spider/trunk/deployers/src/test/resources/log4j.xml
===================================================================
--- projects/spider/trunk/deployers/src/test/resources/log4j.xml (rev 0)
+++ projects/spider/trunk/deployers/src/test/resources/log4j.xml 2009-06-08 12:49:21 UTC (rev 89965)
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml 68671 2008-01-08 10:04:25Z wolfc $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A time/date based rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
+ <param name="File" value="target/test.log"/>
+ <param name="Append" value="false"/>
+
+ <!-- Rollover at midnight each day -->
+ <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+ <!-- Rollover at the top of each hour
+ <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
+ -->
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+
+ <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+ <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
+ -->
+ </layout>
+ </appender>
+
+ <!-- A size based file rolling appender
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <param name="File" value="${jboss.server.home.dir}/log/server.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+ </layout>
+ </appender>
+ -->
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="ALL"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Limit JBoss categories to INFO
+ <category name="org.jboss">
+ <priority value="INFO" class="org.jboss.logging.XLevel"/>
+ </category>
+ -->
+
+ <!-- Increase the priority threshold for the DefaultDS category
+ <category name="DefaultDS">
+ <priority value="FATAL"/>
+ </category>
+ -->
+
+ <!-- Decrease the priority threshold for the org.jboss.varia category
+ <category name="org.jboss.varia">
+ <priority value="DEBUG"/>
+ </category>
+ -->
+
+ <!--
+ | An example of enabling the custom TRACE level priority that is used
+ | by the JBoss internals to diagnose low level details. This example
+ | turns on TRACE level msgs for the org.jboss.ejb.plugins package and its
+ | subpackages. This will produce A LOT of logging output.
+ <category name="org.jboss.system">
+ <priority value="TRACE" class="org.jboss.logging.XLevel"/>
+ </category>
+ -->
+
+ <category name="org.jboss">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <priority value="WARN" />
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
More information about the jboss-cvs-commits
mailing list