[jboss-cvs] JBossAS SVN: r93091 - in projects/mc-int/trunk/servlet: src/test/java and 14 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Sep 1 16:27:03 EDT 2009
Author: alesj
Date: 2009-09-01 16:27:02 -0400 (Tue, 01 Sep 2009)
New Revision: 93091
Added:
projects/mc-int/trunk/servlet/src/test/java/org/
projects/mc-int/trunk/servlet/src/test/java/org/jboss/
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/support/
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/support/MockServletContext.java
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/VDFConnectorTest.java
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/VDFConnectorTestDelegate.java
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/attachment/
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/attachment/test/
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/attachment/test/AttachmentVDFConnectorTestCase.java
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/bean/
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/bean/test/
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/bean/test/BeanVDFConnectorTestCase.java
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/beanfactory/
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/beanfactory/test/
projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/beanfactory/test/BeanFactoryVDFConnectorTestCase.java
Modified:
projects/mc-int/trunk/servlet/pom.xml
Log:
Add VDFConnector tests - initial patch.
Modified: projects/mc-int/trunk/servlet/pom.xml
===================================================================
--- projects/mc-int/trunk/servlet/pom.xml 2009-09-01 19:50:15 UTC (rev 93090)
+++ projects/mc-int/trunk/servlet/pom.xml 2009-09-01 20:27:02 UTC (rev 93091)
@@ -72,6 +72,17 @@
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
-
+
</project>
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/support/MockServletContext.java
===================================================================
--- projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/support/MockServletContext.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/support/MockServletContext.java 2009-09-01 20:27:02 UTC (rev 93091)
@@ -0,0 +1,187 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.test.mc.servlet.vdf.support;
+
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.Servlet;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants;
+import org.jboss.util.collection.Iterators;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class MockServletContext implements ServletContext
+{
+ private Map<String, Object> attributes;
+
+ public MockServletContext(Kernel kernel, DeploymentUnit unit)
+ {
+ attributes = new HashMap<String, Object>();
+ attributes.put(KernelConstants.KERNEL_NAME, kernel);
+ attributes.put(DeploymentUnit.class.getName(), unit);
+ }
+
+ public MockServletContext(Map<String, Object> attributes)
+ {
+ if (attributes == null)
+ throw new IllegalArgumentException("Null attributes");
+
+ this.attributes = attributes;
+ }
+
+ public String getContextPath()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServletContext getContext(String uripath)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public int getMajorVersion()
+ {
+ return 0; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public int getMinorVersion()
+ {
+ return 0; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public String getMimeType(String file)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Set getResourcePaths(String path)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public URL getResource(String path) throws MalformedURLException
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public InputStream getResourceAsStream(String path)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public RequestDispatcher getRequestDispatcher(String path)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public RequestDispatcher getNamedDispatcher(String name)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Servlet getServlet(String name) throws ServletException
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Enumeration getServlets()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Enumeration getServletNames()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void log(String msg)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void log(Exception exception, String msg)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void log(String message, Throwable throwable)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public String getRealPath(String path)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public String getServerInfo()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public String getInitParameter(String name)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Enumeration getInitParameterNames()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Object getAttribute(String name)
+ {
+ return attributes.get(name);
+ }
+
+ public Enumeration getAttributeNames()
+ {
+ return Iterators.toEnumeration(attributes.keySet().iterator());
+ }
+
+ public void setAttribute(String name, Object object)
+ {
+ attributes.put(name, object);
+ }
+
+ public void removeAttribute(String name)
+ {
+ attributes.remove(name);
+ }
+
+ public String getServletContextName()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/VDFConnectorTest.java
===================================================================
--- projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/VDFConnectorTest.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/VDFConnectorTest.java 2009-09-01 20:27:02 UTC (rev 93091)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.test.mc.servlet.vdf.test;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit;
+import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.kernel.junit.MicrocontainerTest;
+
+/**
+ * VDF connector test.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public abstract class VDFConnectorTest extends MicrocontainerTest
+{
+ protected VDFConnectorTest(String name)
+ {
+ super(name);
+ }
+
+ protected ServletContext createServletContext()
+ {
+ DeploymentUnit unit = createDeploymentUnit();
+ return createServletContext(unit);
+ }
+
+ protected DeploymentUnit createDeploymentUnit()
+ {
+ return new AbstractDeploymentUnit();
+ }
+
+ protected ServletContext createServletContext(DeploymentUnit unit)
+ {
+ return getMCDelegate().createServletContext(unit);
+ }
+
+ /**
+ * Get the test delegate
+ *
+ * @param clazz the test class
+ * @return the delegate
+ * @throws Exception for any error
+ */
+ public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
+ {
+ return new VDFConnectorTestDelegate(clazz);
+ }
+
+ @Override
+ protected VDFConnectorTestDelegate getMCDelegate()
+ {
+ return (VDFConnectorTestDelegate) getDelegate();
+ }
+}
Added: projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/VDFConnectorTestDelegate.java
===================================================================
--- projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/VDFConnectorTestDelegate.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/VDFConnectorTestDelegate.java 2009-09-01 20:27:02 UTC (rev 93091)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.test.mc.servlet.vdf.test;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.test.kernel.junit.MicrocontainerTestDelegate;
+import org.jboss.test.mc.servlet.vdf.support.MockServletContext;
+
+/**
+ * VDF connector test.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class VDFConnectorTestDelegate extends MicrocontainerTestDelegate
+{
+ public VDFConnectorTestDelegate(Class<?> clazz) throws Exception
+ {
+ super(clazz);
+ }
+
+ ServletContext createServletContext(DeploymentUnit unit)
+ {
+ return new MockServletContext(kernel, unit);
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/attachment/test/AttachmentVDFConnectorTestCase.java
===================================================================
--- projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/attachment/test/AttachmentVDFConnectorTestCase.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/attachment/test/AttachmentVDFConnectorTestCase.java 2009-09-01 20:27:02 UTC (rev 93091)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.test.mc.servlet.vdf.test.attachment.test;
+
+import org.jboss.test.mc.servlet.vdf.test.VDFConnectorTest;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class AttachmentVDFConnectorTestCase extends VDFConnectorTest
+{
+ public AttachmentVDFConnectorTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testBasic() throws Exception
+ {
+ // TODO
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/bean/test/BeanVDFConnectorTestCase.java
===================================================================
--- projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/bean/test/BeanVDFConnectorTestCase.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/bean/test/BeanVDFConnectorTestCase.java 2009-09-01 20:27:02 UTC (rev 93091)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.test.mc.servlet.vdf.test.bean.test;
+
+import org.jboss.test.mc.servlet.vdf.test.VDFConnectorTest;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class BeanVDFConnectorTestCase extends VDFConnectorTest
+{
+ public BeanVDFConnectorTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testBasic() throws Exception
+ {
+ // TODO
+ }
+}
Added: projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/beanfactory/test/BeanFactoryVDFConnectorTestCase.java
===================================================================
--- projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/beanfactory/test/BeanFactoryVDFConnectorTestCase.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/test/java/org/jboss/test/mc/servlet/vdf/test/beanfactory/test/BeanFactoryVDFConnectorTestCase.java 2009-09-01 20:27:02 UTC (rev 93091)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.test.mc.servlet.vdf.test.beanfactory.test;
+
+import org.jboss.test.mc.servlet.vdf.test.VDFConnectorTest;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class BeanFactoryVDFConnectorTestCase extends VDFConnectorTest
+{
+ public BeanFactoryVDFConnectorTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testBasic() throws Exception
+ {
+ // TODO
+ }
+}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list