[jboss-svn-commits] JBoss Common SVN: r4636 - in arquillian/trunk/containers/weld-ee-embedded: src/main/java/org/jboss/arquillian and 14 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Jun 30 09:50:26 EDT 2010


Author: aslak
Date: 2010-06-30 09:50:24 -0400 (Wed, 30 Jun 2010)
New Revision: 4636

Added:
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/BeanUtils.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/CDIConversationID.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/CDIRequestID.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/CDISessionID.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/ConversationLifeCycleCreator.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/ConversationLifeCycleDestoryer.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/RequestLifeCycleCreator.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/RequestLifeCycleDestroyer.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/SessionLifeCycleCreator.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/SessionLifeCycleDestoryer.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEEMockConfiguration.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEEMockContainer.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEETestEnricher.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/AbstractMockDeployment.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockBeanDeploymentArchive.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockDeployment.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockEELifecycle.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockEjBServices.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockEjbDescriptor.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockEjbInjectionServices.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockHttpSession.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockJpaServices.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockLifecycle.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockResourceLoader.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockResourceServices.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockSecurityServices.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockServletContext.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockServletLifecycle.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockServletServices.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockTransactionServices.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockValidationServices.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockValidator.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/TestContainer.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/el/
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/shrinkwrap/
   arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/
   arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/
   arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/
   arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/
   arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEmbeddedIntegrationEARTestCase.java
   arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEmbeddedIntegrationJARTestCase.java
   arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEmbeddedIntegrationWARTestCase.java
   arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/beans/
Removed:
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/
   arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/weldee/
Modified:
   arquillian/trunk/containers/weld-ee-embedded/pom.xml
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/el/EL.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/shrinkwrap/ShrinkWrapClassLoader.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/shrinkwrap/ShrinkwrapBeanDeploymentArchive.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/shrinkwrap/ShrinkwrapBeanDeploymentArchiveImpl.java
   arquillian/trunk/containers/weld-ee-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration
   arquillian/trunk/containers/weld-ee-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer
   arquillian/trunk/containers/weld-ee-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher
   arquillian/trunk/containers/weld-ee-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.weldee.shrinkwrap.ShrinkwrapBeanDeploymentArchive
   arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/beans/MyBean.java
Log:
ARQ-200 ARQ-174 Renamed Weld EE 1.1 Embedded Container package


Modified: arquillian/trunk/containers/weld-ee-embedded/pom.xml
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/pom.xml	2010-06-30 13:33:39 UTC (rev 4635)
+++ arquillian/trunk/containers/weld-ee-embedded/pom.xml	2010-06-30 13:50:24 UTC (rev 4636)
@@ -15,9 +15,9 @@
 
 	<!-- Artifact Configuration -->
 	<groupId>org.jboss.arquillian.container</groupId>
