[webbeans-commits] Webbeans SVN: r2406 - in ri/trunk: porting-package and 5 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Tue Apr 14 18:40:06 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-04-14 18:40:05 -0400 (Tue, 14 Apr 2009)
New Revision: 2406

Added:
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockConversationManager.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockJmsServices.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockNamingContext.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockResourceLoader.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockResourceServices.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockWebBeanDiscovery.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockWebServices.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockXmlEnvironment.java
   ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/el/
Removed:
   ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockConversationManager.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJmsServices.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockNamingContext.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockResourceLoader.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockResourceServices.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockWebBeanDiscovery.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockWebServices.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockXmlEnvironment.java
   ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/el/
   ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java
Modified:
   ri/trunk/porting-package/pom.xml
   ri/trunk/porting-package/src/main/resources/META-INF/jboss-test-harness.properties
   ri/trunk/tests/pom.xml
Log:
WBRI-233

Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockConversationManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockConversationManager.java	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockConversationManager.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,31 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.webbeans.mock;
-
-import org.jboss.webbeans.conversation.ServletConversationManager;
-
-/**
- * Mock of a conversation manager without servlet dependencies
- * 
- * @author Nicklas Karlsson
- *
- */
-// TODO dummy
-public class MockConversationManager extends ServletConversationManager
-{
-
-}

Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.webbeans.mock;
-
-import org.jboss.webbeans.bootstrap.api.Environments;
-import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.messaging.spi.JmsServices;
-import org.jboss.webbeans.persistence.spi.JpaServices;
-import org.jboss.webbeans.resources.spi.ResourceServices;
-import org.jboss.webbeans.transaction.spi.TransactionServices;
-import org.jboss.webbeans.ws.spi.WebServices;
-
-public class MockEELifecycle extends MockServletLifecycle
-{
-   
-   private static final TransactionServices MOCK_TRANSACTION_SERVICES = new MockTransactionServices();
-
-   public MockEELifecycle()
-   {
-      super();
-      getBootstrap().getServices().add(TransactionServices.class, MOCK_TRANSACTION_SERVICES);
-      getBootstrap().getServices().add(EjbServices.class, new MockEjBServices(getWebBeanDiscovery()));
-      getBootstrap().getServices().add(JpaServices.class, new MockJpaServices(getWebBeanDiscovery()));
-      getBootstrap().getServices().add(ResourceServices.class, new MockResourceServices());
-      getBootstrap().getServices().add(WebServices.class, new MockWebServices());
-      getBootstrap().getServices().add(JmsServices.class, new MockJmsServices());
-      getBootstrap().setEnvironment(Environments.EE);
-   }
-   
-  
-   
-}

Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,71 +0,0 @@
-/**
- * 
- */
-package org.jboss.webbeans.mock;
-
-import java.lang.reflect.Field;
-import java.util.Collection;
-
-import javax.inject.manager.InjectionPoint;
-
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-import org.jboss.webbeans.ejb.api.SessionObjectReference;
-import org.jboss.webbeans.ejb.spi.EjbDescriptor;
-import org.jboss.webbeans.ejb.spi.EjbServices;
-
-public class MockEjBServices implements EjbServices
-{
-   
-   private final MockEjbDiscovery ejbDiscovery;
-   
-   public MockEjBServices(WebBeanDiscovery webBeanDiscovery)
-   {
-      this.ejbDiscovery = new MockEjbDiscovery(webBeanDiscovery);
-   }
-   
-   public Object resolveEjb(InjectionPoint injectionPoint)
-   {
-      return null;
-   }
-   
-   public void removeEjb(Collection<Object> instance)
-   {
-      // No-op
-   }
-   
-   public Object resolveRemoteEjb(String jndiName, String mappedName, String ejbLink)
-   {
-      return null;
-   }
-   
-   public Iterable<EjbDescriptor<?>> discoverEjbs()
-   {
-      return ejbDiscovery.discoverEjbs();
-   }
-
-   public SessionObjectReference resolveEjb(EjbDescriptor<?> ejbDescriptor)
-   {
-      return new SessionObjectReference()
-      {
-
-         public <S> S getBusinessObject(Class<S> businessInterfaceType)
-         {
-            // TODO Auto-generated method stub
-            return null;
-         }
-
-         public void remove()
-         {
-            // TODO Auto-generated method stub
-            
-         }
-         
-         public Object getFieldValue(Field field)
-         {
-            // TODO Auto-generated method stub
-            return null;
-         }
-         
-      };
-   }
-}
\ No newline at end of file

Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,200 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.webbeans.mock;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-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.webbeans.ejb.spi.BusinessInterfaceDescriptor;
-import org.jboss.webbeans.ejb.spi.EjbDescriptor;
-
-public class MockEjbDescriptor<T> implements EjbDescriptor<T>
-{
-   private final Class<T> type;
-   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.type = 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 Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces()
-   {
-      return localInterfaces;
-   }
-   
-   public Iterable<BusinessInterfaceDescriptor<?>> getRemoteBusinessInterfaces()
-   {
-      return Collections.emptyList();
-   }
-
-   public Iterable<Method> getRemoveMethods()
-   {
-
-      return removeMethods;
-   }
-
-   public Class<T> getType()
-   {
-      return type;
-   }
-
-   public boolean isMessageDriven()
-   {
-      return type.isAnnotationPresent(MessageDriven.class);
-   }
-
-   public boolean isSingleton()
-   {
-      return type.isAnnotationPresent(Singleton.class);
-   }
-
-   public boolean isStateful()
-   {
-      return type.isAnnotationPresent(Stateful.class);
-   }
-
-   public boolean isStateless()
-   {
-      return type.isAnnotationPresent(Stateless.class);
-   }
-   
-   public String getLocalJndiName()
-   {
-      return type.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: " + getType() + "; 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.getEjbName().equals(that.getEjbName());
-      }
-      else
-      {
-         return false;
-      }
-   }
-   
-   @Override
-   public int hashCode()
-   {
-      return getEjbName().hashCode();
-   }
-
-}

Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.webbeans.mock;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.ejb.MessageDriven;
-import javax.ejb.Singleton;
-import javax.ejb.Stateful;
-import javax.ejb.Stateless;
-
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-import org.jboss.webbeans.ejb.spi.EjbDescriptor;
-
-public class MockEjbDiscovery
-{
-   
-   private final WebBeanDiscovery webBeanDiscovery;
-
-   public MockEjbDiscovery(WebBeanDiscovery webBeanDiscovery)
-   {
-      this.webBeanDiscovery = webBeanDiscovery;
-   }
-
-   public Iterable<EjbDescriptor<?>> discoverEjbs()
-   {
-      List<EjbDescriptor<?>> ejbs = new ArrayList<EjbDescriptor<?>>();
-      for (Class<?> ejbClass : discoverEjbs(webBeanDiscovery.discoverWebBeanClasses()))
-      {
-         ejbs.add(MockEjbDescriptor.of(ejbClass));
-      }
-      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)) 
-         {
-            ejbs.add(clazz);
-         }
-      }
-      return ejbs;
-   }
-   
-
-   
-}

Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJmsServices.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJmsServices.java	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJmsServices.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.webbeans.mock;
-
-import org.jboss.webbeans.messaging.spi.JmsServices;
-
-/**
- * @author Pete Muir
- *
- */
-public class MockJmsServices implements JmsServices
-{
-
-   public Object resolveDestination(String jndiName, String mappedName)
-   {
-      return null;
-   }
-
-}

Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,56 +0,0 @@
-/**
- * 
- */
-package org.jboss.webbeans.mock;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.inject.manager.InjectionPoint;
-import javax.persistence.Entity;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-import org.jboss.webbeans.persistence.spi.JpaServices;
-
-public class MockJpaServices implements JpaServices
-{
-   
-   private final WebBeanDiscovery webBeanDiscovery;
-   
-   public MockJpaServices(WebBeanDiscovery webBeanDiscovery)
-   {
-      this.webBeanDiscovery = webBeanDiscovery;
-   }
-   
-   public EntityManager resolvePersistenceContext(InjectionPoint injectionPoint)
-   {
-      return null;
-   }
-   
-   public EntityManager resolvePersistenceContext(String unitName)
-   {
-      return null;
-   }
-   
-   public EntityManagerFactory resolvePersistenceUnit(String unitName)
-   {
-      return null;
-   }
-   
-   public Collection<Class<?>> discoverEntities()
-   {
-      Set<Class<?>> classes = new HashSet<Class<?>>();
-      for (Class<?> clazz : webBeanDiscovery.discoverWebBeanClasses())
-      {
-         if (clazz.isAnnotationPresent(Entity.class))
-         {
-            classes.add(clazz);
-         }
-      }
-      return classes;
-   }
-
-}
\ No newline at end of file

Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockNamingContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockNamingContext.java	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockNamingContext.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,114 +0,0 @@
-/**
- * 
- */
-package org.jboss.webbeans.mock;
-
-import javax.naming.Context;
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.SystemException;
-import javax.transaction.TransactionManager;
-import javax.transaction.UserTransaction;
-
-import org.jboss.webbeans.resources.spi.helpers.AbstractNamingContext;
-
-public class MockNamingContext extends AbstractNamingContext
-{
-   
-   private final Context context;
-   
-   public MockNamingContext(Context context)
-   {
-      this.context = context;
-   }
-
-   public void bind(String key, Object value)
-   {
-      if (context != null)
-      {
-         super.bind(key, value);
-      }
-   }
-
-   public void unbind(String key)
-   {
-      if (context != null)
-      {
-         super.unbind(key);
-      }
-   }
-
-   public <T> T lookup(String name, Class<? extends T> expectedType)
-   {
-      if (context != null)
-      {
-         T instance = overrideLookup(name, expectedType);
-         if (instance == null)
-         {
-            instance = super.lookup(name, expectedType);
-         }
-         return instance;
-      }
-      else
-      {
-         return null;
-      }
-   }
-   
-   @SuppressWarnings("unchecked")
-   private <T> T overrideLookup(String name, Class<? extends T> expectedType)
-   {
-      // JBoss Embedded EJB 3.1 doesn't seem to bind this!
-      if (name.equals("java:comp/UserTransaction"))
-      {
-         final TransactionManager tm = super.lookup("java:/TransactionManager", TransactionManager.class);
-         return (T) new UserTransaction()
-         {
-
-            public void begin() throws NotSupportedException, SystemException
-            {
-               tm.begin();
-            }
-
-            public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
-            {
-               tm.commit();
-            }
-
-            public int getStatus() throws SystemException
-            {
-               return tm.getStatus();
-            }
-
-            public void rollback() throws IllegalStateException, SecurityException, SystemException
-            {
-               tm.rollback();
-            }
-
-            public void setRollbackOnly() throws IllegalStateException, SystemException
-            {
-               tm.setRollbackOnly();
-            }
-
-            public void setTransactionTimeout(int seconds) throws SystemException
-            {
-               tm.setTransactionTimeout(seconds);
-            }
-            
-         };
-      }
-      else
-      {
-         return null;
-      }
-   }
-
-   @Override
-   public Context getContext()
-   {
-      return context;
-   }
-   
-}
\ No newline at end of file

Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockResourceLoader.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockResourceLoader.java	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockResourceLoader.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.webbeans.mock;
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.webbeans.resources.spi.ResourceLoader;
-import org.jboss.webbeans.resources.spi.ResourceLoadingException;
-import org.jboss.webbeans.util.EnumerationIterable;
-
-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 Iterable<URL> getResources(String name)
-   {
-      try
-      {
-         return new EnumerationIterable<URL>(Thread.currentThread().getContextClassLoader().getResources(name));
-      }
-      catch (IOException e)
-      {
-         throw new ResourceLoadingException(e);
-      }
-   }
-   
-}

Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockResourceServices.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockResourceServices.java	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockResourceServices.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.webbeans.mock;
-
-import javax.inject.manager.InjectionPoint;
-
-import org.jboss.webbeans.resources.spi.ResourceServices;
-
-/**
- * @author Pete Muir
- *
- */
-public class MockResourceServices implements ResourceServices
-{
-
-   public Object resolveResource(InjectionPoint injectionPoint)
-   {
-      return null;
-   }
-   
-   public Object resolveResource(String jndiName, String mappedName)
-   {
-      return null;
-   }
-   
-}

Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,88 +0,0 @@
-package org.jboss.webbeans.mock;
-
-import org.jboss.webbeans.bootstrap.WebBeansBootstrap;
-import org.jboss.webbeans.bootstrap.api.Environments;
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-import org.jboss.webbeans.context.ContextLifecycle;
-import org.jboss.webbeans.context.api.BeanStore;
-import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
-import org.jboss.webbeans.resources.spi.NamingContext;
-import org.jboss.webbeans.resources.spi.ResourceLoader;
-
-public class MockServletLifecycle extends ContextLifecycle
-{
-   private static final ResourceLoader MOCK_RESOURCE_LOADER = new MockResourceLoader();
-   
-   private final WebBeansBootstrap bootstrap;
-   private final MockWebBeanDiscovery webBeanDiscovery;
-   private final BeanStore applicationBeanStore = new ConcurrentHashMapBeanStore();
-   private final BeanStore sessionBeanStore = new ConcurrentHashMapBeanStore();
-   private final BeanStore requestBeanStore = new ConcurrentHashMapBeanStore();
-   
-   public MockServletLifecycle()
-   {
-      this.webBeanDiscovery = new MockWebBeanDiscovery();
-      if (webBeanDiscovery == null)
-      {
-         throw new IllegalStateException("No WebBeanDiscovery is available");
-      }
-      bootstrap = new WebBeansBootstrap();
-      bootstrap.setEnvironment(Environments.SERVLET);
-      bootstrap.getServices().add(NamingContext.class, new MockNamingContext(null));
-      bootstrap.getServices().add(ResourceLoader.class, MOCK_RESOURCE_LOADER);
-      bootstrap.getServices().add(WebBeanDiscovery.class, webBeanDiscovery);
-      bootstrap.setApplicationContext(applicationBeanStore);
-      setInstance(this);
-   }
-   
-   public void initialize()
-   {
-      bootstrap.initialize();
-   }
-   
-   public MockWebBeanDiscovery getWebBeanDiscovery()
-   {
-      return webBeanDiscovery;
-   }
-   
-   public WebBeansBootstrap getBootstrap()
-   {
-      return bootstrap;
-   }
-   
-   public void beginApplication()
-   {
-      bootstrap.boot();
-   }
-   
-   public void endApplication()
-   {
-      bootstrap.shutdown();
-   }
-   
-   public void resetContexts()
-   {
-      
-   }
-   
-   public void beginRequest()
-   {
-      super.beginRequest("Mock", requestBeanStore);
-   }
-   
-   public void endRequest()
-   {
-      super.endRequest("Mock", requestBeanStore);
-   }
-   
-   public void beginSession()
-   {
-      super.restoreSession("Mock", sessionBeanStore);
-   }
-   
-   public void endSession()
-   {
-      // TODO Conversation handling breaks this :-(
-      //super.endSession("Mock", sessionBeanStore);
-   }
-}

Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.webbeans.mock;
-
-import javax.transaction.Synchronization;
-
-import org.jboss.webbeans.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)
-   {
-   }
-
-}

Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockWebBeanDiscovery.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockWebBeanDiscovery.java	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockWebBeanDiscovery.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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.webbeans.mock;
-
-import java.net.URL;
-import java.util.HashSet;
-
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-
-public class MockWebBeanDiscovery implements WebBeanDiscovery
-{
-
-   private Iterable<Class<?>> webBeanClasses = new HashSet<Class<?>>();
-
-   private Iterable<URL> webBeansXmlFiles = new HashSet<URL>();
-
-   public Iterable<Class<?>> discoverWebBeanClasses()
-   {
-      return webBeanClasses;
-   }
-
-   public Iterable<URL> discoverWebBeansXml()
-   {
-      return webBeansXmlFiles;
-   }
-   
-   public void setWebBeanClasses(Iterable<Class<?>> webBeanClasses)
-   {
-      this.webBeanClasses = webBeanClasses;
-   }
-   
-   public void setWebBeansXmlFiles(Iterable<URL> webBeansXmlFiles)
-   {
-      this.webBeansXmlFiles = webBeansXmlFiles;
-   }
-
-}

Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockWebServices.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockWebServices.java	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockWebServices.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,13 +0,0 @@
-package org.jboss.webbeans.mock;
-
-import org.jboss.webbeans.ws.spi.WebServices;
-
-public class MockWebServices implements WebServices
-{
-
-   public Object resolveResource(String jndiName, String mappedName)
-   {
-      return null;
-   }
-
-}

Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockXmlEnvironment.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockXmlEnvironment.java	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockXmlEnvironment.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,31 +0,0 @@
-package org.jboss.webbeans.mock;
-
-import java.net.URL;
-
-import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
-import org.jboss.webbeans.bootstrap.api.helpers.SimpleServiceRegistry;
-import org.jboss.webbeans.ejb.EjbDescriptorCache;
-import org.jboss.webbeans.resources.ClassTransformer;
-import org.jboss.webbeans.resources.DefaultResourceLoader;
-import org.jboss.webbeans.resources.spi.ResourceLoader;
-import org.jboss.webbeans.xml.XmlEnvironment;
-
-public class MockXmlEnvironment extends XmlEnvironment
-{
-
-   private static final ServiceRegistry services;
-   
-   static
-   {
-      services = new SimpleServiceRegistry();
-      services.add(ResourceLoader.class, new DefaultResourceLoader());
-      services.add(ClassTransformer.class, new ClassTransformer());
-   }
-   
-   public MockXmlEnvironment(Iterable<URL> beansXmlUrls, EjbDescriptorCache ejbDescriptors)
-   {
-      super(services, beansXmlUrls, ejbDescriptors, CurrentManager.rootManager());
-   }
-   
-}

Modified: ri/trunk/porting-package/pom.xml
===================================================================
--- ri/trunk/porting-package/pom.xml	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/porting-package/pom.xml	2009-04-14 22:40:05 UTC (rev 2406)
@@ -33,6 +33,11 @@
          <artifactId>el-ri</artifactId>
       </dependency>
       
+      <dependency>
+      	<groupId>org.jboss.webbeans</groupId>
+	      <artifactId>webbeans-core-test</artifactId>
+     </dependency>
+      
    </dependencies>
 
 </project>

Deleted: ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java
===================================================================
--- ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,79 +0,0 @@
-package org.jboss.webbeans.tck;
-
-import java.lang.annotation.Annotation;
-import java.net.URL;
-import java.util.List;
-
-import org.jboss.testharness.api.DeploymentException;
-import org.jboss.testharness.spi.StandaloneContainers;
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.mock.MockEELifecycle;
-import org.jboss.webbeans.mock.MockWebBeanDiscovery;
-
-public class StandaloneContainersImpl implements StandaloneContainers
-{
-   
-   private MockEELifecycle lifecycle;
-   
-   public void deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Iterable<Class<?>> classes) throws DeploymentException
-   {
-      deploy(enabledDeploymentTypes, classes, null);
-   }
-   
-   public void deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Iterable<Class<?>> classes, Iterable<URL> beansXml) throws DeploymentException
-   {
-      this.lifecycle = new MockEELifecycle();
-      lifecycle.initialize();
-      try
-      {
-         ManagerImpl manager = lifecycle.getBootstrap().getManager();
-         if (enabledDeploymentTypes != null)
-         {
-            manager.setEnabledDeploymentTypes(enabledDeploymentTypes);
-         }
-         MockWebBeanDiscovery discovery = lifecycle.getWebBeanDiscovery();
-         discovery.setWebBeanClasses(classes);
-         if (beansXml != null)
-         {
-            discovery.setWebBeansXmlFiles(beansXml);
-         }
-         lifecycle.beginApplication();
-      }
-      catch (Exception e) 
-      {
-         throw new DeploymentException("Error deploying beans", e);
-      }
-      lifecycle.beginSession();
-      lifecycle.beginRequest();
-   }
-   
-   public void deploy(Iterable<Class<?>> classes) throws DeploymentException
-   {
-      deploy(null, classes, null);
-   }
-   
-   public void deploy(Iterable<Class<?>> classes, Iterable<URL> beansXml) throws DeploymentException
-   {
-      deploy(null, classes, beansXml);
-   }
-
-   public void cleanup()
-   {
-      // TODO Auto-generated method stub
-      
-   }
-   
-   public void setup()
-   {
-      // No-op
-   }
-
-   public void undeploy()
-   {
-      lifecycle.endRequest();
-      lifecycle.endSession();
-      lifecycle.endApplication();
-      lifecycle = null;
-   }
-   
-}