-	<artifactId>arquillian-weld-ee-embedded</artifactId>
-	<name>Arquillian Container Weld EE Embedded</name>
-	<description>Weld EE Embedded Container integration for the Arquillian Project</description>
+	<artifactId>arquillian-weld-ee-embedded-1_1</artifactId>
+	<name>Arquillian Container Weld EE Embedded 1.1.x</name>
+	<description>Weld EE 1.1.x Embedded Container integration for the Arquillian Project</description>
 
 
 	<!-- Properties -->

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/BeanUtils.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/BeanUtils.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/BeanUtils.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/BeanUtils.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1;
+
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+
+/**
+ * BeanUtils
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+final class BeanUtils
+{
+   private BeanUtils() {}
+   
+   @SuppressWarnings("unchecked")
+   static <T> T getBeanReference(BeanManager manager, Class<T> type) 
+   {
+      Bean bean = manager.resolve(manager.getBeans(type));
+      return (T)manager.getReference(
+            bean, 
+            type,
+            manager.createCreationalContext(null));
+   }
+
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/CDIConversationID.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/CDIConversationID.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/CDIConversationID.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/CDIConversationID.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1;
+
+/**
+ * Simple CDI COnversation ID holder object. Bound to the Class context
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class CDIConversationID 
+{
+   private String id;
+   
+   public CDIConversationID(final String id)
+   {
+      this.id = id;
+   }
+   
+   public String getId()
+   {
+      return id;
+   }
+}
+

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/CDIRequestID.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/CDIRequestID.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/CDIRequestID.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/CDIRequestID.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1;
+
+import org.jboss.weld.context.api.BeanStore;
+
+/**
+ * Simple CDI COnversation ID holder object. Bound to the Class context
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class CDIRequestID 
+{
+   private String id;
+   private BeanStore beanStore;
+   
+   public CDIRequestID(final String id, BeanStore beanStore)
+   {
+      this.id = id;
+      this.beanStore = beanStore;
+   }
+   
+   public String getId()
+   {
+      return id;
+   }
+   
+   public BeanStore getBeanStore()
+   {
+      return beanStore;
+   }
+}
+

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/CDISessionID.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/CDISessionID.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/CDISessionID.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/CDISessionID.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1;
+
+import org.jboss.weld.context.api.BeanStore;
+
+/**
+ * Simple CDI COnversation ID holder object. Bound to the Class context
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class CDISessionID 
+{
+   private String id;
+   private BeanStore beanStore;
+   
+   public CDISessionID(final String id, BeanStore beanStore)
+   {
+      this.id = id;
+      this.beanStore = beanStore;
+   }
+   
+   public String getId()
+   {
+      return id;
+   }
+   
+   public BeanStore getBeanStore()
+   {
+      return beanStore;
+   }
+}
+

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/ConversationLifeCycleCreator.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/ConversationLifeCycleCreator.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/ConversationLifeCycleCreator.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/ConversationLifeCycleCreator.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1;
+
+import org.jboss.arquillian.spi.Context;
+import org.jboss.arquillian.spi.event.Event;
+import org.jboss.arquillian.spi.event.suite.EventHandler;
+import org.jboss.weld.conversation.ConversationManager2;
+import org.jboss.weld.manager.api.WeldManager;
+
+/**
+ * SessionLifeCycleController
+ *
+ * @author <a href="mailto:aknutsen at redhat.com">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class ConversationLifeCycleCreator implements EventHandler<Event>
+{
+   /* (non-Javadoc)
+    * @see org.jboss.arquillian.spi.EventHandler#callback(org.jboss.arquillian.spi.Context, java.lang.Object)
+    */
+   public void callback(Context context, Event event) throws Exception 
+   {
+      WeldManager manager = context.get(WeldManager.class);
+      if(manager == null)
+      {
+         throw new IllegalStateException("No " + WeldManager.class.getName() + " found in context");
+      }
+      
+      ConversationManager2 conversationManager = BeanUtils.getBeanReference(manager, ConversationManager2.class);      
+      CDIConversationID id = context.get(CDIConversationID.class);
+      if(id == null)
+      {
+         id = new CDIConversationID(null); // when null creates a new empty conversation id. 
+      }
+      conversationManager.setupContext();
+      conversationManager.setupConversation(id.getId());
+   }
+}
\ No newline at end of file

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/ConversationLifeCycleDestoryer.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/ConversationLifeCycleDestoryer.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/ConversationLifeCycleDestoryer.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/ConversationLifeCycleDestoryer.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1;
+
+import javax.enterprise.context.Conversation;
+
+import org.jboss.arquillian.spi.Context;
+import org.jboss.arquillian.spi.event.Event;
+import org.jboss.arquillian.spi.event.suite.EventHandler;
+import org.jboss.weld.conversation.ConversationManager2;
+import org.jboss.weld.manager.api.WeldManager;
+
+/**
+ * DestorySession
+ *
+ * @author <a href="mailto:aknutsen at redhat.org">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class ConversationLifeCycleDestoryer implements EventHandler<Event> {
+   
+   /* (non-Javadoc)
+    * @see org.jboss.arquillian.spi.event.EventHandler#callback(org.jboss.arquillian.spi.Context, java.lang.Object)
+    */
+   public void callback(Context context, Event event) throws Exception
+   {
+      WeldManager manager = context.get(WeldManager.class);
+      
+      Conversation conversation = BeanUtils.getBeanReference(manager, Conversation.class);
+      if(!conversation.isTransient()) 
+      {
+         context.add(CDIConversationID.class, new CDIConversationID(conversation.getId()));
+      }
+      else 
+      {
+         context.add(CDIConversationID.class, new CDIConversationID(null));
+      }
+
+      ConversationManager2 conversationManager = BeanUtils.getBeanReference(manager, ConversationManager2.class);
+      conversationManager.teardownConversation();
+      conversationManager.teardownContext();
+   }
+}
\ No newline at end of file

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/RequestLifeCycleCreator.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/RequestLifeCycleCreator.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/RequestLifeCycleCreator.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/RequestLifeCycleCreator.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1;
+
+import java.util.UUID;
+
+import org.jboss.arquillian.spi.Context;
+import org.jboss.arquillian.spi.event.Event;
+import org.jboss.arquillian.spi.event.suite.EventHandler;
+import org.jboss.weld.context.ContextLifecycle;
+import org.jboss.weld.context.api.BeanStore;
+import org.jboss.weld.context.api.helpers.ConcurrentHashMapBeanStore;
+import org.jboss.weld.manager.api.WeldManager;
+
+/**
+ * SessionLifeCycleController
+ *
+ * @author <a href="mailto:aknutsen at redhat.com">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class RequestLifeCycleCreator implements EventHandler<Event>
+{
+   /* (non-Javadoc)
+    * @see org.jboss.arquillian.spi.EventHandler#callback(org.jboss.arquillian.spi.Context, java.lang.Object)
+    */
+   public void callback(Context context, Event event) throws Exception 
+   {
+      WeldManager manager = context.get(WeldManager.class);
+      if(manager == null)
+      {
+         throw new IllegalStateException("No " + WeldManager.class.getName() + " found in context");
+      }
+      ContextLifecycle lifeCycle = manager.getServices().get(ContextLifecycle.class);
+
+      String requestId = UUID.randomUUID().toString();
+      BeanStore beanStore = new ConcurrentHashMapBeanStore();
+      
+      lifeCycle.beginRequest(requestId, beanStore);
+      
+      context.add(CDIRequestID.class, new CDIRequestID(requestId, beanStore));
+   }
+   
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/RequestLifeCycleDestroyer.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/RequestLifeCycleDestroyer.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/RequestLifeCycleDestroyer.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/RequestLifeCycleDestroyer.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1;
+
+import org.jboss.arquillian.spi.Context;
+import org.jboss.arquillian.spi.event.Event;
+import org.jboss.arquillian.spi.event.suite.EventHandler;
+import org.jboss.weld.context.ContextLifecycle;
+import org.jboss.weld.manager.api.WeldManager;
+
+/**
+ *
+ * @author <a href="mailto:aknutsen at redhat.org">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class RequestLifeCycleDestroyer implements EventHandler<Event> {
+   
+   /* (non-Javadoc)
+    * @see org.jboss.arquillian.spi.event.EventHandler#callback(org.jboss.arquillian.spi.Context, java.lang.Object)
+    */
+   public void callback(Context context, Event event) throws Exception
+   {
+      WeldManager manager = context.get(WeldManager.class);
+      CDIRequestID id = context.get(CDIRequestID.class);
+      if(id != null)
+      {
+         manager.getServices().get(ContextLifecycle.class).endRequest(id.getId(), id.getBeanStore());
+      }
+   }
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/SessionLifeCycleCreator.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/SessionLifeCycleCreator.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/SessionLifeCycleCreator.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/SessionLifeCycleCreator.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1;
+
+import java.util.UUID;
+
+import org.jboss.arquillian.spi.Context;
+import org.jboss.arquillian.spi.event.Event;
+import org.jboss.arquillian.spi.event.suite.EventHandler;
+import org.jboss.weld.context.ContextLifecycle;
+import org.jboss.weld.context.api.BeanStore;
+import org.jboss.weld.context.api.helpers.ConcurrentHashMapBeanStore;
+import org.jboss.weld.manager.api.WeldManager;
+
+/**
+ * SessionLifeCycleController
+ *
+ * @author <a href="mailto:aknutsen at redhat.com">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class SessionLifeCycleCreator implements EventHandler<Event>
+{
+   /* (non-Javadoc)
+    * @see org.jboss.arquillian.spi.EventHandler#callback(org.jboss.arquillian.spi.Context, java.lang.Object)
+    */
+   public void callback(Context context, Event event) throws Exception 
+   {
+      WeldManager manager = context.get(WeldManager.class);
+      if(manager == null)
+      {
+         throw new IllegalStateException("No " + WeldManager.class.getName() + " found in context");
+      }
+      ContextLifecycle lifeCycle = manager.getServices().get(ContextLifecycle.class);
+
+      String sessionId = UUID.randomUUID().toString();
+      BeanStore beanStore = new ConcurrentHashMapBeanStore();
+      
+      lifeCycle.restoreSession(sessionId, beanStore);
+      context.add(CDISessionID.class, new CDISessionID(sessionId, beanStore));
+   }
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/SessionLifeCycleDestoryer.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/SessionLifeCycleDestoryer.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/SessionLifeCycleDestoryer.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/SessionLifeCycleDestoryer.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,29 @@
+package org.jboss.arquillian.container.weld.ee.embedded_1_1;
+
+import org.jboss.arquillian.spi.Context;
+import org.jboss.arquillian.spi.event.Event;
+import org.jboss.arquillian.spi.event.suite.EventHandler;
+import org.jboss.weld.context.ContextLifecycle;
+import org.jboss.weld.manager.api.WeldManager;
+
+/**
+ * DestorySession
+ *
+ * @author <a href="mailto:aknutsen at redhat.org">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class SessionLifeCycleDestoryer implements EventHandler<Event> {
+   
+   /* (non-Javadoc)
+    * @see org.jboss.arquillian.spi.event.EventHandler#callback(org.jboss.arquillian.spi.Context, java.lang.Object)
+    */
+   public void callback(Context context, Event event) throws Exception
+   {
+      WeldManager manager = context.get(WeldManager.class);
+      CDISessionID id = context.get(CDISessionID.class);
+      if(id != null)
+      {
+         manager.getServices().get(ContextLifecycle.class).endSession(id.getId(), id.getBeanStore());
+      }
+   }
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEEMockConfiguration.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/WeldEEMockConfiguration.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEEMockConfiguration.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEEMockConfiguration.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1;
+
+import org.jboss.arquillian.spi.ContainerConfiguration;
+import org.jboss.arquillian.spi.ContainerProfile;
+
+/**
+ * WeldSEConfiguration
+ *
+ * @author <a href="mailto:aknutsen at redhat.com">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class WeldEEMockConfiguration implements ContainerConfiguration
+{
+   /**
+    * Flag to enable the Conversation Scope outside a JSF Request 
+    */
+   private boolean enableConversationScope = false;
+   
+   public ContainerProfile getContainerProfile()
+   {
+      return ContainerProfile.STANDALONE;
+   }
+
+   public void setEnableConversationScope(boolean enableConversationScope)
+   {
+      this.enableConversationScope = enableConversationScope;
+   }
+   
+   public boolean isEnableConversationScope()
+   {
+      return enableConversationScope;
+   }
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEEMockContainer.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/WeldEEMockContainer.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEEMockContainer.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEEMockContainer.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,117 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1;
+
+import org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.MockEELifecycle;
+import org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.MockHttpSession;
+import org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.MockServletContext;
+import org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.TestContainer;
+import org.jboss.arquillian.container.weld.ee.embedded_1_1.shrinkwrap.ShrinkwrapBeanDeploymentArchive;
+import org.jboss.arquillian.protocol.local.LocalMethodExecutor;
+import org.jboss.arquillian.spi.Configuration;
+import org.jboss.arquillian.spi.ContainerMethodExecutor;
+import org.jboss.arquillian.spi.Context;
+import org.jboss.arquillian.spi.DeployableContainer;
+import org.jboss.arquillian.spi.DeploymentException;
+import org.jboss.arquillian.spi.LifecycleException;
+import org.jboss.arquillian.spi.event.container.AfterDeploy;
+import org.jboss.arquillian.spi.event.container.BeforeUnDeploy;
+import org.jboss.arquillian.spi.event.suite.After;
+import org.jboss.arquillian.spi.event.suite.Before;
+import org.jboss.arquillian.spi.event.suite.EventHandler;
+import org.jboss.arquillian.spi.event.suite.TestEvent;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.weld.bootstrap.WeldBootstrap;
+import org.jboss.weld.manager.api.WeldManager;
+import org.jboss.weld.servlet.HttpSessionManager;
+
+/**
+ * WeldEEMockConainer
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class WeldEEMockContainer implements DeployableContainer
+{
+   public void setup(Context context, Configuration configuration)
+   {
+   }
+
+   public void start(Context context) throws LifecycleException
+   {
+   }
+
+   public ContainerMethodExecutor deploy(Context context, Archive<?> archive) throws DeploymentException
+   {
+      boolean enableConversation = context.get(Configuration.class)
+                                          .getContainerConfig(WeldEEMockConfiguration.class)
+                                          .isEnableConversationScope();
+      
+      MockEELifecycle lifecycle = new MockEELifecycle(
+            archive.as(ShrinkwrapBeanDeploymentArchive.class));
+
+      TestContainer container = new TestContainer(lifecycle);
+      container.startContainer();
+      
+      context.add(TestContainer.class, container);
+      context.add(WeldBootstrap.class, lifecycle.getBootstrap());
+      context.add(WeldManager.class, container.getBeanManager());
+
+      context.register(AfterDeploy.class, new SessionLifeCycleCreator());
+      context.register(BeforeUnDeploy.class, new SessionLifeCycleDestoryer());
+      
+      context.register(Before.class, new RequestLifeCycleCreator());
+
+      // handler to 'Produce' a fake HTTPSession
+      // TODO: Weld ConversationManager should communicate with a Service so it's possible to override the HttpSessionManager as part of Bootstrap.
+      context.register(Before.class, new EventHandler<TestEvent>()
+      {
+         public void callback(Context context, TestEvent event) throws Exception
+         {
+            WeldManager manager = context.get(WeldManager.class);
+            CDISessionID id = context.get(CDISessionID.class);
+            if(id != null)
+            {
+               BeanUtils.getBeanReference(manager, HttpSessionManager.class)
+                     .setSession(
+                           new MockHttpSession(id.getId(), new MockServletContext("/")));
+            }
+         }
+      });
+      if(enableConversation)
+      {
+         context.register(Before.class, new ConversationLifeCycleCreator());         
+         context.register(After.class, new ConversationLifeCycleDestoryer());
+      }
+      context.register(After.class, new RequestLifeCycleDestroyer());
+      
+      return new LocalMethodExecutor();
+   }
+
+   public void undeploy(Context context, Archive<?> archive) throws DeploymentException
+   {
+      TestContainer container = context.get(TestContainer.class);
+      if(container != null)
+      {
+         container.stopContainer();
+      }
+   }
+
+   public void stop(Context context) throws LifecycleException
+   {
+   }
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEETestEnricher.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/WeldEETestEnricher.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEETestEnricher.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEETestEnricher.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1;
+
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.jboss.arquillian.spi.Context;
+import org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher;
+import org.jboss.weld.manager.api.WeldManager;
+
+/**
+ * WeldSETestEnricher
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class WeldEETestEnricher extends CDIInjectionEnricher
+{
+   @Override
+   protected BeanManager lookupBeanManager(Context context)
+   {
+      return context.get(WeldManager.class);
+   }
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/AbstractMockDeployment.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/AbstractMockDeployment.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/AbstractMockDeployment.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/AbstractMockDeployment.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.weld.bootstrap.api.ServiceRegistry;
+import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.bootstrap.spi.Deployment;
+
+public abstract class AbstractMockDeployment implements Deployment
+{
+
+   private final List<BeanDeploymentArchive> beanDeploymentArchives;
+   private final ServiceRegistry services;
+
+   public AbstractMockDeployment(BeanDeploymentArchive... beanDeploymentArchives)
+   {
+      this.services = new SimpleServiceRegistry();
+      this.beanDeploymentArchives = new ArrayList<BeanDeploymentArchive>(Arrays.asList(beanDeploymentArchives));
+   }
+
+   public List<BeanDeploymentArchive> getBeanDeploymentArchives()
+   {
+      return beanDeploymentArchives;
+   }
+
+   public ServiceRegistry getServices()
+   {
+      return services;
+   }
+
+}
\ No newline at end of file

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockBeanDeploymentArchive.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockBeanDeploymentArchive.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockBeanDeploymentArchive.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockBeanDeploymentArchive.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,145 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.ejb.EnterpriseBean;
+import javax.ejb.MessageDriven;
+import javax.ejb.Singleton;
+import javax.ejb.Stateful;
+import javax.ejb.Stateless;
+
+import org.jboss.weld.bootstrap.api.ServiceRegistry;
+import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.ejb.spi.EjbDescriptor;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockBeanDeploymentArchive implements BeanDeploymentArchive
+{
+   
+
+   private Collection<Class<?>> beanClasses;
+   private Collection<URL> beansXmlFiles;
+   private List<EjbDescriptor<?>> ejbs;
+   private final ServiceRegistry services;
+   private final Collection<BeanDeploymentArchive> bdas;
+   private final String id;
+   
+   public MockBeanDeploymentArchive()
+   {
+      this("test");
+   }
+   
+   public MockBeanDeploymentArchive(String id, Class<?> ... classes)
+   {
+      this.services = new SimpleServiceRegistry();
+      this.beanClasses = Arrays.asList(classes);
+      this.beansXmlFiles = new HashSet<URL>();
+      this.bdas = new HashSet<BeanDeploymentArchive>();
+      this.id = id;
+   }
+
+   public Collection<Class<?>> getBeanClasses()
+   {
+      return beanClasses;
+   }
+   
+   public void setBeanClasses(Collection<Class<?>> beanClasses)
+   {
+      this.beanClasses = beanClasses;
+      ejbs = new ArrayList<EjbDescriptor<?>>();
+      for (Class<?> ejbClass : discoverEjbs(getBeanClasses()))
+      {
+         ejbs.add(MockEjbDescriptor.of(ejbClass));
+      }
+   }
+
+   public Collection<URL> getBeansXml()
+   {
+      return beansXmlFiles;
+   }
+   
+   public void setBeansXmlFiles(Collection<URL> beansXmlFiles)
+   {
+      this.beansXmlFiles = beansXmlFiles;
+   }
+
+   public Collection<BeanDeploymentArchive> getBeanDeploymentArchives()
+   {
+      return bdas;
+   }
+   
+   public Collection<EjbDescriptor<?>> getEjbs()
+   {
+      return ejbs;
+   }
+   
+   protected static Iterable<Class<?>> discoverEjbs(Iterable<Class<?>> webBeanClasses)
+   {
+      Set<Class<?>> ejbs = new HashSet<Class<?>>();
+      for (Class<?> clazz : webBeanClasses)
+      {
+         if (clazz.isAnnotationPresent(Stateless.class) || clazz.isAnnotationPresent(Stateful.class) || clazz.isAnnotationPresent(MessageDriven.class) || clazz.isAnnotationPresent(Singleton.class) || EnterpriseBean.class.isAssignableFrom(clazz)) 
+         {
+            ejbs.add(clazz);
+         }
+      }
+      return ejbs;
+   }
+   
+   public ServiceRegistry getServices()
+   {
+      return services;
+   }
+   
+   public String getId()
+   {
+      return id;
+   }
+   
+   @Override
+   public boolean equals(Object obj)
+   {
+      if (obj instanceof MockBeanDeploymentArchive)
+      {
+         MockBeanDeploymentArchive that = (MockBeanDeploymentArchive) obj;
+         return this.getId().equals(that.getId());
+      }
+      else
+      {
+         return false;
+      }
+   }
+   
+   @Override
+   public int hashCode()
+   {
+      return getId().hashCode();
+   }
+
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockDeployment.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockDeployment.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockDeployment.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockDeployment.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+
+public class MockDeployment extends AbstractMockDeployment
+{
+
+   private final BeanDeploymentArchive archive;
+
+   public MockDeployment(BeanDeploymentArchive beanDeploymentArchive)
+   {
+      this.archive = beanDeploymentArchive;
+      getBeanDeploymentArchives().add(archive);
+   }
+
+   public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass)
+   {
+      return archive;
+   }
+
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockEELifecycle.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockEELifecycle.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockEELifecycle.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockEELifecycle.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import org.jboss.weld.bootstrap.api.Environment;
+import org.jboss.weld.bootstrap.api.Environments;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.ejb.spi.EjbServices;
+import org.jboss.weld.injection.spi.EjbInjectionServices;
+import org.jboss.weld.injection.spi.JpaInjectionServices;
+import org.jboss.weld.injection.spi.ResourceInjectionServices;
+import org.jboss.weld.security.spi.SecurityServices;
+import org.jboss.weld.transaction.spi.TransactionServices;
+import org.jboss.weld.validation.spi.ValidationServices;
+
+public class MockEELifecycle extends MockServletLifecycle
+{
+   
+   private static final TransactionServices MOCK_TRANSACTION_SERVICES = new MockTransactionServices();
+
+   public MockEELifecycle(BeanDeploymentArchive war)
+   {
+      super(war);
+      getDeployment().getServices().add(TransactionServices.class, MOCK_TRANSACTION_SERVICES);
+      getDeployment().getServices().add(SecurityServices.class, new MockSecurityServices());
+      getDeployment().getServices().add(ValidationServices.class, new MockValidationServices());
+      getDeployment().getServices().add(EjbServices.class, new MockEjBServices());
+      getWar().getServices().add(EjbInjectionServices.class, new MockEjbInjectionServices());
+      getWar().getServices().add(JpaInjectionServices.class, new MockJpaServices(getDeployment()));
+      getWar().getServices().add(ResourceInjectionServices.class, new MockResourceServices());
+   }
+   
+   @Override
+   public Environment getEnvironment()
+   {
+      return Environments.EE_INJECT;
+   }
+   
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockEjBServices.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockEjBServices.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockEjBServices.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockEjBServices.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import org.jboss.weld.ejb.api.SessionObjectReference;
+import org.jboss.weld.ejb.spi.EjbDescriptor;
+import org.jboss.weld.ejb.spi.EjbServices;
+import org.jboss.weld.ejb.spi.InterceptorBindings;
+
+public class MockEjBServices implements EjbServices
+{
+
+
+
+   public SessionObjectReference resolveEjb(EjbDescriptor<?> ejbDescriptor)
+   {
+      return new SessionObjectReference()
+      {
+
+         private static final long serialVersionUID = 1L;
+
+         public <S> S getBusinessObject(Class<S> businessInterfaceType)
+         {
+            // TODO Auto-generated method stub
+            return null;
+         }
+
+         public void remove()
+         {
+            // TODO Auto-generated method stub
+
+         }
+
+         public boolean isRemoved()
+         {
+            // TODO Auto-generated method stub
+            return false;
+         }
+
+      };
+   }
+
+   public void registerInterceptors(EjbDescriptor<?> ejbDescriptor, InterceptorBindings interceptorBindings)
+   {
+      // do nothing
+   }
+
+   public void cleanup() {}
+
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockEjbDescriptor.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockEjbDescriptor.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockEjbDescriptor.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockEjbDescriptor.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,201 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+
+import javax.ejb.Local;
+import javax.ejb.MessageDriven;
+import javax.ejb.Remove;
+import javax.ejb.Singleton;
+import javax.ejb.Stateful;
+import javax.ejb.Stateless;
+
+import org.jboss.weld.ejb.spi.BusinessInterfaceDescriptor;
+import org.jboss.weld.ejb.spi.EjbDescriptor;
+
+public class MockEjbDescriptor<T> implements EjbDescriptor<T>
+{
+   private final Class<T> beanClass;
+   private final String ejbName;
+   private final List<BusinessInterfaceDescriptor<?>> localInterfaces;
+   private final HashSet<Method> removeMethods;
+   
+   public static <T> MockEjbDescriptor<T> of(Class<T> type)
+   {
+      return new MockEjbDescriptor<T>(type);
+   }
+
+   private MockEjbDescriptor(final Class<T> type)
+   {
+      this.beanClass = type;
+      this.ejbName = type.getSimpleName();
+      this.localInterfaces = new ArrayList<BusinessInterfaceDescriptor<?>>();
+      
+      Local localAnnotation = type.getAnnotation(Local.class);
+      if (localAnnotation != null)
+      {
+         for (final Class<?> clazz : localAnnotation.value())
+         {
+            localInterfaces.add(createBusinessInterfaceDescriptor(clazz));
+         }
+      }
+      
+      for (final Class<?> clazz : type.getInterfaces())
+      {
+         if (clazz.isAnnotationPresent(Local.class))
+         {
+            localInterfaces.add(createBusinessInterfaceDescriptor(clazz));
+         }
+      }
+      // cope with EJB 3.1 style no-interface views
+      if (localInterfaces.size() == 0)
+      {
+         localInterfaces.add(createBusinessInterfaceDescriptor(type));
+      }
+      this.removeMethods = new HashSet<Method>();
+      for (final Method method : type.getMethods())
+      {
+         if (method.isAnnotationPresent(Remove.class))
+         {
+            removeMethods.add(method);
+         }
+      }
+   }
+
+   private BusinessInterfaceDescriptor<Object> createBusinessInterfaceDescriptor(final Class<?> clazz)
+   {
+      return new BusinessInterfaceDescriptor<Object>()
+      {
+  
+         @SuppressWarnings("unchecked")
+         public Class<Object> getInterface()
+         {
+            return (Class<Object>) clazz;
+         }
+  
+         public String getJndiName()
+         {
+            return clazz.getSimpleName() + "/local";
+         }
+      
+      };
+   }
+
+   public String getEjbName()
+   {
+      return ejbName;
+   }
+
+   public Collection<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces()
+   {
+      return localInterfaces;
+   }
+   
+   public Iterable<BusinessInterfaceDescriptor<?>> getRemoteBusinessInterfaces()
+   {
+      return Collections.emptyList();
+   }
+
+   public Collection<Method> getRemoveMethods()
+   {
+
+      return removeMethods;
+   }
+
+   public Class<T> getBeanClass()
+   {
+      return beanClass;
+   }
+
+   public boolean isMessageDriven()
+   {
+      return beanClass.isAnnotationPresent(MessageDriven.class);
+   }
+
+   public boolean isSingleton()
+   {
+      return beanClass.isAnnotationPresent(Singleton.class);
+   }
+
+   public boolean isStateful()
+   {
+      return beanClass.isAnnotationPresent(Stateful.class);
+   }
+
+   public boolean isStateless()
+   {
+      return beanClass.isAnnotationPresent(Stateless.class);
+   }
+   
+   public String getLocalJndiName()
+   {
+      return beanClass.getSimpleName() + "/local";
+   }
+   
+   @Override
+   public String toString()
+   {
+      StringBuilder builder = new StringBuilder();
+      builder.append(getEjbName());
+      if (isStateful())
+      {
+         builder.append(" (SFSB)");
+      }
+      if (isStateless())
+      {
+         builder.append(" (SLSB)");
+      }
+      if (isSingleton())
+      {
+         builder.append(" (Singleton)");
+      }
+      if (isMessageDriven())
+      {
+         builder.append(" (MDB)");
+      }
+      builder.append("remove methods; " + removeMethods + "; ");
+      builder.append("; BeanClass: " + getBeanClass() + "; Local Business Interfaces: " + getLocalBusinessInterfaces());
+      return builder.toString(); 
+   }
+   
+//   @Override
+//   public boolean equals(Object other)
+//   {
+//      if (other instanceof EjbDescriptor)
+//      {
+//         EjbDescriptor<T> that = (EjbDescriptor<T>) other;
+//         return this.getBeanClass().equals(that.getBeanClass());
+//      }
+//      else
+//      {
+//         return false;
+//      }
+//   }
+//   
+//   @Override
+//   public int hashCode()
+//   {
+//      return getEjbName().hashCode();
+//   }
+
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockEjbInjectionServices.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockEjbInjectionServices.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockEjbInjectionServices.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockEjbInjectionServices.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import javax.enterprise.inject.spi.InjectionPoint;
+
+import org.jboss.weld.injection.spi.EjbInjectionServices;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockEjbInjectionServices implements EjbInjectionServices
+{
+
+   public Object resolveEjb(InjectionPoint injectionPoint)
+   {
+      return null;
+   }
+   
+   public void cleanup() {}
+
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockHttpSession.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockHttpSession.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockHttpSession.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockHttpSession.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,177 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionContext;
+
+/**
+ * A mock implementation of the HttpSession interface for tests.
+ * 
+ * @author Dan Allen
+ */
+public class MockHttpSession implements HttpSession
+{
+   private String id;
+   
+   private ServletContext servletContext;
+   
+   private Map<String, Object> attributes = new HashMap<String, Object>();
+
+   private boolean invalid = false;
+   
+   private int maxInactiveInterval = 60;
+   
+   private int lastAccessedTime = -1;
+   
+   public MockHttpSession() {}
+   
+   public MockHttpSession(String id)
+   {
+      this.id = id;
+   }
+   
+   public MockHttpSession(String id, ServletContext servletContext)
+   {
+      this(id);
+      this.servletContext = servletContext;
+   }
+
+   public Object getAttribute(String name)
+   {
+      return attributes.get(name);
+   }
+
+   public Enumeration<String> getAttributeNames()
+   {
+      final Iterator<String> nameIterator = attributes.keySet().iterator();
+      return new Enumeration<String>()
+      {
+
+         public boolean hasMoreElements()
+         {
+            return nameIterator.hasNext();
+         }
+
+         public String nextElement()
+         {
+            return nameIterator.next();
+         }
+      };
+   }
+
+   public long getCreationTime()
+   {
+      return 0;
+   }
+
+   public String getId()
+   {
+      return id;
+   }
+
+   public long getLastAccessedTime()
+   {
+      return lastAccessedTime;
+   }
+
+   public int getMaxInactiveInterval()
+   {
+      return maxInactiveInterval;
+   }
+
+   public ServletContext getServletContext()
+   {
+      return servletContext;
+   }
+
+   @SuppressWarnings("deprecation")
+   public HttpSessionContext getSessionContext()
+   {
+      throw new UnsupportedOperationException();
+   }
+
+   public Object getValue(String name)
+   {
+      return getAttribute(name);
+   }
+
+   public String[] getValueNames()
+   {
+      return attributes.keySet().toArray(new String[0]);
+   }
+
+   public void invalidate()
+   {
+      attributes.clear();
+      invalid = true;
+   }
+
+   public boolean isNew()
+   {
+      return false;
+   }
+
+   public void putValue(String name, Object value)
+   {
+      setAttribute(name, value);
+   }
+
+   public void removeAttribute(String name)
+   {
+      attributes.remove(name);
+   }
+
+   public void removeValue(String name)
+   {
+      removeAttribute(name);
+   }
+
+   public void setAttribute(String name, Object value)
+   {
+      if (value == null)
+      {
+         removeAttribute(name);
+      }
+      else
+      {
+         attributes.put(name, value);
+      }
+   }
+
+   public void setMaxInactiveInterval(int seconds)
+   {
+      maxInactiveInterval = seconds;
+   }
+   
+   public boolean isInvalid()
+   {
+      return invalid;
+   }
+   
+   public void access()
+   {
+      lastAccessedTime = (int) System.currentTimeMillis();
+   }
+
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockJpaServices.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockJpaServices.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockJpaServices.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockJpaServices.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.persistence.Entity;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.bootstrap.spi.Deployment;
+import org.jboss.weld.injection.spi.JpaInjectionServices;
+
+public class MockJpaServices implements JpaInjectionServices
+{
+   
+   private final Deployment deployment;
+   
+   public MockJpaServices(Deployment deployment)
+   {
+      this.deployment = deployment;
+   }
+   
+   public EntityManager resolvePersistenceContext(InjectionPoint injectionPoint)
+   {
+      return null;
+   }
+   
+   public EntityManagerFactory resolvePersistenceUnit(InjectionPoint injectionPoint)
+   {
+      return null;
+   }
+   
+   public Collection<Class<?>> discoverEntities()
+   {
+      Set<Class<?>> classes = new HashSet<Class<?>>();
+      for (BeanDeploymentArchive archive : deployment.getBeanDeploymentArchives())
+      {
+         discoverEntities(archive, classes);
+      }
+      return classes;
+   }
+   
+   private void discoverEntities(BeanDeploymentArchive archive, Set<Class<?>> classes)
+   {
+      for (Class<?> clazz : archive.getBeanClasses())
+      {
+         if (clazz.isAnnotationPresent(Entity.class))
+         {
+            classes.add(clazz);
+         }
+      }
+      for (BeanDeploymentArchive child : archive.getBeanDeploymentArchives())
+      {
+         discoverEntities(child, classes);
+      }
+   }
+   
+   public void cleanup() {}
+
+}
\ No newline at end of file

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockLifecycle.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockLifecycle.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockLifecycle.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockLifecycle.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import org.jboss.weld.bootstrap.api.Lifecycle;
+
+public interface MockLifecycle extends Lifecycle
+{
+
+   public abstract void initialize();
+
+   public abstract void beginApplication();
+
+   public abstract void endApplication();
+
+   public abstract void resetContexts();
+
+   public abstract void beginRequest();
+
+   public abstract void endRequest();
+
+   public abstract void beginSession();
+
+   public abstract void endSession();
+
+}
\ No newline at end of file

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockResourceLoader.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockResourceLoader.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockResourceLoader.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockResourceLoader.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Collection;
+
+import org.jboss.weld.resources.spi.ResourceLoader;
+import org.jboss.weld.resources.spi.ResourceLoadingException;
+import org.jboss.weld.util.collections.EnumerationList;
+
+public class MockResourceLoader implements ResourceLoader
+{
+   
+   public Class<?> classForName(String name)
+   {
+      try
+      {
+         return Thread.currentThread().getContextClassLoader().loadClass(name);
+      }
+      catch (ClassNotFoundException e)
+      {
+         throw new ResourceLoadingException(e);
+      }
+   }
+   
+   public URL getResource(String name)
+   {
+      return Thread.currentThread().getContextClassLoader().getResource(name);
+   }
+   
+   public Collection<URL> getResources(String name)
+   {
+      try
+      {
+         return new EnumerationList<URL>(Thread.currentThread().getContextClassLoader().getResources(name));
+      }
+      catch (IOException e)
+      {
+         throw new ResourceLoadingException(e);
+      }
+   }
+   
+   public void cleanup() {}
+   
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockResourceServices.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockResourceServices.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockResourceServices.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockResourceServices.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import javax.enterprise.inject.spi.InjectionPoint;
+
+import org.jboss.weld.injection.spi.ResourceInjectionServices;
+
+/**
+ * @author Pete Muir
+ *
+ */
+public class MockResourceServices implements ResourceInjectionServices
+{
+
+   public Object resolveResource(InjectionPoint injectionPoint)
+   {
+      return null;
+   }
+   
+   public Object resolveResource(String jndiName, String mappedName)
+   {
+      return null;
+   }
+   
+   public void cleanup() {}
+   
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockSecurityServices.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockSecurityServices.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockSecurityServices.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockSecurityServices.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import java.security.Principal;
+
+import org.jboss.weld.security.spi.SecurityServices;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockSecurityServices implements SecurityServices
+{
+
+   public Principal getPrincipal()
+   {
+      return new Principal()
+      {
+         
+         public String getName()
+         {
+            return null;
+         }
+      };
+   }
+   
+   public void cleanup() {}
+
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockServletContext.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockServletContext.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockServletContext.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockServletContext.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,704 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.EventListener;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterRegistration;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.Servlet;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRegistration;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.SessionCookieConfig;
+import javax.servlet.SessionTrackingMode;
+import javax.servlet.FilterRegistration.Dynamic;
+import javax.servlet.descriptor.JspConfigDescriptor;
+
+/**
+ * Mock implementation of the servlet context for testing purposes. This implementation supports all
+ * of the standard context methods except that request dispatching just indicates what is being
+ * dispatched to, rather than doing the actual dispatch.
+ * <p>
+ * The context can be configured with a path parameter that should point to an absolute directory
+ * location that represents the place where the contents of the WAR bundle are located. Setting this
+ * value allows all of the resource location functionality to work as in a fully functioning web
+ * application. This value is not set then not resource location functionality will work and instead
+ * null will always be returned.
+ *
+ * Adapted from Apache Wicket
+ * 
+ * @author Chris Turner (Wicket)
+ */
+public class MockServletContext implements ServletContext
+{
+	private final Map<String, Object> attributes = new HashMap<String, Object>();
+
+	private final Map<String, String> initParameters = new HashMap<String, String>();
+
+	/** Map of mime types */
+	private final Map<String, String> mimeTypes = new HashMap<String, String>();
+
+	private File webappRoot;
+
+	/**
+	 * Create the mock object. As part of the creation, the context sets the root directory where
+	 * web application content is stored. This must be an ABSOLUTE directory relative to where the
+	 * tests are being executed. For example: <code>System.getProperty("user.dir") +
+	 * "/src/webapp"</code>
+	 * 
+	 * @param application
+	 *            The application that this context is for
+	 * @param path
+	 *            The path to the root of the web application
+	 */
+	public MockServletContext(final String path)
+	{
+		webappRoot = null;
+		if (path != null)
+		{
+			webappRoot = new File(path);
+			if (!webappRoot.exists() || !webappRoot.isDirectory())
+			{
+				//log.warn("WARNING: The webapp root directory is invalid: " + path);
+				webappRoot = null;
+			}
+		}
+
+		// assume we're running in maven or an eclipse project created by maven,
+		// so the sessions directory will be created inside the target directory,
+		// and will be cleaned up with a mvn clean
+
+		File file = new File("target/work/");
+		file.mkdirs();
+		attributes.put("javax.servlet.context.tempdir", file);
+
+		mimeTypes.put("html", "text/html");
+		mimeTypes.put("htm", "text/html");
+		mimeTypes.put("css", "text/css");
+		mimeTypes.put("xml", "text/xml");
+		mimeTypes.put("js", "text/plain");
+		mimeTypes.put("gif", "image/gif");
+		mimeTypes.put("jpg", "image/jpeg");
+		mimeTypes.put("png", "image/png");
+	}
+
+	/**
+	 * Add an init parameter.
+	 * 
+	 * @param name
+	 *            The parameter name
+	 * @param value
+	 *            The parameter value
+	 */
+	public void addInitParameter(final String name, final String value)
+	{
+		initParameters.put(name, value);
+	}
+
+	// Configuration methods
+
+	/**
+	 * Add a new recognized mime type.
+	 * 
+	 * @param fileExtension
+	 *            The file extension (e.g. "jpg")
+	 * @param mimeType
+	 *            The mime type (e.g. "image/jpeg")
+	 */
+	public void addMimeType(final String fileExtension, final String mimeType)
+	{
+		mimeTypes.put(fileExtension, mimeType);
+	}
+
+	/**
+	 * Get an attribute with the given name.
+	 * 
+	 * @param name
+	 *            The attribute name
+	 * @return The value, or null
+	 */
+	public Object getAttribute(final String name)
+	{
+		return attributes.get(name);
+	}
+
+	/**
+	 * Get all of the attribute names.
+	 * 
+	 * @return The attribute names
+	 */
+	public Enumeration<String> getAttributeNames()
+	{
+		return Collections.enumeration(attributes.keySet());
+	}
+
+	// ServletContext interface methods
+
+	/**
+	 * Get the context for the given URL path
+	 * 
+	 * @param name
+	 *            The url path
+	 * @return Always returns this
+	 */
+	public ServletContext getContext(String name)
+	{
+		return this;
+	}
+
+	/**
+	 * Get the init parameter with the given name.
+	 * 
+	 * @param name
+	 *            The name
+	 * @return The parameter, or null if no such parameter
+	 */
+	public String getInitParameter(final String name)
+	{
+		return initParameters.get(name);
+	}
+
+	/**
+	 * Get the name of all of the init parameters.
+	 * 
+	 * @return The init parameter names
+	 */
+	public Enumeration<String> getInitParameterNames()
+	{
+		return Collections.enumeration(initParameters.keySet());
+	}
+
+	/**
+	 * @return Always 2
+	 */
+	public int getMajorVersion()
+	{
+		return 2;
+	}
+
+	/**
+	 * Get the mime type for the given file. Uses a hardcoded map of mime types set at
+	 * Initialization time.
+	 * 
+	 * @param name
+	 *            The name to get the mime type for
+	 * @return The mime type
+	 */
+	public String getMimeType(final String name)
+	{
+		int index = name.lastIndexOf('.');
+		if (index == -1 || index == (name.length() - 1))
+		{
+			return null;
+		}
+		else
+		{
+			return mimeTypes.get(name.substring(index + 1));
+		}
+	}
+
+	/**
+	 * @return Always 3
+	 */
+	public int getMinorVersion()
+	{
+		return 3;
+	}
+
+	/**
+	 * Wicket does not use the RequestDispatcher, so this implementation just returns a dummy value.
+	 * 
+	 * @param name
+	 *            The name of the servlet or JSP
+	 * @return The dispatcher
+	 */
+	public RequestDispatcher getNamedDispatcher(final String name)
+	{
+		return getRequestDispatcher(name);
+	}
+
+	/**
+	 * Get the real file path of the given resource name.
+	 * 
+	 * @param name
+	 *            The name
+	 * @return The real path or null
+	 */
+	public String getRealPath(String name)
+	{
+		if (webappRoot == null)
+		{
+			return null;
+		}
+
+		if (name.startsWith("/"))
+		{
+			name = name.substring(1);
+		}
+
+		File f = new File(webappRoot, name);
+		if (!f.exists())
+		{
+			return null;
+		}
+		else
+		{
+			return f.getPath();
+		}
+	}
+
+	/**
+	 * Wicket does not use the RequestDispatcher, so this implementation just returns a dummy value.
+	 * 
+	 * @param name
+	 *            The name of the resource to get the dispatcher for
+	 * @return The dispatcher
+	 */
+	public RequestDispatcher getRequestDispatcher(final String name)
+	{
+		return new RequestDispatcher()
+		{
+			public void forward(ServletRequest servletRequest, ServletResponse servletResponse)
+				throws IOException
+			{
+				servletResponse.getWriter().write("FORWARD TO RESOURCE: " + name);
+			}
+
+			public void include(ServletRequest servletRequest, ServletResponse servletResponse)
+				throws IOException
+			{
+				servletResponse.getWriter().write("INCLUDE OF RESOURCE: " + name);
+			}
+		};
+	}
+
+	/**
+	 * Get the URL for a particular resource that is relative to the web app root directory.
+	 * 
+	 * @param name
+	 *            The name of the resource to get
+	 * @return The resource, or null if resource not found
+	 * @throws MalformedURLException
+	 *             If the URL is invalid
+	 */
+	public URL getResource(String name) throws MalformedURLException
+	{
+		if (webappRoot == null)
+		{
+			return null;
+		}
+
+		if (name.startsWith("/"))
+		{
+			name = name.substring(1);
+		}
+
+		File f = new File(webappRoot, name);
+		if (!f.exists())
+		{
+			return null;
+		}
+		else
+		{
+			return f.toURI().toURL();
+		}
+	}
+
+	/**
+	 * Get an input stream for a particular resource that is relative to the web app root directory.
+	 * 
+	 * @param name
+	 *            The name of the resource to get
+	 * @return The input stream for the resource, or null of resource is not found
+	 */
+	public InputStream getResourceAsStream(String name)
+	{
+		if (webappRoot == null)
+		{
+			return null;
+		}
+
+		if (name.startsWith("/"))
+		{
+			name = name.substring(1);
+		}
+
+		File f = new File(webappRoot, name);
+		if (!f.exists())
+		{
+			return null;
+		}
+		else
+		{
+			try
+			{
+				return new FileInputStream(f);
+			}
+			catch (FileNotFoundException e)
+			{
+				e.printStackTrace();
+				return null;
+			}
+		}
+	}
+
+	/**
+	 * Get the resource paths starting from the web app root directory and then relative to the the
+	 * given name.
+	 * 
+	 * @param name
+	 *            The starting name
+	 * @return The set of resource paths at this location
+	 */
+	public Set<String> getResourcePaths(String name)
+	{
+		if (webappRoot == null)
+		{
+			return new HashSet<String>();
+		}
+
+		if (name.startsWith("/"))
+		{
+			name = name.substring(1);
+		}
+		if (name.endsWith("/"))
+		{
+			name = name.substring(0, name.length() - 1);
+		}
+		String[] elements = null;
+		if (name.trim().length() == 0)
+		{
+			elements = new String[0];
+		}
+		else
+		{
+			elements = name.split("/");
+		}
+
+		File current = webappRoot;
+		for (int i = 0; i < elements.length; i++)
+		{
+			File[] files = current.listFiles();
+			boolean match = false;
+			for (int f = 0; f < files.length; f++)
+			{
+				if (files[f].getName().equals(elements[i]) && files[f].isDirectory())
+				{
+					current = files[f];
+					match = true;
+					break;
+				}
+			}
+			if (!match)
+			{
+				return null;
+			}
+		}
+
+		File[] files = current.listFiles();
+		Set<String> result = new HashSet<String>();
+		int stripLength = webappRoot.getPath().length();
+		for (int f = 0; f < files.length; f++)
+		{
+			String s = files[f].getPath().substring(stripLength).replace('\\', '/');
+			if (files[f].isDirectory())
+			{
+				s = s + "/";
+			}
+			result.add(s);
+		}
+		return result;
+	}
+
+	/**
+	 * Get the server info.
+	 * 
+	 * @return The server info
+	 */
+	public String getServerInfo()
+	{
+		return "Wicket Mock Test Environment v1.0";
+	}
+
+	/**
+	 * NOT USED - Servlet Spec requires that this always returns null.
+	 * 
+	 * @param name
+	 *            Not used
+	 * @return null
+	 * @throws ServletException
+	 *             Not used
+	 */
+	public Servlet getServlet(String name) throws ServletException
+	{
+		return null;
+	}
+
+	/**
+	 * Return the name of the servlet context.
+	 * 
+	 * @return The name
+	 */
+	public String getServletContextName()
+	{
+		return "Mock";
+	}
+
+	/**
+	 * NOT USED - Servlet spec requires that this always returns null.
+	 * 
+	 * @return null
+	 */
+	public Enumeration<String> getServletNames()
+	{
+		return null;
+	}
+
+	/**
+	 * NOT USED - Servlet spec requires that this always returns null.
+	 * 
+	 * @return null
+	 */
+	public Enumeration<Servlet> getServlets()
+	{
+		return null;
+	}
+
+	/**
+	 * As part of testing we always log to the console.
+	 * 
+	 * @param e
+	 *            The exception to log
+	 * @param msg
+	 *            The message to log
+	 */
+	public void log(Exception e, String msg)
+	{
+		//log.error(msg, e);
+	}
+
+	/**
+	 * As part of testing we always log to the console.
+	 * 
+	 * @param msg
+	 *            The message to log
+	 */
+	public void log(String msg)
+	{
+		//log.info(msg);
+	}
+
+	/**
+	 * As part of testing we always log to the console.
+	 * 
+	 * @param msg
+	 *            The message to log
+	 * @param cause
+	 *            The cause exception
+	 */
+	public void log(String msg, Throwable cause)
+	{
+		//log.error(msg, cause);
+	}
+
+	/**
+	 * Remove an attribute with the given name.
+	 * 
+	 * @param name
+	 *            The name
+	 */
+	public void removeAttribute(final String name)
+	{
+		attributes.remove(name);
+	}
+
+	/**
+	 * Set an attribute.
+	 * 
+	 * @param name
+	 *            The name of the attribute
+	 * @param o
+	 *            The value
+	 */
+	public void setAttribute(final String name, final Object o)
+	{
+		attributes.put(name, o);
+	}
+
+	/**
+	 * @return context path
+	 */
+	public String getContextPath()
+	{
+		return "";
+	}
+
+	public Dynamic addFilter(String arg0, String arg1) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public Dynamic addFilter(String arg0, Filter arg1) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public Dynamic addFilter(String arg0, Class<? extends Filter> arg1) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public void addListener(String arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public <T extends EventListener> void addListener(T arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void addListener(Class<? extends EventListener> arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public javax.servlet.ServletRegistration.Dynamic addServlet(String arg0,
+			String arg1) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public javax.servlet.ServletRegistration.Dynamic addServlet(String arg0,
+			Servlet arg1) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public javax.servlet.ServletRegistration.Dynamic addServlet(String arg0,
+			Class<? extends Servlet> arg1) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public <T extends Filter> T createFilter(Class<T> arg0)
+			throws ServletException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public <T extends EventListener> T createListener(Class<T> arg0)
+			throws ServletException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public <T extends Servlet> T createServlet(Class<T> arg0)
+			throws ServletException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public void declareRoles(String... arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public ClassLoader getClassLoader() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public Set<SessionTrackingMode> getDefaultSessionTrackingModes() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public int getEffectiveMajorVersion() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	public int getEffectiveMinorVersion() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	public Set<SessionTrackingMode> getEffectiveSessionTrackingModes() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public FilterRegistration getFilterRegistration(String arg0) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public Map<String, ? extends FilterRegistration> getFilterRegistrations() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public JspConfigDescriptor getJspConfigDescriptor() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public ServletRegistration getServletRegistration(String arg0) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public Map<String, ? extends ServletRegistration> getServletRegistrations() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public SessionCookieConfig getSessionCookieConfig() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public boolean setInitParameter(String arg0, String arg1) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public void setSessionTrackingModes(Set<SessionTrackingMode> arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+	
+	
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockServletLifecycle.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockServletLifecycle.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockServletLifecycle.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockServletLifecycle.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,179 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import org.jboss.weld.bootstrap.WeldBootstrap;
+import org.jboss.weld.bootstrap.api.Environment;
+import org.jboss.weld.bootstrap.api.Environments;
+import org.jboss.weld.bootstrap.api.Lifecycle;
+import org.jboss.weld.bootstrap.api.helpers.ForwardingLifecycle;
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.bootstrap.spi.Deployment;
+import org.jboss.weld.context.ContextLifecycle;
+import org.jboss.weld.context.api.BeanStore;
+import org.jboss.weld.context.api.helpers.ConcurrentHashMapBeanStore;
+import org.jboss.weld.resources.spi.ResourceLoader;
+import org.jboss.weld.servlet.api.ServletServices;
+
+public class MockServletLifecycle extends ForwardingLifecycle implements MockLifecycle
+{
+   private static final ResourceLoader MOCK_RESOURCE_LOADER = new MockResourceLoader();
+   
+   private final WeldBootstrap bootstrap;
+   private final Deployment deployment;
+   private final BeanDeploymentArchive war;
+   private final BeanStore applicationBeanStore;
+   private final BeanStore sessionBeanStore;
+   private final BeanStore requestBeanStore;
+   
+   private Lifecycle lifecycle;
+   
+   public MockServletLifecycle(BeanDeploymentArchive war)
+   {
+      this(new MockDeployment(war), war);
+   }
+   
+   public MockServletLifecycle(Deployment deployment, BeanDeploymentArchive war)
+   {
+      this.deployment = deployment;
+      this.war = war;
+      if (deployment == null)
+      {
+         throw new IllegalStateException("No WebBeanDiscovery is available");
+      }
+      this.bootstrap = new WeldBootstrap();
+      this.deployment.getServices().add(ResourceLoader.class, MOCK_RESOURCE_LOADER);
+      this.deployment.getServices().add(ServletServices.class, new MockServletServices(war));
+      this.applicationBeanStore = new ConcurrentHashMapBeanStore();
+      this.sessionBeanStore = new ConcurrentHashMapBeanStore();
+      this.requestBeanStore = new ConcurrentHashMapBeanStore();
+   }
+   
+   protected BeanStore getSessionBeanStore()
+   {
+      return sessionBeanStore;
+   }
+   
+   protected BeanStore getRequestBeanStore()
+   {
+      return requestBeanStore;
+   }
+   
+   protected BeanStore getApplicationBeanStore()
+   {
+      return applicationBeanStore;
+   }
+   
+   /* (non-Javadoc)
+    * @see org.jboss.weld.mock.MockLifecycle#initialize()
+    */
+   public void initialize()
+   {
+      try
+      {
+         bootstrap.startContainer(getEnvironment(), getDeployment(), getApplicationBeanStore());
+      }
+      finally  
+      {
+         lifecycle = deployment.getServices().get(ContextLifecycle.class);
+      }
+   }
+   
+   @Override
+   protected Lifecycle delegate()
+   {
+      return lifecycle;
+   }
+   
+   protected Deployment getDeployment()
+   {
+      return deployment;
+   }
+   
+   public WeldBootstrap getBootstrap()
+   {
+      return bootstrap;
+   }
+   
+   /* (non-Javadoc)
+    * @see org.jboss.weld.mock.MockLifecycle#beginApplication()
+    */
+   public void beginApplication()
+   {
+      bootstrap.startInitialization().deployBeans().validateBeans().endInitialization();
+   }
+   
+   /* (non-Javadoc)
+    * @see org.jboss.weld.mock.MockLifecycle#endApplication()
+    */
+   @Override
+   public void endApplication()
+   {
+      bootstrap.shutdown();
+   }
+   
+   /* (non-Javadoc)
+    * @see org.jboss.weld.mock.MockLifecycle#resetContexts()
+    */
+   public void resetContexts()
+   {
+      
+   }
+   
+   /* (non-Javadoc)
+    * @see org.jboss.weld.mock.MockLifecycle#beginRequest()
+    */
+   public void beginRequest()
+   {
+      super.beginRequest("Mock", getRequestBeanStore());
+   }
+   
+   /* (non-Javadoc)
+    * @see org.jboss.weld.mock.MockLifecycle#endRequest()
+    */
+   public void endRequest()
+   {
+      super.endRequest("Mock", getRequestBeanStore());
+   }
+   
+   /* (non-Javadoc)
+    * @see org.jboss.weld.mock.MockLifecycle#beginSession()
+    */
+   public void beginSession()
+   {
+      super.restoreSession("Mock", getSessionBeanStore());
+   }
+   
+   /* (non-Javadoc)
+    * @see org.jboss.weld.mock.MockLifecycle#endSession()
+    */
+   public void endSession()
+   {
+      // TODO Conversation handling breaks this :-(
+      //super.endSession("Mock", sessionBeanStore);
+   }
+   
+   protected Environment getEnvironment()
+   {
+      return Environments.SERVLET;
+   }
+   
+   public BeanDeploymentArchive getWar()
+   {
+      return war;
+   }
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockServletServices.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockServletServices.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockServletServices.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockServletServices.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.servlet.api.ServletServices;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockServletServices implements ServletServices
+{
+
+   private final BeanDeploymentArchive beanDeploymentArchive;
+   
+   public MockServletServices(BeanDeploymentArchive beanDeploymentArchive)
+   {
+      this.beanDeploymentArchive = beanDeploymentArchive;
+   }
+
+   public BeanDeploymentArchive getBeanDeploymentArchive(ServletContext ctx)
+   {
+      if (ctx instanceof MockServletContext)
+      {
+         return beanDeploymentArchive;
+      }
+      else
+      {
+         return null;
+      }
+   }
+   
+   public void cleanup() {}
+
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockTransactionServices.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockTransactionServices.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockTransactionServices.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockTransactionServices.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,89 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.RollbackException;
+import javax.transaction.Synchronization;
+import javax.transaction.SystemException;
+import javax.transaction.UserTransaction;
+
+import org.jboss.weld.transaction.spi.TransactionServices;
+
+/**
+ * A mock version of TransactionServices for RI unit tests.  Since
+ * no JTA transaction can be active for these unit tests, all
+ * methods here are empty.
+ * 
+ * @author David Allen
+ *
+ */
+public class MockTransactionServices implements TransactionServices
+{
+
+   public boolean isTransactionActive()
+   {
+      return false;
+   }
+
+   public void registerSynchronization(Synchronization synchronizedObserver)
+   {
+   }
+   
+   public UserTransaction getUserTransaction()
+   {
+      return new UserTransaction()
+      {
+         
+         public void setTransactionTimeout(int arg0) throws SystemException
+         {
+            
+         }
+         
+         public void setRollbackOnly() throws IllegalStateException, SystemException
+         {
+            
+         }
+         
+         public void rollback() throws IllegalStateException, SecurityException, SystemException
+         {
+           
+         }
+         
+         public int getStatus() throws SystemException
+         {
+            return 0;
+         }
+         
+         public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
+         {
+            
+         }
+         
+         public void begin() throws NotSupportedException, SystemException
+         {
+            
+         }
+      };
+   }
+   
+   public void cleanup() {}
+
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockValidationServices.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockValidationServices.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockValidationServices.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockValidationServices.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import javax.validation.ConstraintValidatorFactory;
+import javax.validation.MessageInterpolator;
+import javax.validation.TraversableResolver;
+import javax.validation.ValidationException;
+import javax.validation.Validator;
+import javax.validation.ValidatorContext;
+import javax.validation.ValidatorFactory;
+
+import org.jboss.weld.validation.spi.ValidationServices;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockValidationServices implements ValidationServices
+{
+
+   public ValidatorFactory getDefaultValidatorFactory()
+   {
+      return new ValidatorFactory()
+      {
+         
+         public ValidatorContext usingContext()
+         {
+            // TODO Auto-generated method stub
+            return null;
+         }
+         
+         public <T> T unwrap(Class<T> type)
+         {
+            if (type.equals(ValidatorFactory.class))
+            {
+               return type.cast(this);
+            }
+            else
+            {
+               throw new ValidationException();
+            }
+         }
+         
+         public Validator getValidator()
+         {
+            return new MockValidator();
+         }
+         
+         public TraversableResolver getTraversableResolver()
+         {
+            // TODO Auto-generated method stub
+            return null;
+         }
+         
+         public MessageInterpolator getMessageInterpolator()
+         {
+            // TODO Auto-generated method stub
+            return null;
+         }
+         
+         public ConstraintValidatorFactory getConstraintValidatorFactory()
+         {
+            // TODO Auto-generated method stub
+            return null;
+         }
+      };
+   }
+   
+   public void cleanup() {}
+
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockValidator.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/MockValidator.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockValidator.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/MockValidator.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import java.util.Set;
+
+import javax.validation.ConstraintViolation;
+import javax.validation.ValidationException;
+import javax.validation.Validator;
+import javax.validation.metadata.BeanDescriptor;
+
+public class MockValidator implements Validator
+{
+
+   public BeanDescriptor getConstraintsForClass(Class<?> clazz)
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+   public <T> T unwrap(Class<T> type)
+   {
+      if (type.equals(Validator.class))
+      {
+         return type.cast(this);
+      }
+      else
+      {
+         throw new ValidationException();
+      }
+   }
+
+   public <T> Set<ConstraintViolation<T>> validate(T object, Class<?>... groups)
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+   public <T> Set<ConstraintViolation<T>> validateProperty(T object, String propertyName, Class<?>... groups)
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+   public <T> Set<ConstraintViolation<T>> validateValue(Class<T> beanType, String propertyName, Object value, Class<?>... groups)
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/TestContainer.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/TestContainer.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/TestContainer.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/TestContainer.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,144 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock;
+
+import org.jboss.weld.bootstrap.spi.Deployment;
+import org.jboss.weld.context.ConversationContext;
+import org.jboss.weld.manager.BeanManagerImpl;
+
+/**
+ * Control of the container, used for tests. Wraps up common operations.
+ * 
+ * If you require more control over the container bootstrap lifecycle you should
+ * use the {@link #getLifecycle()} method. For example:
+ * 
+ * <code>TestContainer container = new TestContainer(...);
+ * container.getLifecycle().initialize();
+ * container.getLifecycle().getBootstrap().startInitialization();
+ * container.getLifecycle().getBootstrap().deployBeans();
+ * container.getLifecycle().getBootstrap().validateBeans();
+ * container.getLifecycle().getBootstrap().endInitialization();
+ * container.getLifecycle().stopContainer();</code>
+ * 
+ * Note that we can easily mix fine-grained calls to bootstrap, and coarse grained calls to {@link TestContainer}.
+ * 
+ * @author pmuir
+ *
+ */
+public class TestContainer
+{
+   
+   private final MockServletLifecycle lifecycle;
+   
+   /**
+    * Create a container, specifying the classes and beans.xml to deploy
+    * 
+    * @param lifecycle
+    * @param classes
+    * @param beansXml
+    */
+//   public TestContainer(MockServletLifecycle lifecycle, Collection<Class<?>> classes, Collection<URL> beansXml)
+//   {
+//      this(lifecycle);
+//      configureArchive(classes, beansXml);
+//   }
+   
+   public TestContainer(MockServletLifecycle lifecycle)
+   {
+      this.lifecycle = lifecycle;
+   }
+   
+//   public TestContainer(MockServletLifecycle lifecycle, Class<?>[] classes, URL[] beansXml)
+//   {
+//      this(lifecycle, classes == null ? null : Arrays.asList(classes), beansXml == null ? null : Arrays.asList(beansXml));
+//   }
+//   
+//   public TestContainer(MockServletLifecycle lifecycle, Class<?>... classes)
+//   {
+//      this(lifecycle, classes == null ? null : Arrays.asList(classes), null);
+//   }
+   
+   /**
+    * Starts the container and begins the application
+    */
+   public TestContainer startContainer()
+   {
+      getLifecycle().initialize();
+      getLifecycle().beginApplication();
+      return this;
+   }
+   
+   /**
+    * Configure's the archive with the classes and beans.xml
+    */
+//   protected TestContainer configureArchive(Collection<Class<?>> classes, Collection<URL> beansXml)
+//   {
+//      BeanDeploymentArchive archive = lifecycle.getWar();
+//      archive.setBeanClasses(classes);
+//      if (beansXml != null)
+//      {
+//         archive.setBeansXmlFiles(beansXml);
+//      }
+//      return this;
+//   }
+   
+   /**
+    * Get the context lifecycle, allowing fine control over the contexts' state
+    * 
+    * @return
+    */
+   public MockServletLifecycle getLifecycle()
+   {
+      return lifecycle;
+   }
+   
+   public BeanManagerImpl getBeanManager()
+   {
+      return getLifecycle().getBootstrap().getManager(getLifecycle().getWar());
+   }
+   
+   public Deployment getDeployment()
+   {
+      return getLifecycle().getDeployment();
+   }
+   
+   /**
+    * Clean up the container, ending any active contexts
+    * 
+    */
+   public TestContainer stopContainer()
+   {
+      if (getLifecycle().isRequestActive())
+      {
+         getLifecycle().endRequest();
+      }
+      if (getLifecycle().isConversationActive())
+      {
+         ((ConversationContext) getLifecycle().getConversationContext()).setActive(false);
+      }
+      if (getLifecycle().isSessionActive())
+      {
+         getLifecycle().endSession();
+      }
+      if (getLifecycle().isApplicationActive())
+      {
+         getLifecycle().endApplication();
+      }
+      return this;
+   }
+
+}
\ No newline at end of file

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/el (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/el)

Modified: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/el/EL.java
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/mock/el/EL.java	2010-06-30 13:33:39 UTC (rev 4635)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/mock/el/EL.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.arquillian.weldee.mock.el;
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.el;
 
 import javax.el.ArrayELResolver;
 import javax.el.BeanELResolver;

Copied: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/shrinkwrap (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/shrinkwrap)

Modified: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/shrinkwrap/ShrinkWrapClassLoader.java
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/shrinkwrap/ShrinkWrapClassLoader.java	2010-06-30 13:33:39 UTC (rev 4635)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/shrinkwrap/ShrinkWrapClassLoader.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.arquillian.weldee.shrinkwrap;
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.shrinkwrap;
 
 import java.io.IOException;
 import java.io.InputStream;

Modified: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/shrinkwrap/ShrinkwrapBeanDeploymentArchive.java
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/shrinkwrap/ShrinkwrapBeanDeploymentArchive.java	2010-06-30 13:33:39 UTC (rev 4635)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/shrinkwrap/ShrinkwrapBeanDeploymentArchive.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.arquillian.weldee.shrinkwrap;
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.shrinkwrap;
 
 import org.jboss.shrinkwrap.api.Assignable;
 import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;

Modified: arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/shrinkwrap/ShrinkwrapBeanDeploymentArchiveImpl.java
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/weldee/shrinkwrap/ShrinkwrapBeanDeploymentArchiveImpl.java	2010-06-30 13:33:39 UTC (rev 4635)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/shrinkwrap/ShrinkwrapBeanDeploymentArchiveImpl.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.arquillian.weldee.shrinkwrap;
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.shrinkwrap;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -36,7 +36,7 @@
 import javax.ejb.Stateful;
 import javax.ejb.Stateless;
 
-import org.jboss.arquillian.weldee.mock.MockEjbDescriptor;
+import org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.MockEjbDescriptor;
 import org.jboss.shrinkwrap.api.Archive;
 import org.jboss.shrinkwrap.api.ArchivePath;
 import org.jboss.shrinkwrap.api.Asset;

Modified: arquillian/trunk/containers/weld-ee-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration	2010-06-30 13:33:39 UTC (rev 4635)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.ContainerConfiguration	2010-06-30 13:50:24 UTC (rev 4636)
@@ -1 +1 @@
-org.jboss.arquillian.weldee.WeldEEMockConfiguration
\ No newline at end of file
+org.jboss.arquillian.container.weld.ee.embedded_1_1.WeldEEMockConfiguration
\ No newline at end of file

Modified: arquillian/trunk/containers/weld-ee-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer	2010-06-30 13:33:39 UTC (rev 4635)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.DeployableContainer	2010-06-30 13:50:24 UTC (rev 4636)
@@ -1 +1 @@
-org.jboss.arquillian.weldee.WeldEEMockContainer
\ No newline at end of file
+org.jboss.arquillian.container.weld.ee.embedded_1_1.WeldEEMockContainer
\ No newline at end of file

Modified: arquillian/trunk/containers/weld-ee-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher	2010-06-30 13:33:39 UTC (rev 4635)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.spi.TestEnricher	2010-06-30 13:50:24 UTC (rev 4636)
@@ -1 +1 @@
-org.jboss.arquillian.weldee.WeldEETestEnricher
\ No newline at end of file
+org.jboss.arquillian.container.weld.ee.embedded_1_1.WeldEETestEnricher
\ No newline at end of file

Modified: arquillian/trunk/containers/weld-ee-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.weldee.shrinkwrap.ShrinkwrapBeanDeploymentArchive
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.weldee.shrinkwrap.ShrinkwrapBeanDeploymentArchive	2010-06-30 13:33:39 UTC (rev 4635)
+++ arquillian/trunk/containers/weld-ee-embedded/src/main/resources/META-INF/services/org.jboss.arquillian.weldee.shrinkwrap.ShrinkwrapBeanDeploymentArchive	2010-06-30 13:50:24 UTC (rev 4636)
@@ -1 +1 @@
-org.jboss.arquillian.weldee.shrinkwrap.ShrinkwrapBeanDeploymentArchiveImpl
\ No newline at end of file
+org.jboss.arquillian.container.weld.ee.embedded_1_1.shrinkwrap.ShrinkwrapBeanDeploymentArchiveImpl
\ No newline at end of file

Copied: arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEmbeddedIntegrationEARTestCase.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/weldee/WeldEmbeddedIntegrationEARTestCase.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEmbeddedIntegrationEARTestCase.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEmbeddedIntegrationEARTestCase.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1;
+
+import javax.inject.Inject;
+
+import junit.framework.Assert;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.container.weld.ee.embedded_1_1.beans.MyBean;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * WeldEmbeddedIntegrationTestCase
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+ at RunWith(Arquillian.class)
+public class WeldEmbeddedIntegrationEARTestCase
+{
+   @Deployment
+   public static EnterpriseArchive createdeployment() 
+   {
+      return ShrinkWrap.create("test.ear", EnterpriseArchive.class)
+                  .addModule(
+                        ShrinkWrap.create("test.war", WebArchive.class)
+                           .addClasses(
+                              WeldEmbeddedIntegrationWARTestCase.class,
+                              MyBean.class)
+                           .addWebResource(
+                              new ByteArrayAsset("<beans/>".getBytes()), ArchivePaths.create("beans.xml"))
+                  );
+   }
+   
+   @Inject
+   private MyBean instanceVariable;
+   
+   @Test
+   public void shouldBeAbleToInjectBeanAsInstanceVariable() throws Exception 
+   {
+      Assert.assertNotNull(
+            "Verify that the Bean has been injected",
+            instanceVariable);
+      
+      Assert.assertEquals("aslak", instanceVariable.getName());
+   }
+
+   @Test
+   public void shouldBeAbleToInjectBeanAsArgumentVariable(MyBean argumentVariable) throws Exception 
+   {
+      Assert.assertNotNull(
+            "Verify that the Bean has been injected",
+            argumentVariable);
+      
+      Assert.assertEquals("aslak", argumentVariable.getName());
+   }
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEmbeddedIntegrationJARTestCase.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/weldee/WeldEmbeddedIntegrationJARTestCase.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEmbeddedIntegrationJARTestCase.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEmbeddedIntegrationJARTestCase.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1;
+
+import javax.inject.Inject;
+
+import junit.framework.Assert;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.container.weld.ee.embedded_1_1.beans.MyBean;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * WeldEmbeddedIntegrationTestCase
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+ at RunWith(Arquillian.class)
+public class WeldEmbeddedIntegrationJARTestCase
+{
+   @Deployment
+   public static JavaArchive createdeployment() 
+   {
+      return ShrinkWrap.create("test.jar", JavaArchive.class)
+                  .addClasses(
+                        WeldEmbeddedIntegrationJARTestCase.class,
+                        MyBean.class)
+                  .addManifestResource(
+                        new ByteArrayAsset("<beans/>".getBytes()), ArchivePaths.create("beans.xml"));
+   }
+   
+   @Inject
+   private MyBean instanceVariable;
+   
+   @Test
+   public void shouldBeAbleToInjectBeanAsInstanceVariable() throws Exception 
+   {
+      Assert.assertNotNull(
+            "Verify that the Bean has been injected",
+            instanceVariable);
+      
+      Assert.assertEquals("aslak", instanceVariable.getName());
+   }
+
+   @Test
+   public void shouldBeAbleToInjectBeanAsArgumentVariable(MyBean argumentVariable) throws Exception 
+   {
+      Assert.assertNotNull(
+            "Verify that the Bean has been injected",
+            argumentVariable);
+      
+      Assert.assertEquals("aslak", argumentVariable.getName());
+   }
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEmbeddedIntegrationWARTestCase.java (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/weldee/WeldEmbeddedIntegrationWARTestCase.java)
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEmbeddedIntegrationWARTestCase.java	                        (rev 0)
+++ arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/WeldEmbeddedIntegrationWARTestCase.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.arquillian.container.weld.ee.embedded_1_1;
+
+import javax.inject.Inject;
+
+import junit.framework.Assert;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.container.weld.ee.embedded_1_1.beans.MyBean;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * WeldEmbeddedIntegrationTestCase
+ *
+ * @author <a href="mailto:aslak at redhat.com">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+ at RunWith(Arquillian.class)
+public class WeldEmbeddedIntegrationWARTestCase
+{
+   @Deployment
+   public static WebArchive createdeployment() 
+   {
+      return ShrinkWrap.create("test.war", WebArchive.class)
+                  .addClasses(
+                        WeldEmbeddedIntegrationWARTestCase.class,
+                        MyBean.class)
+                  .addWebResource(
+                        new ByteArrayAsset("<beans/>".getBytes()), ArchivePaths.create("beans.xml"));
+   }
+   
+   @Inject
+   private MyBean instanceVariable;
+   
+   @Test
+   public void shouldBeAbleToInjectBeanAsInstanceVariable() throws Exception 
+   {
+      Assert.assertNotNull(
+            "Verify that the Bean has been injected",
+            instanceVariable);
+      
+      Assert.assertEquals("aslak", instanceVariable.getName());
+   }
+
+   @Test
+   public void shouldBeAbleToInjectBeanAsArgumentVariable(MyBean argumentVariable) throws Exception 
+   {
+      Assert.assertNotNull(
+            "Verify that the Bean has been injected",
+            argumentVariable);
+      
+      Assert.assertEquals("aslak", argumentVariable.getName());
+   }
+}

Copied: arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/beans (from rev 4635, arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/weldee/beans)

Modified: arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/beans/MyBean.java
===================================================================
--- arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/weldee/beans/MyBean.java	2010-06-30 13:33:39 UTC (rev 4635)
+++ arquillian/trunk/containers/weld-ee-embedded/src/test/java/org/jboss/arquillian/container/weld/ee/embedded_1_1/beans/MyBean.java	2010-06-30 13:50:24 UTC (rev 4636)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.arquillian.weldee.beans;
+package org.jboss.arquillian.container.weld.ee.embedded_1_1.beans;
 
 import java.io.Serializable;
 



More information about the jboss-svn-commits mailing list