Modified: ri/trunk/porting-package/src/main/resources/META-INF/jboss-test-harness.properties
===================================================================
--- ri/trunk/porting-package/src/main/resources/META-INF/jboss-test-harness.properties	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/porting-package/src/main/resources/META-INF/jboss-test-harness.properties	2009-04-14 22:40:05 UTC (rev 2406)
@@ -1,5 +1,4 @@
 org.jboss.jsr299.tck.spi.Managers=org.jboss.webbeans.tck.ManagersImpl
 org.jboss.jsr299.tck.spi.Beans=org.jboss.webbeans.tck.BeansImpl
 org.jboss.jsr299.tck.spi.Contexts=org.jboss.webbeans.tck.ContextsImpl
-org.jboss.testharness.spi.StandaloneContainers=org.jboss.webbeans.tck.StandaloneContainersImpl
 org.jboss.jsr299.tck.spi.EL=org.jboss.webbeans.tck.ELImpl
\ No newline at end of file

Modified: ri/trunk/tests/pom.xml
===================================================================
--- ri/trunk/tests/pom.xml	2009-04-14 21:27:02 UTC (rev 2405)
+++ ri/trunk/tests/pom.xml	2009-04-14 22:40:05 UTC (rev 2406)
@@ -37,13 +37,11 @@
       <dependency>
          <groupId>javax.el</groupId>
          <artifactId>el-api</artifactId>
-         <scope>test</scope>
       </dependency>
       
        <dependency>
          <groupId>javax.el</groupId>
          <artifactId>el-ri</artifactId>
-         <scope>test</scope>
       </dependency>
       
       <dependency>
@@ -60,7 +58,6 @@
       <dependency>
          <groupId>org.jboss.ejb3</groupId>
          <artifactId>jboss-ejb3-api</artifactId>
-         <scope>test</scope>
          <optional>true</optional>
          <exclusions>
             <exclusion>
@@ -83,6 +80,16 @@
       	<scope>test</scope>
       </dependency>
       
+      <dependency>
+      	<groupId>javax.transaction</groupId>
+      	<artifactId>jta</artifactId>
+    	</dependency>
+    	
+      <dependency>
+         <groupId>javax.persistence</groupId>
+         <artifactId>persistence-api</artifactId>
+      </dependency>
+      
    </dependencies>
 
    <build>

Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockConversationManager.java (from rev 2398, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockConversationManager.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockConversationManager.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockConversationManager.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.webbeans.mock;
+
+import org.jboss.webbeans.conversation.ServletConversationManager;
+
+/**
+ * Mock of a conversation manager without servlet dependencies
+ * 
+ * @author Nicklas Karlsson
+ *
+ */
+// TODO dummy
+public class MockConversationManager extends ServletConversationManager
+{
+
+}

Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java (from rev 2398, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.webbeans.mock;
+
+import org.jboss.webbeans.bootstrap.api.Environments;
+import org.jboss.webbeans.ejb.spi.EjbServices;
+import org.jboss.webbeans.messaging.spi.JmsServices;
+import org.jboss.webbeans.persistence.spi.JpaServices;
+import org.jboss.webbeans.resources.spi.ResourceServices;
+import org.jboss.webbeans.transaction.spi.TransactionServices;
+import org.jboss.webbeans.ws.spi.WebServices;
+
+public class MockEELifecycle extends MockServletLifecycle
+{
+   
+   private static final TransactionServices MOCK_TRANSACTION_SERVICES = new MockTransactionServices();
+
+   public MockEELifecycle()
+   {
+      super();
+      getBootstrap().getServices().add(TransactionServices.class, MOCK_TRANSACTION_SERVICES);
+      getBootstrap().getServices().add(EjbServices.class, new MockEjBServices(getWebBeanDiscovery()));
+      getBootstrap().getServices().add(JpaServices.class, new MockJpaServices(getWebBeanDiscovery()));
+      getBootstrap().getServices().add(ResourceServices.class, new MockResourceServices());
+      getBootstrap().getServices().add(WebServices.class, new MockWebServices());
+      getBootstrap().getServices().add(JmsServices.class, new MockJmsServices());
+      getBootstrap().setEnvironment(Environments.EE);
+   }
+   
+  
+   
+}


Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java (from rev 2398, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -0,0 +1,71 @@
+/**
+ * 
+ */
+package org.jboss.webbeans.mock;
+
+import java.lang.reflect.Field;
+import java.util.Collection;
+
+import javax.inject.manager.InjectionPoint;
+
+import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.ejb.api.SessionObjectReference;
+import org.jboss.webbeans.ejb.spi.EjbDescriptor;
+import org.jboss.webbeans.ejb.spi.EjbServices;
+
+public class MockEjBServices implements EjbServices
+{
+   
+   private final MockEjbDiscovery ejbDiscovery;
+   
+   public MockEjBServices(WebBeanDiscovery webBeanDiscovery)
+   {
+      this.ejbDiscovery = new MockEjbDiscovery(webBeanDiscovery);
+   }
+   
+   public Object resolveEjb(InjectionPoint injectionPoint)
+   {
+      return null;
+   }
+   
+   public void removeEjb(Collection<Object> instance)
+   {
+      // No-op
+   }
+   
+   public Object resolveRemoteEjb(String jndiName, String mappedName, String ejbLink)
+   {
+      return null;
+   }
+   
+   public Iterable<EjbDescriptor<?>> discoverEjbs()
+   {
+      return ejbDiscovery.discoverEjbs();
+   }
+
+   public SessionObjectReference resolveEjb(EjbDescriptor<?> ejbDescriptor)
+   {
+      return new SessionObjectReference()
+      {
+
+         public <S> S getBusinessObject(Class<S> businessInterfaceType)
+         {
+            // TODO Auto-generated method stub
+            return null;
+         }
+
+         public void remove()
+         {
+            // TODO Auto-generated method stub
+            
+         }
+         
+         public Object getFieldValue(Field field)
+         {
+            // TODO Auto-generated method stub
+            return null;
+         }
+         
+      };
+   }
+}
\ No newline at end of file


Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java (from rev 2405, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -0,0 +1,200 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.webbeans.mock;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+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.webbeans.ejb.spi.BusinessInterfaceDescriptor;
+import org.jboss.webbeans.ejb.spi.EjbDescriptor;
+
+public class MockEjbDescriptor<T> implements EjbDescriptor<T>
+{
+   private final Class<T> type;
+   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.type = 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 Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces()
+   {
+      return localInterfaces;
+   }
+   
+   public Iterable<BusinessInterfaceDescriptor<?>> getRemoteBusinessInterfaces()
+   {
+      return Collections.emptyList();
+   }
+
+   public Iterable<Method> getRemoveMethods()
+   {
+
+      return removeMethods;
+   }
+
+   public Class<T> getType()
+   {
+      return type;
+   }
+
+   public boolean isMessageDriven()
+   {
+      return type.isAnnotationPresent(MessageDriven.class);
+   }
+
+   public boolean isSingleton()
+   {
+      return type.isAnnotationPresent(Singleton.class);
+   }
+
+   public boolean isStateful()
+   {
+      return type.isAnnotationPresent(Stateful.class);
+   }
+
+   public boolean isStateless()
+   {
+      return type.isAnnotationPresent(Stateless.class);
+   }
+   
+   public String getLocalJndiName()
+   {
+      return type.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: " + getType() + "; 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.getEjbName().equals(that.getEjbName());
+      }
+      else
+      {
+         return false;
+      }
+   }
+   
+   @Override
+   public int hashCode()
+   {
+      return getEjbName().hashCode();
+   }
+
+}

Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java (from rev 2398, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.webbeans.mock;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.ejb.MessageDriven;
+import javax.ejb.Singleton;
+import javax.ejb.Stateful;
+import javax.ejb.Stateless;
+
+import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.ejb.spi.EjbDescriptor;
+
+public class MockEjbDiscovery
+{
+   
+   private final WebBeanDiscovery webBeanDiscovery;
+
+   public MockEjbDiscovery(WebBeanDiscovery webBeanDiscovery)
+   {
+      this.webBeanDiscovery = webBeanDiscovery;
+   }
+
+   public Iterable<EjbDescriptor<?>> discoverEjbs()
+   {
+      List<EjbDescriptor<?>> ejbs = new ArrayList<EjbDescriptor<?>>();
+      for (Class<?> ejbClass : discoverEjbs(webBeanDiscovery.discoverWebBeanClasses()))
+      {
+         ejbs.add(MockEjbDescriptor.of(ejbClass));
+      }
+      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)) 
+         {
+            ejbs.add(clazz);
+         }
+      }
+      return ejbs;
+   }
+   
+
+   
+}


Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockJmsServices.java (from rev 2398, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJmsServices.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockJmsServices.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockJmsServices.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.webbeans.mock;
+
+import org.jboss.webbeans.messaging.spi.JmsServices;
+
+/**
+ * @author Pete Muir
+ *
+ */
+public class MockJmsServices implements JmsServices
+{
+
+   public Object resolveDestination(String jndiName, String mappedName)
+   {
+      return null;
+   }
+
+}


Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockJmsServices.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java (from rev 2398, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -0,0 +1,56 @@
+/**
+ * 
+ */
+package org.jboss.webbeans.mock;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.inject.manager.InjectionPoint;
+import javax.persistence.Entity;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+
+import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.persistence.spi.JpaServices;
+
+public class MockJpaServices implements JpaServices
+{
+   
+   private final WebBeanDiscovery webBeanDiscovery;
+   
+   public MockJpaServices(WebBeanDiscovery webBeanDiscovery)
+   {
+      this.webBeanDiscovery = webBeanDiscovery;
+   }
+   
+   public EntityManager resolvePersistenceContext(InjectionPoint injectionPoint)
+   {
+      return null;
+   }
+   
+   public EntityManager resolvePersistenceContext(String unitName)
+   {
+      return null;
+   }
+   
+   public EntityManagerFactory resolvePersistenceUnit(String unitName)
+   {
+      return null;
+   }
+   
+   public Collection<Class<?>> discoverEntities()
+   {
+      Set<Class<?>> classes = new HashSet<Class<?>>();
+      for (Class<?> clazz : webBeanDiscovery.discoverWebBeanClasses())
+      {
+         if (clazz.isAnnotationPresent(Entity.class))
+         {
+            classes.add(clazz);
+         }
+      }
+      return classes;
+   }
+
+}
\ No newline at end of file


Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockNamingContext.java (from rev 2398, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockNamingContext.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockNamingContext.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockNamingContext.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -0,0 +1,114 @@
+/**
+ * 
+ */
+package org.jboss.webbeans.mock;
+
+import javax.naming.Context;
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.RollbackException;
+import javax.transaction.SystemException;
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+
+import org.jboss.webbeans.resources.spi.helpers.AbstractNamingContext;
+
+public class MockNamingContext extends AbstractNamingContext
+{
+   
+   private final Context context;
+   
+   public MockNamingContext(Context context)
+   {
+      this.context = context;
+   }
+
+   public void bind(String key, Object value)
+   {
+      if (context != null)
+      {
+         super.bind(key, value);
+      }
+   }
+
+   public void unbind(String key)
+   {
+      if (context != null)
+      {
+         super.unbind(key);
+      }
+   }
+
+   public <T> T lookup(String name, Class<? extends T> expectedType)
+   {
+      if (context != null)
+      {
+         T instance = overrideLookup(name, expectedType);
+         if (instance == null)
+         {
+            instance = super.lookup(name, expectedType);
+         }
+         return instance;
+      }
+      else
+      {
+         return null;
+      }
+   }
+   
+   @SuppressWarnings("unchecked")
+   private <T> T overrideLookup(String name, Class<? extends T> expectedType)
+   {
+      // JBoss Embedded EJB 3.1 doesn't seem to bind this!
+      if (name.equals("java:comp/UserTransaction"))
+      {
+         final TransactionManager tm = super.lookup("java:/TransactionManager", TransactionManager.class);
+         return (T) new UserTransaction()
+         {
+
+            public void begin() throws NotSupportedException, SystemException
+            {
+               tm.begin();
+            }
+
+            public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
+            {
+               tm.commit();
+            }
+
+            public int getStatus() throws SystemException
+            {
+               return tm.getStatus();
+            }
+
+            public void rollback() throws IllegalStateException, SecurityException, SystemException
+            {
+               tm.rollback();
+            }
+
+            public void setRollbackOnly() throws IllegalStateException, SystemException
+            {
+               tm.setRollbackOnly();
+            }
+
+            public void setTransactionTimeout(int seconds) throws SystemException
+            {
+               tm.setTransactionTimeout(seconds);
+            }
+            
+         };
+      }
+      else
+      {
+         return null;
+      }
+   }
+
+   @Override
+   public Context getContext()
+   {
+      return context;
+   }
+   
+}
\ No newline at end of file


Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockNamingContext.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockResourceLoader.java (from rev 2398, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockResourceLoader.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockResourceLoader.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockResourceLoader.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.webbeans.mock;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.webbeans.resources.spi.ResourceLoader;
+import org.jboss.webbeans.resources.spi.ResourceLoadingException;
+import org.jboss.webbeans.util.EnumerationIterable;
+
+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 Iterable<URL> getResources(String name)
+   {
+      try
+      {
+         return new EnumerationIterable<URL>(Thread.currentThread().getContextClassLoader().getResources(name));
+      }
+      catch (IOException e)
+      {
+         throw new ResourceLoadingException(e);
+      }
+   }
+   
+}


Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockResourceLoader.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockResourceServices.java (from rev 2398, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockResourceServices.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockResourceServices.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockResourceServices.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.webbeans.mock;
+
+import javax.inject.manager.InjectionPoint;
+
+import org.jboss.webbeans.resources.spi.ResourceServices;
+
+/**
+ * @author Pete Muir
+ *
+ */
+public class MockResourceServices implements ResourceServices
+{
+
+   public Object resolveResource(InjectionPoint injectionPoint)
+   {
+      return null;
+   }
+   
+   public Object resolveResource(String jndiName, String mappedName)
+   {
+      return null;
+   }
+   
+}


Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockResourceServices.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java (from rev 2398, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -0,0 +1,88 @@
+package org.jboss.webbeans.mock;
+
+import org.jboss.webbeans.bootstrap.WebBeansBootstrap;
+import org.jboss.webbeans.bootstrap.api.Environments;
+import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.context.ContextLifecycle;
+import org.jboss.webbeans.context.api.BeanStore;
+import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
+import org.jboss.webbeans.resources.spi.NamingContext;
+import org.jboss.webbeans.resources.spi.ResourceLoader;
+
+public class MockServletLifecycle extends ContextLifecycle
+{
+   private static final ResourceLoader MOCK_RESOURCE_LOADER = new MockResourceLoader();
+   
+   private final WebBeansBootstrap bootstrap;
+   private final MockWebBeanDiscovery webBeanDiscovery;
+   private final BeanStore applicationBeanStore = new ConcurrentHashMapBeanStore();
+   private final BeanStore sessionBeanStore = new ConcurrentHashMapBeanStore();
+   private final BeanStore requestBeanStore = new ConcurrentHashMapBeanStore();
+   
+   public MockServletLifecycle()
+   {
+      this.webBeanDiscovery = new MockWebBeanDiscovery();
+      if (webBeanDiscovery == null)
+      {
+         throw new IllegalStateException("No WebBeanDiscovery is available");
+      }
+      bootstrap = new WebBeansBootstrap();
+      bootstrap.setEnvironment(Environments.SERVLET);
+      bootstrap.getServices().add(NamingContext.class, new MockNamingContext(null));
+      bootstrap.getServices().add(ResourceLoader.class, MOCK_RESOURCE_LOADER);
+      bootstrap.getServices().add(WebBeanDiscovery.class, webBeanDiscovery);
+      bootstrap.setApplicationContext(applicationBeanStore);
+      setInstance(this);
+   }
+   
+   public void initialize()
+   {
+      bootstrap.initialize();
+   }
+   
+   public MockWebBeanDiscovery getWebBeanDiscovery()
+   {
+      return webBeanDiscovery;
+   }
+   
+   public WebBeansBootstrap getBootstrap()
+   {
+      return bootstrap;
+   }
+   
+   public void beginApplication()
+   {
+      bootstrap.boot();
+   }
+   
+   public void endApplication()
+   {
+      bootstrap.shutdown();
+   }
+   
+   public void resetContexts()
+   {
+      
+   }
+   
+   public void beginRequest()
+   {
+      super.beginRequest("Mock", requestBeanStore);
+   }
+   
+   public void endRequest()
+   {
+      super.endRequest("Mock", requestBeanStore);
+   }
+   
+   public void beginSession()
+   {
+      super.restoreSession("Mock", sessionBeanStore);
+   }
+   
+   public void endSession()
+   {
+      // TODO Conversation handling breaks this :-(
+      //super.endSession("Mock", sessionBeanStore);
+   }
+}


Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java (from rev 2398, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.webbeans.mock;
+
+import javax.transaction.Synchronization;
+
+import org.jboss.webbeans.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)
+   {
+   }
+
+}


Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockWebBeanDiscovery.java (from rev 2398, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockWebBeanDiscovery.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockWebBeanDiscovery.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockWebBeanDiscovery.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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.webbeans.mock;
+
+import java.net.URL;
+import java.util.HashSet;
+
+import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+
+public class MockWebBeanDiscovery implements WebBeanDiscovery
+{
+
+   private Iterable<Class<?>> webBeanClasses = new HashSet<Class<?>>();
+
+   private Iterable<URL> webBeansXmlFiles = new HashSet<URL>();
+
+   public Iterable<Class<?>> discoverWebBeanClasses()
+   {
+      return webBeanClasses;
+   }
+
+   public Iterable<URL> discoverWebBeansXml()
+   {
+      return webBeansXmlFiles;
+   }
+   
+   public void setWebBeanClasses(Iterable<Class<?>> webBeanClasses)
+   {
+      this.webBeanClasses = webBeanClasses;
+   }
+   
+   public void setWebBeansXmlFiles(Iterable<URL> webBeansXmlFiles)
+   {
+      this.webBeansXmlFiles = webBeansXmlFiles;
+   }
+
+}


Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockWebBeanDiscovery.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockWebServices.java (from rev 2398, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockWebServices.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockWebServices.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockWebServices.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.mock;
+
+import org.jboss.webbeans.ws.spi.WebServices;
+
+public class MockWebServices implements WebServices
+{
+
+   public Object resolveResource(String jndiName, String mappedName)
+   {
+      return null;
+   }
+
+}


Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockWebServices.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockXmlEnvironment.java (from rev 2398, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockXmlEnvironment.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockXmlEnvironment.java	                        (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockXmlEnvironment.java	2009-04-14 22:40:05 UTC (rev 2406)
@@ -0,0 +1,31 @@
+package org.jboss.webbeans.mock;
+
+import java.net.URL;
+
+import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
+import org.jboss.webbeans.bootstrap.api.helpers.SimpleServiceRegistry;
+import org.jboss.webbeans.ejb.EjbDescriptorCache;
+import org.jboss.webbeans.resources.ClassTransformer;
+import org.jboss.webbeans.resources.DefaultResourceLoader;
+import org.jboss.webbeans.resources.spi.ResourceLoader;
+import org.jboss.webbeans.xml.XmlEnvironment;
+
+public class MockXmlEnvironment extends XmlEnvironment
+{
+
+   private static final ServiceRegistry services;
+   
+   static
+   {
+      services = new SimpleServiceRegistry();
+      services.add(ResourceLoader.class, new DefaultResourceLoader());
+      services.add(ClassTransformer.class, new ClassTransformer());
+   }
+   
+   public MockXmlEnvironment(Iterable<URL> beansXmlUrls, EjbDescriptorCache ejbDescriptors)
+   {
+      super(services, beansXmlUrls, ejbDescriptors, CurrentManager.rootManager());
+   }
+   
+}


Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockXmlEnvironment.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/el (from rev 2398, ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/el)




More information about the weld-commits mailing list