openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1056587 [1/2] - in /openwebbeans/trunk/webbeans-impl/src: main/java/org/apache/webbeans/config/ main/java/org/apache/webbeans/container/ main/java/org/apache/webbeans/context/ main/java/org/apache/webbeans/corespi/ main/java/org/apache/web...
Date Sat, 08 Jan 2011 01:21:43 GMT
Author: dblevins
Date: Sat Jan  8 01:21:42 2011
New Revision: 1056587

URL: http://svn.apache.org/viewvc?rev=1056587&view=rev
Log:
De-static ContextFactory, now an instance that lives in WebBeansContext

OWB-503 status: 615 code uses
Total of 28894 static synchronized accesses and 29317 hashed calls in 340 tests
Average of 84 static synchronized accesses and 86 hashed calls per test


Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/DefaultSingletonService.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/AbstractLifeCycle.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/contexts/SerializationTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/DependingInterceptorTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/decorator/Decorator1Test.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/dependent/DependentComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/dependent/MultipleDependentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/disposal/DisposalTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/component/ObserversComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/CurrentInjectedComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/DisposalInjectedComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedComponentWithMemberTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedInstanceComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/PaymentProcessorComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/TypedInjectedComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/UserComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructDoubleInterceptorComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructInterceptorComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PreDestroyComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/CallingBusinessInConstructorTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureAndTransactionalInterceptorTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/ShoppingCardInterceptorTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/WebBeansInterceptComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/library/LibraryComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/newcomp/NewComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/ProducerFieldComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/portable/events/ExtensionTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/producer/Producer1ConsumerComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/producer/ProducerComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/producer/StaticProducerTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/producer/primitive/PrimitiveProducerTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/scopes/ScopeAdapterTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/scopes/SingletonComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/specializes/SpecializationComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/typedliteral/TypedLiteralComponentTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/definition/XMLDefinitionTest.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java Sat Jan  8 01:21:42 2011
@@ -27,6 +27,7 @@ import java.util.Map;
 import org.apache.webbeans.annotation.AnnotationManager;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.container.SerializableBeanVault;
+import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.context.creational.CreationalContextFactory;
 import org.apache.webbeans.conversation.ConversationManager;
 //import org.apache.webbeans.corespi.se.DefaultContextsService;
@@ -56,6 +57,7 @@ import org.apache.webbeans.xml.XMLSpecia
 public class WebBeansContext
 {
 
+    private ContextFactory contextFactory = new ContextFactory(this);
     private AlternativesManager alternativesManager = new AlternativesManager(this);
     private AnnotatedElementFactory annotatedElementFactory = new AnnotatedElementFactory();
     private BeanManagerImpl beanManagerImpl = new BeanManagerImpl(this);
@@ -156,6 +158,11 @@ public class WebBeansContext
         return serviceInterface.cast(WebBeansFinder.getSingletonInstance(implName));
     }
 
+    public ContextFactory getContextFactory()
+    {
+        return contextFactory;
+    }
+
     public AnnotationManager getAnnotationManager()
     {
         return annotationManager;
@@ -259,7 +266,7 @@ public class WebBeansContext
 
     public Object get(String singletonName)
     {
-        //util.Track.get(singletonName);
+        util.Track.get(singletonName);
         Object object = managerMap.get(singletonName);
 
         /* No singleton for this application, create one */

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java Sat Jan  8 01:21:42 2011
@@ -70,7 +70,6 @@ import org.apache.webbeans.component.Owb
 import org.apache.webbeans.component.WebBeansType;
 import org.apache.webbeans.component.third.ThirdpartyBeanImpl;
 import org.apache.webbeans.config.WebBeansContext;
-import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.context.creational.CreationalContextImpl;
 import org.apache.webbeans.decorator.DecoratorComparator;
 import org.apache.webbeans.decorator.WebBeansDecorator;
@@ -284,7 +283,7 @@ public class BeanManagerImpl implements 
 
         Context standardContext = null;
 
-        standardContext = ContextFactory.getStandardContext(scopeType);
+        standardContext = webBeansContext.getContextFactory().getStandardContext(scopeType);
 
         if(standardContext != null && standardContext.isActive())
         {
@@ -366,7 +365,7 @@ public class BeanManagerImpl implements 
     
     public BeanManager addContext(Context context)
     {
-        addContext(context.getScope(), ContextFactory.getCustomContext(context));
+        addContext(context.getScope(), webBeansContext.getContextFactory().getCustomContext(context));
 
         return this;
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java Sat Jan  8 01:21:42 2011
@@ -31,6 +31,7 @@ import javax.inject.Singleton;
 import org.apache.webbeans.context.type.ContextTypes;
 import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.spi.ContextsService;
+import org.apache.webbeans.config.WebBeansContext;
 
 /**
  * JSR-299 based standard context
@@ -40,25 +41,22 @@ public final class ContextFactory
 {
     /**Logger instance*/
     private static final WebBeansLogger logger = WebBeansLogger.getLogger(ContextFactory.class);
+    private final WebBeansContext webBeansContext;
 
-    /**
-     * Not-instantiate
-     */
-    private ContextFactory()
+    public ContextFactory(WebBeansContext webBeansContext)
     {
-        throw new UnsupportedOperationException();
+        this.webBeansContext = webBeansContext;
     }
 
     /**
      * @return the ContextService for the current ClassLoader
      */
-    private static ContextsService getContextsService()
+    private ContextsService getContextsService()
     {
-        return org.apache.webbeans.config.WebBeansContext.getInstance().getService(ContextsService.class);
+        return webBeansContext.getService(ContextsService.class);
     }
-    
-    
-    public static void initRequestContext(Object request)
+
+    public void initRequestContext(Object request)
     {
         try
         {
@@ -71,23 +69,23 @@ public final class ContextFactory
         }
     }
 
-    public static Context getCustomContext(Context context)
+    public Context getCustomContext(Context context)
     {
-        if (org.apache.webbeans.config.WebBeansContext.getInstance().getBeanManagerImpl().isPassivatingScope(context.getScope()))
+        if (webBeansContext.getBeanManagerImpl().isPassivatingScope(context.getScope()))
         {
             return new CustomPassivatingContextImpl(context);
         }
-        
+
         return new CustomContextImpl(context);
     }
-    
-    public static void destroyRequestContext(Object request)
+
+    public void destroyRequestContext(Object request)
     {
         ContextsService contextService = getContextsService();
         contextService.endContext(RequestScoped.class, request);
     }
 
-    public static void initSessionContext(Object session)
+    public void initSessionContext(Object session)
     {
         try
         {
@@ -100,18 +98,13 @@ public final class ContextFactory
         }
     }
 
-    public static void destroySessionContext(Object session)
+    public void destroySessionContext(Object session)
     {
         ContextsService contextService = getContextsService();
         contextService.endContext(SessionScoped.class, session);
     }
 
-    /**
-     * Creates the application context at the application startup
-     * 
-     * @param parameter parameter object
-     */
-    public static void initApplicationContext(Object parameter)
+    public void initApplicationContext(Object parameter)
     {
         try
         {
@@ -127,16 +120,16 @@ public final class ContextFactory
     /**
      * Destroys the application context and all of its components at the end of
      * the application.
-     * 
+     *
      * @param parameter parameter object
      */
-    public static void destroyApplicationContext(Object parameter)
+    public void destroyApplicationContext(Object parameter)
     {
         ContextsService contextService = getContextsService();
         contextService.endContext(ApplicationScoped.class, parameter);
     }
-    
-    public static void initSingletonContext(Object parameter)
+
+    public void initSingletonContext(Object parameter)
     {
         try
         {
@@ -145,17 +138,17 @@ public final class ContextFactory
         }
         catch (Exception e)
         {
-            logger.error(e);            
+            logger.error(e);
         }
     }
-    
-    public static void destroySingletonContext(Object parameter)
+
+    public void destroySingletonContext(Object parameter)
     {
         ContextsService contextService = getContextsService();
         contextService.endContext(Singleton.class, parameter);
     }
 
-    public static void initConversationContext(Object context)
+    public void initConversationContext(Object context)
     {
         try
         {
@@ -164,11 +157,11 @@ public final class ContextFactory
         }
         catch (Exception e)
         {
-            logger.error(e);            
+            logger.error(e);
         }
     }
 
-    public static void destroyConversationContext()
+    public void destroyConversationContext()
     {
         ContextsService contextService = getContextsService();
         contextService.endContext(ConversationScoped.class, null);
@@ -176,18 +169,18 @@ public final class ContextFactory
 
     /**
      * Gets the current context with given type.
-     * 
+     *
      * @return the current context
      * @throws ContextNotActiveException if context is not active
      * @throws IllegalArgumentException if the type is not a standard context
      */
-    public static Context getStandardContext(ContextTypes type) throws ContextNotActiveException
+    public Context getStandardContext(ContextTypes type) throws ContextNotActiveException
     {
         ContextsService contextService = getContextsService();
         return getStandardContext(contextService, type);
     }
 
-    public static Context getStandardContext(ContextsService contextService, ContextTypes type) throws ContextNotActiveException
+    public Context getStandardContext(ContextsService contextService, ContextTypes type) throws ContextNotActiveException
     {
         Context context = null;
         switch (type.getCardinal())
@@ -195,19 +188,19 @@ public final class ContextFactory
             case 0:
                 context = contextService.getCurrentContext(RequestScoped.class);
                 break;
-    
+
             case 1:
                 context = contextService.getCurrentContext(SessionScoped.class);
                 break;
-    
+
             case 2:
                 context = contextService.getCurrentContext(ApplicationScoped.class);
                 break;
-    
+
             case 3:
                 context = contextService.getCurrentContext(ConversationScoped.class);
                 break;
-                
+
             case 4:
                 context = contextService.getCurrentContext(Dependent.class);
                 break;
@@ -215,7 +208,7 @@ public final class ContextFactory
             case 5:
                 context = contextService.getCurrentContext(Singleton.class);
                 break;
-                
+
             default:
                 throw new IllegalArgumentException("There is no such a standard context with context id=" + type.getCardinal());
         }
@@ -225,32 +218,32 @@ public final class ContextFactory
 
     /**
      * Gets the standard context with given scope type.
-     * 
+     *
      * @return the current context, or <code>null</code> if no standard context exists for the given scopeType
      */
-    public static Context getStandardContext(Class<? extends Annotation> scopeType)
+    public Context getStandardContext(Class<? extends Annotation> scopeType)
     {
         ContextsService contextService = getContextsService();
 
         return contextService.getCurrentContext(scopeType);
     }
-    
+
     /**
-     * Activate context. 
+     * Activate context.
      */
-    public static void activateContext(Class<? extends Annotation> scopeType)
+    public void activateContext(Class<? extends Annotation> scopeType)
     {
         ContextsService contextService = getContextsService();
         contextService.activateContext(scopeType);
     }
-    
+
     /**
      * Deactivate context.
      */
-    public static void deActivateContext(Class<? extends Annotation> scopeType)
+    public void deActivateContext(Class<? extends Annotation> scopeType)
     {
         ContextsService contextService = getContextsService();
         contextService.deActivateContext(scopeType);
     }
-    
+
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/DefaultSingletonService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/DefaultSingletonService.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/DefaultSingletonService.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/DefaultSingletonService.java Sat Jan  8 01:21:42 2011
@@ -61,10 +61,10 @@ public class DefaultSingletonService imp
 
         synchronized (singletonMap)
         {
-            //util.Track.sync(singletonName);
+            util.Track.sync(singletonName);
             
             WebBeansContext managerMap = singletonMap.get(classLoader);
-            //util.Track.get(singletonName);
+            util.Track.get(singletonName);
 
             if (managerMap == null)
             {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/AbstractLifeCycle.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/AbstractLifeCycle.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/AbstractLifeCycle.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/AbstractLifeCycle.java Sat Jan  8 01:21:42 2011
@@ -62,7 +62,7 @@ public abstract class AbstractLifeCycle 
     
     /**Root container.*/
     private final BeanManagerImpl beanManager;
-    private final WebBeansContext webBeansContext;
+    protected final WebBeansContext webBeansContext;
 
     protected AbstractLifeCycle()
     {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java Sat Jan  8 01:21:42 2011
@@ -21,7 +21,6 @@ package org.apache.webbeans.lifecycle;
 import java.util.Properties;
 
 import org.apache.webbeans.config.WebBeansFinder;
-import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.el.ELContextStore;
 import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.util.WebBeansUtil;
@@ -51,22 +50,22 @@ public class StandaloneLifeCycle extends
     @Override
     public void beforeStartApplication(Object object)
     {
-        ContextFactory.initRequestContext(null);
-        ContextFactory.initSessionContext(null);
-        ContextFactory.initConversationContext(null);
-        ContextFactory.initApplicationContext(null);       
-        ContextFactory.initSingletonContext(null);
+        webBeansContext.getContextFactory().initRequestContext(null);
+        webBeansContext.getContextFactory().initSessionContext(null);
+        webBeansContext.getContextFactory().initConversationContext(null);
+        webBeansContext.getContextFactory().initApplicationContext(null);
+        webBeansContext.getContextFactory().initSingletonContext(null);
     }
         
     
     @Override
     public void beforeStopApplication(Object endObject)
     {
-        ContextFactory.destroyRequestContext(null);
-        ContextFactory.destroySessionContext(null);
-        ContextFactory.destroyConversationContext();
-        ContextFactory.destroyApplicationContext(null);
-        ContextFactory.destroySingletonContext(null);
+        webBeansContext.getContextFactory().destroyRequestContext(null);
+        webBeansContext.getContextFactory().destroySessionContext(null);
+        webBeansContext.getContextFactory().destroyConversationContext();
+        webBeansContext.getContextFactory().destroyApplicationContext(null);
+        webBeansContext.getContextFactory().destroySingletonContext(null);
 
         // clean up the EL caches after each request
         ELContextStore elStore = ELContextStore.getInstance(false);

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/contexts/SerializationTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/contexts/SerializationTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/contexts/SerializationTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/contexts/SerializationTest.java Sat Jan  8 01:21:42 2011
@@ -21,7 +21,6 @@ package org.apache.webbeans.newtests.con
 
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.SerializableBean;
-import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.context.type.ContextTypes;
 import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.newtests.contexts.serialize.AppScopedBean;
@@ -119,12 +118,13 @@ public class SerializationTest extends A
         Assert.assertNotNull(beans);
         Assert.assertTrue(beans.size() > 7);
 
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
         for (Bean<?> bean : beans)
         {
             String id = null;
             if((id = WebBeansUtil.isPassivationCapable(bean)) != null)
             {
-                bean = (Bean<?>) WebBeansContext.getInstance().getSerializableBeanVault().getSerializableBean(bean);
+                bean = (Bean<?>) webBeansContext.getSerializableBeanVault().getSerializableBean(bean);
                 
                 byte[] serial = serializeBean(bean);
                 Bean<?> b2 = deSerializeBean(serial);
@@ -139,8 +139,8 @@ public class SerializationTest extends A
         pdb.business();
         
         // first we need to actually create a few instances
-        
-        Context sessionContext = ContextFactory.getStandardContext(ContextTypes.SESSION);
+
+        Context sessionContext = webBeansContext.getContextFactory().getStandardContext(ContextTypes.SESSION);
         Assert.assertNotNull(sessionContext);
         byte[] ba = serializeObject(sessionContext);
         Assert.assertNotNull(ba);

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/DependingInterceptorTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/DependingInterceptorTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/DependingInterceptorTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/DependingInterceptorTest.java Sat Jan  8 01:21:42 2011
@@ -28,7 +28,7 @@ import javax.enterprise.inject.spi.Bean;
 
 import junit.framework.Assert;
 
-import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.newtests.interceptors.beans.ApplicationScopedBean;
 import org.apache.webbeans.newtests.interceptors.beans.RequestScopedBean;
@@ -79,9 +79,10 @@ public class DependingInterceptorTest ex
 
         TransactionInterceptor.ECHO = false;
 
-        ContextFactory.destroyRequestContext(null);
-        ContextFactory.initRequestContext(null);      
-        
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
+        webBeansContext.getContextFactory().destroyRequestContext(null);
+        webBeansContext.getContextFactory().initRequestContext(null);
+
         CreationalContext<RequestScopedBean> ctx2 = getBeanManager().createCreationalContext(bean);
         Object reference2 = getBeanManager().getReference(bean, RequestScopedBean.class, ctx2);
         Assert.assertNotNull(reference2);

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.java Sat Jan  8 01:21:42 2011
@@ -28,7 +28,7 @@ import javax.enterprise.inject.spi.Bean;
 
 import junit.framework.Assert;
 
-import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.newtests.interceptors.business.common.WithInheritedBindingTypeBean;
 import org.apache.webbeans.newtests.interceptors.common.SecureInterceptor;
@@ -73,10 +73,11 @@ public class WithInheritedBindingTypeTes
         
         Assert.assertTrue(TransactionInterceptor.ECHO);
         Assert.assertTrue(SecureInterceptor.ECHO);
-        
-        ContextFactory.destroyRequestContext(null);
-        ContextFactory.initRequestContext(null);
-        
+
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
+        webBeansContext.getContextFactory().destroyRequestContext(null);
+        webBeansContext.getContextFactory().initRequestContext(null);
+
         reference = getBeanManager().getReference(bean, WithInheritedBindingTypeBean.class, ctx);
         beanInstance = (WithInheritedBindingTypeBean)reference;
         beanInstance.business();

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java Sat Jan  8 01:21:42 2011
@@ -27,7 +27,7 @@ import javax.enterprise.inject.spi.Bean;
 import junit.framework.Assert;
 
 import org.apache.webbeans.annotation.DefaultLiteral;
-import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.exception.inject.DefinitionException;
 import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.newtests.portable.scopeextension.ExternalTestScopeExtension;
@@ -59,7 +59,8 @@ public class ExtensionTest extends Abstr
         addExtension(new ExternalTestScopeExtension());
         startContainer(classes);
 
-        ContextFactory.initApplicationContext(null);
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
+        webBeansContext.getContextFactory().initApplicationContext(null);
 
         @SuppressWarnings("unchecked")
         Bean<ExternalTestScopedBean> bean = (Bean<ExternalTestScopedBean>) getBeanManager().getBeans(ExternalTestScopedBean.class, 
@@ -75,8 +76,8 @@ public class ExtensionTest extends Abstr
         //Fire shut down
         getBeanManager().fireEvent(new BeforeShutdownImpl(), new Annotation[0]);
 
-        ContextFactory.destroyApplicationContext(null);
-        
+        webBeansContext.getContextFactory().destroyApplicationContext(null);
+
         shutDownContainer();
         
     }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java Sat Jan  8 01:21:42 2011
@@ -44,7 +44,6 @@ import org.apache.webbeans.component.xml
 import org.apache.webbeans.config.DefinitionUtil;
 import org.apache.webbeans.config.ManagedBeanConfigurator;
 import org.apache.webbeans.config.WebBeansContext;
-import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.context.DependentContext;
 import org.apache.webbeans.decorator.DecoratorUtil;
 import org.apache.webbeans.decorator.WebBeansDecoratorConfig;
@@ -146,7 +145,7 @@ public abstract class TestContext implem
 
     protected void initDependentContext()
     {
-        DependentContext dependentContext = (DependentContext)ContextFactory.getStandardContext(Dependent.class);
+        DependentContext dependentContext = (DependentContext) WebBeansContext.getInstance().getContextFactory().getStandardContext(Dependent.class);
         dependentContext.setActive(true);
     }
 

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/decorator/Decorator1Test.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/decorator/Decorator1Test.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/decorator/Decorator1Test.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/decorator/Decorator1Test.java Sat Jan  8 01:21:42 2011
@@ -31,7 +31,7 @@ import junit.framework.Assert;
 
 import org.apache.webbeans.annotation.DefaultLiteral;
 import org.apache.webbeans.component.AbstractOwbBean;
-import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.annotation.binding.Binding1Literal;
 import org.apache.webbeans.test.component.CheckWithCheckPayment;
@@ -71,8 +71,9 @@ public class Decorator1Test extends Test
         defineDecorator(ServiceDecorator.class);
         AbstractOwbBean<ServiceImpl1> component = defineManagedBean(ServiceImpl1.class);
 
-        ContextFactory.initRequestContext(null);
-        ContextFactory.initApplicationContext(null);
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
+        webBeansContext.getContextFactory().initRequestContext(null);
+        webBeansContext.getContextFactory().initApplicationContext(null);
 
         ServiceImpl1 serviceImpl = getManager().getInstance(component);
         String s = serviceImpl.service();
@@ -98,7 +99,7 @@ public class Decorator1Test extends Test
         defineDecorator(LargeTransactionDecorator.class);
         AbstractOwbBean<AccountComponent> component = defineManagedBean(AccountComponent.class);
 
-        ContextFactory.initRequestContext(null);
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
 
         AccountComponent account = getManager().getInstance(component);
 

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/dependent/DependentComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/dependent/DependentComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/dependent/DependentComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/dependent/DependentComponentTest.java Sat Jan  8 01:21:42 2011
@@ -23,7 +23,7 @@ import java.util.List;
 import junit.framework.Assert;
 
 import org.apache.webbeans.component.AbstractOwbBean;
-import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.component.dependent.DependentComponent;
 import org.apache.webbeans.test.component.dependent.DependentOwnerComponent;
@@ -52,7 +52,8 @@ public class DependentComponentTest exte
         defineManagedBean(DependentComponent.class);
         defineManagedBean(DependentOwnerComponent.class);
 
-        ContextFactory.initRequestContext(null);
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
+        webBeansContext.getContextFactory().initRequestContext(null);
 
         List<AbstractOwbBean<?>> comps = getComponents();
 
@@ -64,15 +65,15 @@ public class DependentComponentTest exte
 
         Assert.assertNotNull(dc);
 
-        ContextFactory.destroyRequestContext(null);
+        webBeansContext.getContextFactory().destroyRequestContext(null);
     }
 
     @Test
     public void testDependentCircular()
     {
         clear();
-        
-        ContextFactory.initRequestContext(null);
+
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
 
         AbstractOwbBean<DependentA> componentA = defineManagedBean(DependentA.class);
         AbstractOwbBean<DependentB> componentB = defineManagedBean(DependentB.class);

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/dependent/MultipleDependentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/dependent/MultipleDependentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/dependent/MultipleDependentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/dependent/MultipleDependentTest.java Sat Jan  8 01:21:42 2011
@@ -20,7 +20,7 @@ package org.apache.webbeans.test.unittes
 
 import junit.framework.Assert;
 
-import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.component.dependent.DependentComponent;
 import org.apache.webbeans.test.component.dependent.MultipleDependentComponent;
@@ -45,8 +45,8 @@ public class MultipleDependentTest exten
     public void testMultipleDependent()
     {
         clear();
-        ContextFactory.initRequestContext(null);
-        
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
+
         defineManagedBean(DependentComponent.class);
         defineManagedBean(MultipleDependentComponent.class);
         

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/disposal/DisposalTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/disposal/DisposalTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/disposal/DisposalTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/disposal/DisposalTest.java Sat Jan  8 01:21:42 2011
@@ -20,6 +20,7 @@ package org.apache.webbeans.test.unittes
 
 import java.util.List;
 
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.component.disposal.Disposal1;
@@ -46,8 +47,9 @@ public class DisposalTest extends TestCo
     {
         clear();
 
-        ContextFactory.initRequestContext(null);
-        ContextFactory.initSessionContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
+        contextFactory.initSessionContext(null);
 
         defineManagedBean(Disposal1.class);
 
@@ -55,7 +57,7 @@ public class DisposalTest extends TestCo
         List<Integer> list = (List<Integer>) getManager().getInstanceByName("createBinding1");
         Assert.assertNotNull(list);
         Assert.assertTrue(list.size() == 1);
-        ContextFactory.destroyRequestContext(null);
+        contextFactory.destroyRequestContext(null);
 
         Assert.assertTrue(Disposal1.getDISPOSCALL());
 

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/component/ObserversComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/component/ObserversComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/component/ObserversComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/event/component/ObserversComponentTest.java Sat Jan  8 01:21:42 2011
@@ -26,7 +26,7 @@ import junit.framework.Assert;
 
 import org.apache.webbeans.annotation.AnyLiteral;
 import org.apache.webbeans.component.AbstractOwbBean;
-import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.annotation.binding.Check;
 import org.apache.webbeans.test.annotation.binding.NotAnyLiteral;
@@ -66,7 +66,7 @@ public class ObserversComponentTest exte
         clear();
 
         AbstractOwbBean<ComponentWithObserves1> component = defineManagedBean(ComponentWithObserves1.class);
-        ContextFactory.initRequestContext(null);
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
 
         LoggedInEvent event = new LoggedInEvent("Gurkan");
 
@@ -90,7 +90,7 @@ public class ObserversComponentTest exte
         AbstractOwbBean<ComponentWithObserves1> component = defineManagedBean(ComponentWithObserves1.class);
         AbstractOwbBean<ComponentWithObservable1> componentObservable = defineManagedBean(ComponentWithObservable1.class);
 
-        ContextFactory.initRequestContext(null);
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
 
         ComponentWithObserves1 instance = getManager().getInstance(component);
         ComponentWithObservable1 observable = getManager().getInstance(componentObservable);
@@ -112,7 +112,7 @@ public class ObserversComponentTest exte
         AbstractOwbBean<ComponentWithObserves5> component5 = defineManagedBean(ComponentWithObserves5.class);
         AbstractOwbBean<ComponentWithObserves6> component6 = defineManagedBean(ComponentWithObserves6.class);
 
-        ContextFactory.initRequestContext(null);
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
 
         /*
          * DO NOT CALL getInstance FOR component3! IF_EXISTS NEEDS TO FAIL FOR THAT OBJECT.
@@ -142,7 +142,7 @@ public class ObserversComponentTest exte
         getManager().addBean(WebBeansUtil.getEventBean());
         
         AbstractOwbBean<ComponentWithObserves1> component = defineManagedBean(ComponentWithObserves1.class);
-        ContextFactory.initRequestContext(null);
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
 
         LoggedInEvent event = new LoggedInEvent("Gurkan");
 
@@ -176,7 +176,7 @@ public class ObserversComponentTest exte
         getManager().addBean(WebBeansUtil.getEventBean());
         
         AbstractOwbBean<ComponentWithObserves1> component = defineManagedBean(ComponentWithObserves1.class);
-        ContextFactory.initRequestContext(null);
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
 
         LoggedInEvent event = new LoggedInEvent("Mark");
 
@@ -202,7 +202,7 @@ public class ObserversComponentTest exte
         defineManagedBean(CheckWithMoneyPayment.class);
         defineManagedBean(PaymentProcessorComponent.class);
         AbstractOwbBean<ComponentWithObserves2> component = defineManagedBean(ComponentWithObserves2.class);
-        ContextFactory.initRequestContext(null);
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
 
         LoggedInEvent event = new LoggedInEvent("USER");
 

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/CurrentInjectedComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/CurrentInjectedComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/CurrentInjectedComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/CurrentInjectedComponentTest.java Sat Jan  8 01:21:42 2011
@@ -23,6 +23,7 @@ import java.util.List;
 import junit.framework.Assert;
 
 import org.apache.webbeans.component.AbstractOwbBean;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.component.ContaintsCurrentComponent;
@@ -57,8 +58,9 @@ public class CurrentInjectedComponentTes
         List<AbstractOwbBean<?>> comps = getComponents();
 
         Object session = getSession();
-        ContextFactory.initRequestContext(null);
-        ContextFactory.initSessionContext(session);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
+        contextFactory.initSessionContext(session);
 
         Assert.assertEquals(3, comps.size());
 
@@ -82,8 +84,8 @@ public class CurrentInjectedComponentTes
 
         Assert.assertNotNull(typed2);
 
-        ContextFactory.destroyRequestContext(null);
-        ContextFactory.destroySessionContext(session);
+        contextFactory.destroyRequestContext(null);
+        contextFactory.destroySessionContext(session);
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/DisposalInjectedComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/DisposalInjectedComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/DisposalInjectedComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/DisposalInjectedComponentTest.java Sat Jan  8 01:21:42 2011
@@ -60,8 +60,9 @@ public class DisposalInjectedComponentTe
 
         List<AbstractOwbBean<?>> comps = getComponents();
 
-        ContextFactory.initRequestContext(null);
-        ContextFactory.initApplicationContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
+        contextFactory.initApplicationContext(null);
 
         Assert.assertEquals(2, comps.size());
 
@@ -83,8 +84,8 @@ public class DisposalInjectedComponentTe
 
         Assert.assertNotNull(s);
 
-        ContextFactory.destroyApplicationContext(null);
-        ContextFactory.destroyRequestContext(null);
+        contextFactory.destroyApplicationContext(null);
+        contextFactory.destroyRequestContext(null);
 
     }
 

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedComponentTest.java Sat Jan  8 01:21:42 2011
@@ -23,6 +23,7 @@ import java.util.List;
 import junit.framework.Assert;
 
 import org.apache.webbeans.component.AbstractOwbBean;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.component.service.InjectedComponent;
@@ -53,8 +54,9 @@ public class InjectedComponentTest exten
         defineManagedBean(ServiceImpl1.class);
         List<AbstractOwbBean<?>> comps = getComponents();
 
-        ContextFactory.initRequestContext(null);
-        ContextFactory.initApplicationContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
+        contextFactory.initApplicationContext(null);
 
         Assert.assertEquals(2, comps.size());
 
@@ -62,8 +64,8 @@ public class InjectedComponentTest exten
 
         Assert.assertTrue(object instanceof InjectedComponent);
 
-        ContextFactory.destroyApplicationContext(null);
-        ContextFactory.destroyRequestContext(null);
+        contextFactory.destroyApplicationContext(null);
+        contextFactory.destroyRequestContext(null);
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedComponentWithMemberTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedComponentWithMemberTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedComponentWithMemberTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedComponentWithMemberTest.java Sat Jan  8 01:21:42 2011
@@ -58,7 +58,8 @@ public class InjectedComponentWithMember
         List<AbstractOwbBean<?>> comps = getComponents();
 
         Object session = getSession();
-        ContextFactory.initSessionContext(session);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initSessionContext(session);
 
         Assert.assertEquals(2, comps.size());
 
@@ -72,7 +73,7 @@ public class InjectedComponentWithMember
 
         Assert.assertTrue(bc != null);
 
-        ContextFactory.destroySessionContext(session);
+        contextFactory.destroySessionContext(session);
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedInstanceComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedInstanceComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedInstanceComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedInstanceComponentTest.java Sat Jan  8 01:21:42 2011
@@ -22,7 +22,7 @@ package org.apache.webbeans.test.unittes
 import javax.enterprise.inject.Instance;
 import javax.enterprise.inject.spi.Bean;
 
-import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.component.PaymentProcessorComponent;
 import org.apache.webbeans.test.component.inject.InstanceInjectedComponent;
@@ -48,8 +48,8 @@ public class InjectedInstanceComponentTe
     public void testInstanceInjectedComponent()
     {
         getManager().addBean(WebBeansUtil.getInstanceBean());
-        
-        ContextFactory.initRequestContext(null);
+
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
         Bean<PaymentProcessorComponent> bean =  defineManagedBean(PaymentProcessorComponent.class);
         
         getManager().getInstance(bean);

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/PaymentProcessorComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/PaymentProcessorComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/PaymentProcessorComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/PaymentProcessorComponentTest.java Sat Jan  8 01:21:42 2011
@@ -25,7 +25,7 @@ import javax.enterprise.inject.spi.BeanM
 import junit.framework.Assert;
 
 import org.apache.webbeans.component.AbstractOwbBean;
-import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.component.CheckWithCheckPayment;
 import org.apache.webbeans.test.component.CheckWithMoneyPayment;
@@ -60,7 +60,7 @@ public class PaymentProcessorComponentTe
 
         List<AbstractOwbBean<?>> comps = getComponents();
 
-        ContextFactory.initRequestContext(null);
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
 
         Assert.assertEquals(3, comps.size());
 
@@ -83,7 +83,7 @@ public class PaymentProcessorComponentTe
 
         Assert.assertEquals("MONEY", p.pay());
 
-        ContextFactory.destroyRequestContext(null);
+        WebBeansContext.getInstance().getContextFactory().destroyRequestContext(null);
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/TypedInjectedComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/TypedInjectedComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/TypedInjectedComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/TypedInjectedComponentTest.java Sat Jan  8 01:21:42 2011
@@ -62,7 +62,8 @@ public class TypedInjectedComponentTest 
 
         Object session = getSession();
 
-        ContextFactory.initSessionContext(session);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initSessionContext(session);
 
         Assert.assertEquals(2, comps.size());
 
@@ -83,7 +84,7 @@ public class TypedInjectedComponentTest 
 
         Assert.assertSame(typed2.isValue(), obj2.isValue());
 
-        ContextFactory.destroySessionContext(session);
+        contextFactory.destroySessionContext(session);
     }
 
     @Test
@@ -97,7 +98,8 @@ public class TypedInjectedComponentTest 
 
         Object session = getSession();
 
-        ContextFactory.initSessionContext(session);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initSessionContext(session);
 
         Assert.assertEquals(2, comps.size());
 
@@ -116,7 +118,7 @@ public class TypedInjectedComponentTest 
 
         Assert.assertSame(typed2.isValue(), obj2.isValue());
 
-        ContextFactory.destroySessionContext(session);
+        contextFactory.destroySessionContext(session);
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/UserComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/UserComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/UserComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/UserComponentTest.java Sat Jan  8 01:21:42 2011
@@ -26,7 +26,6 @@ import junit.framework.Assert;
 
 import org.apache.webbeans.component.AbstractOwbBean;
 import org.apache.webbeans.config.WebBeansContext;
-import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.component.ContainUserComponent;
 import org.apache.webbeans.test.component.UserComponent;
@@ -59,8 +58,8 @@ public class UserComponentTest extends T
         List<AbstractOwbBean<?>> comps = getComponents();
 
         Object session = getSession();
-        ContextFactory.initRequestContext(null);
-        ContextFactory.initSessionContext(session);
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
+        WebBeansContext.getInstance().getContextFactory().initSessionContext(session);
 
         Assert.assertEquals(2, comps.size());
 
@@ -79,8 +78,8 @@ public class UserComponentTest extends T
         Assert.assertNotNull(uc.echo());
         Assert.assertEquals(uc.echo(), userComponent.getName() + " " + userComponent.getSurname());
 
-        ContextFactory.destroyRequestContext(null);
-        ContextFactory.destroySessionContext(session);
+        WebBeansContext.getInstance().getContextFactory().destroyRequestContext(null);
+        WebBeansContext.getInstance().getContextFactory().destroySessionContext(session);
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptComponentTest.java Sat Jan  8 01:21:42 2011
@@ -23,6 +23,7 @@ import java.util.List;
 import junit.framework.Assert;
 
 import org.apache.webbeans.component.AbstractOwbBean;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.component.intercept.InterceptedComponent;
@@ -59,7 +60,8 @@ public class EJBInterceptComponentTest e
         clear();
         defineManagedBean(InterceptedComponent.class);
 
-        ContextFactory.initRequestContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
         List<AbstractOwbBean<?>> comps = getComponents();
 
         Object object = getManager().getInstance(comps.get(0));
@@ -71,7 +73,7 @@ public class EJBInterceptComponentTest e
 
         Assert.assertEquals(new Integer(5), s);
 
-        ContextFactory.destroyRequestContext(null);
+        contextFactory.destroyRequestContext(null);
     }
 
     @Test
@@ -80,7 +82,8 @@ public class EJBInterceptComponentTest e
         clear();
         defineManagedBean(MultipleInterceptedComponent.class);
 
-        ContextFactory.initRequestContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
         List<AbstractOwbBean<?>> comps = getComponents();
 
         Object object = getManager().getInstance(comps.get(0));
@@ -96,7 +99,7 @@ public class EJBInterceptComponentTest e
 
         Assert.assertEquals(2, arr.length);
         Assert.assertTrue("key".equals(arr[0]) && "key2".equals(arr[1]) || "key".equals(arr[1]) && "key2".equals(arr[0]));
-        ContextFactory.destroyRequestContext(null);
+        contextFactory.destroyRequestContext(null);
     }
 
     @Test
@@ -105,7 +108,8 @@ public class EJBInterceptComponentTest e
         clear();
         defineManagedBean(InterceptorWithSuperClassInterceptedComponent.class);
 
-        ContextFactory.initRequestContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
         List<AbstractOwbBean<?>> comps = getComponents();
 
         Object object = getManager().getInstance(comps.get(0));
@@ -121,7 +125,7 @@ public class EJBInterceptComponentTest e
 
         Assert.assertEquals(1, arr.length);
         Assert.assertTrue("key0".equals(arr[0]));
-        ContextFactory.destroyRequestContext(null);
+        contextFactory.destroyRequestContext(null);
     }
 
     @Test
@@ -130,7 +134,8 @@ public class EJBInterceptComponentTest e
         clear();
         defineManagedBean(MultipleListOfInterceptedComponent.class);
 
-        ContextFactory.initRequestContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
         List<AbstractOwbBean<?>> comps = getComponents();
 
         Object object = getManager().getInstance(comps.get(0));
@@ -144,7 +149,7 @@ public class EJBInterceptComponentTest e
 
         Assert.assertEquals("ok", (String) obj);
 
-        ContextFactory.destroyRequestContext(null);
+        contextFactory.destroyRequestContext(null);
     }
 
     @Test
@@ -153,7 +158,8 @@ public class EJBInterceptComponentTest e
         clear();
         defineManagedBean(MultipleListOfInterceptedWithExcludeClassComponent.class);
 
-        ContextFactory.initRequestContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
         List<AbstractOwbBean<?>> comps = getComponents();
 
         Object object = getManager().getInstance(comps.get(0));
@@ -167,7 +173,7 @@ public class EJBInterceptComponentTest e
 
         Assert.assertEquals("value2", (String) obj);
 
-        ContextFactory.destroyRequestContext(null);
+        contextFactory.destroyRequestContext(null);
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructComponentTest.java Sat Jan  8 01:21:42 2011
@@ -26,6 +26,7 @@ import junit.framework.Assert;
 
 import org.apache.webbeans.component.AbstractOwbBean;
 import org.apache.webbeans.component.ManagedBean;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.intercept.InterceptorData;
 import org.apache.webbeans.test.TestContext;
@@ -59,7 +60,8 @@ public class PostConstructComponentTest 
         defineManagedBean(PostConstructComponent.class);
         List<AbstractOwbBean<?>> comps = getComponents();
 
-        ContextFactory.initRequestContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
 
         Assert.assertEquals(2, comps.size());
 
@@ -81,7 +83,7 @@ public class PostConstructComponentTest 
         Assert.assertNotNull(pcc.getP());
         Assert.assertSame(object.getValue(), chk.getValue());
 
-        ContextFactory.destroyRequestContext(null);
+        contextFactory.destroyRequestContext(null);
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructDoubleInterceptorComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructDoubleInterceptorComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructDoubleInterceptorComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructDoubleInterceptorComponentTest.java Sat Jan  8 01:21:42 2011
@@ -24,6 +24,7 @@ import junit.framework.Assert;
 
 import org.apache.webbeans.component.AbstractOwbBean;
 import org.apache.webbeans.component.ManagedBean;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.intercept.InterceptorData;
 import org.apache.webbeans.test.TestContext;
@@ -56,7 +57,8 @@ public class PostConstructDoubleIntercep
         defineManagedBean(PostConstructDoubleInterceptorComponent.class);
         List<AbstractOwbBean<?>> comps = getComponents();
 
-        ContextFactory.initRequestContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
 
         Assert.assertEquals(2, comps.size());
 
@@ -79,7 +81,7 @@ public class PostConstructDoubleIntercep
         Assert.assertNotNull(PostConstructDoubleInterceptorComponent.getValue());
         Assert.assertEquals("value1", PostConstructDoubleInterceptorComponent.getValue());
 
-        ContextFactory.destroyRequestContext(null);
+        contextFactory.destroyRequestContext(null);
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructInterceptorComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructInterceptorComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructInterceptorComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructInterceptorComponentTest.java Sat Jan  8 01:21:42 2011
@@ -24,6 +24,7 @@ import junit.framework.Assert;
 
 import org.apache.webbeans.component.AbstractOwbBean;
 import org.apache.webbeans.component.ManagedBean;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.intercept.InterceptorData;
 import org.apache.webbeans.test.TestContext;
@@ -55,7 +56,8 @@ public class PostConstructInterceptorCom
         defineManagedBean(PostConstructInterceptorComponent.class);
         List<AbstractOwbBean<?>> comps = getComponents();
 
-        ContextFactory.initRequestContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
 
         Assert.assertEquals(2, comps.size());
 
@@ -75,7 +77,7 @@ public class PostConstructInterceptorCom
 
         Assert.assertEquals(2, stack.size());
 
-        ContextFactory.destroyRequestContext(null);
+        contextFactory.destroyRequestContext(null);
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PreDestroyComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PreDestroyComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PreDestroyComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PreDestroyComponentTest.java Sat Jan  8 01:21:42 2011
@@ -61,7 +61,8 @@ public class PreDestroyComponentTest ext
         defineManagedBean(PreDestroyComponent.class);
         List<AbstractOwbBean<?>> comps = getComponents();
 
-        ContextFactory.initRequestContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
 
         Assert.assertEquals(2, comps.size());
 
@@ -87,7 +88,7 @@ public class PreDestroyComponentTest ext
 
         Assert.assertFalse(PreDestroyComponent.isDestroyed());
 
-        ContextFactory.destroyRequestContext(null); 
+        contextFactory.destroyRequestContext(null);
 
         Assert.assertTrue(PreDestroyComponent.isDestroyed());
     }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/CallingBusinessInConstructorTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/CallingBusinessInConstructorTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/CallingBusinessInConstructorTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/CallingBusinessInConstructorTest.java Sat Jan  8 01:21:42 2011
@@ -23,6 +23,7 @@ import javax.enterprise.inject.spi.Bean;
 
 import junit.framework.Assert;
 
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.context.RequestContext;
 import org.apache.webbeans.test.TestContext;
@@ -56,8 +57,9 @@ public class CallingBusinessInConstructo
     @Test
     public void testCallBusinessInConstructor()
     {
-        ContextFactory.initRequestContext(null);
-        
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
+
         clear();      
         
         SecureInterceptor.CALL = false;
@@ -70,14 +72,14 @@ public class CallingBusinessInConstructo
         Assert.assertNotNull(instance);
         
         Assert.assertTrue(SecureInterceptor.CALL);
-        
-        ContextFactory.destroyRequestContext(null);
-        
+
+        contextFactory.destroyRequestContext(null);
+
         SecureInterceptor.CALL = false;
-        
-        ContextFactory.initRequestContext(null);
-        
-        RequestContext ctx = (RequestContext) ContextFactory.getStandardContext(RequestScoped.class);
+
+        contextFactory.initRequestContext(null);
+
+        RequestContext ctx = (RequestContext) contextFactory.getStandardContext(RequestScoped.class);
                 
         Assert.assertNull(ctx.get(bean));
                 
@@ -86,9 +88,9 @@ public class CallingBusinessInConstructo
         Assert.assertNotNull(instance);
         
         Assert.assertTrue(SecureInterceptor.CALL);
-        
-        ContextFactory.destroyRequestContext(null);
-        
+
+        contextFactory.destroyRequestContext(null);
+
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureAndTransactionalInterceptorTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureAndTransactionalInterceptorTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureAndTransactionalInterceptorTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureAndTransactionalInterceptorTest.java Sat Jan  8 01:21:42 2011
@@ -22,6 +22,7 @@ import javax.enterprise.inject.spi.Bean;
 
 import junit.framework.Assert;
 
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.component.intercept.webbeans.SecureAndTransactionalComponent;
@@ -46,7 +47,8 @@ public class SecureAndTransactionalInter
     @Test
     public void testSecureAndTransactionalInterceptor()
     {
-        ContextFactory.initSessionContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initSessionContext(null);
         defineInterceptor(SecureAndTransactionalInterceptor.class);
         
         Bean<SecureAndTransactionalComponent> bean = defineManagedBean(SecureAndTransactionalComponent.class);
@@ -57,8 +59,8 @@ public class SecureAndTransactionalInter
         payment.pay();
         
         Assert.assertTrue(SecureAndTransactionalComponent.getCALL());
-        
-                
-        ContextFactory.destroySessionContext(null);
+
+
+        contextFactory.destroySessionContext(null);
     }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.java Sat Jan  8 01:21:42 2011
@@ -21,7 +21,7 @@ package org.apache.webbeans.test.unittes
 import junit.framework.Assert;
 
 import org.apache.webbeans.component.AbstractOwbBean;
-import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.component.intercept.webbeans.SecureComponent;
 import org.apache.webbeans.test.component.intercept.webbeans.SecureInterceptor;
@@ -48,7 +48,7 @@ public class SecureInterceptorComponentT
         defineInterceptor(SecureInterceptor.class);
         AbstractOwbBean<SecureComponent> component = defineManagedBean(SecureComponent.class);
 
-        ContextFactory.initRequestContext(null);
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
 
         SecureComponent secureComponent = getManager().getInstance(component);
 

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/ShoppingCardInterceptorTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/ShoppingCardInterceptorTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/ShoppingCardInterceptorTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/ShoppingCardInterceptorTest.java Sat Jan  8 01:21:42 2011
@@ -23,7 +23,6 @@ import javax.enterprise.inject.spi.Bean;
 import junit.framework.Assert;
 
 import org.apache.webbeans.config.WebBeansContext;
-import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.component.intercept.webbeans.ShoppingCard;
 import org.apache.webbeans.test.component.intercept.webbeans.TransactionalInterceptor;
@@ -50,10 +49,11 @@ public class ShoppingCardInterceptorTest
     @Test
     public void testTransactionalInterceptor()
     {
-        ContextFactory.initSessionContext(null);
-        
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
+        webBeansContext.getContextFactory().initSessionContext(null);
+
         // Interceptors must explicitly get enabled via XML. We fake this:
-        WebBeansContext.getInstance().getInterceptorsManager().addNewInterceptor(TransactionalInterceptor.class);
+        webBeansContext.getInterceptorsManager().addNewInterceptor(TransactionalInterceptor.class);
         
         defineInterceptor(TransactionalInterceptor.class);
         
@@ -67,7 +67,7 @@ public class ShoppingCardInterceptorTest
         card.placeOrder2();
         
         Assert.assertFalse(ShoppingCard.getCALLED());
-                
-        ContextFactory.destroySessionContext(null);
+
+        webBeansContext.getContextFactory().destroySessionContext(null);
     }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/WebBeansInterceptComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/WebBeansInterceptComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/WebBeansInterceptComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/WebBeansInterceptComponentTest.java Sat Jan  8 01:21:42 2011
@@ -23,6 +23,7 @@ import java.util.List;
 import junit.framework.Assert;
 
 import org.apache.webbeans.component.AbstractOwbBean;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.test.TestContext;
@@ -79,7 +80,8 @@ public class WebBeansInterceptComponentT
         defineInterceptor(WebBeansInterceptor.class);
         defineManagedBean(WInterceptorComponent.class);
 
-        ContextFactory.initRequestContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
         List<AbstractOwbBean<?>> comps = getComponents();
 
         Object object = getManager().getInstance(comps.get(0));
@@ -91,7 +93,7 @@ public class WebBeansInterceptComponentT
 
         Assert.assertEquals(5, s);
 
-        ContextFactory.destroyRequestContext(null);
+        contextFactory.destroyRequestContext(null);
     }
 
     @Test
@@ -103,7 +105,8 @@ public class WebBeansInterceptComponentT
         defineInterceptor(WebBeanswithMetaInterceptor.class);
         defineManagedBean(WMetaInterceptorComponent.class);
 
-        ContextFactory.initRequestContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
         List<AbstractOwbBean<?>> comps = getComponents();
 
         Object object = getManager().getInstance(comps.get(0));
@@ -119,7 +122,7 @@ public class WebBeansInterceptComponentT
 
         Assert.assertEquals(10, s);
 
-        ContextFactory.destroyRequestContext(null);
+        contextFactory.destroyRequestContext(null);
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/library/LibraryComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/library/LibraryComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/library/LibraryComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/library/LibraryComponentTest.java Sat Jan  8 01:21:42 2011
@@ -23,6 +23,7 @@ import java.util.List;
 import junit.framework.Assert;
 
 import org.apache.webbeans.component.AbstractOwbBean;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.component.library.Book;
@@ -52,7 +53,8 @@ public class LibraryComponentTest extend
         defineManagedBean(BookShop.class);
         List<AbstractOwbBean<?>> comps = getComponents();
 
-        ContextFactory.initRequestContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
 
         Assert.assertEquals(1, comps.size());
 
@@ -65,7 +67,7 @@ public class LibraryComponentTest extend
         Shop<Book> shop = (Shop<Book>) instance;
         shop.shop();
 
-        ContextFactory.destroyRequestContext(null);
+        contextFactory.destroyRequestContext(null);
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/newcomp/NewComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/newcomp/NewComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/newcomp/NewComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/newcomp/NewComponentTest.java Sat Jan  8 01:21:42 2011
@@ -23,6 +23,7 @@ import java.util.List;
 import junit.framework.Assert;
 
 import org.apache.webbeans.component.AbstractOwbBean;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.component.CheckWithCheckPayment;
@@ -57,7 +58,8 @@ public class NewComponentTest extends Te
         defineManagedBean(DependentOwnerComponent.class);
         defineManagedBean(NewComponent.class);
 
-        ContextFactory.initRequestContext(null);
+        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
+        contextFactory.initRequestContext(null);
 
         List<AbstractOwbBean<?>> comps = getComponents();
 
@@ -69,7 +71,7 @@ public class NewComponentTest extends Te
 
         Assert.assertNotNull(own);
 
-        ContextFactory.destroyRequestContext(null);
+        contextFactory.destroyRequestContext(null);
     }
 
     @Test
@@ -79,7 +81,7 @@ public class NewComponentTest extends Te
         defineManagedBean(CheckWithCheckPayment.class);
         defineManagedBean(ProducerNewComponent.class);
 
-        ContextFactory.initRequestContext(null);
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
         Assert.assertEquals(5, getDeployedComponents());
 
         IPayment payment = (IPayment) getManager().getInstanceByName("paymentProducer");

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/ProducerFieldComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/ProducerFieldComponentTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/ProducerFieldComponentTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/ProducerFieldComponentTest.java Sat Jan  8 01:21:42 2011
@@ -20,7 +20,7 @@ package org.apache.webbeans.test.unittes
 
 import javax.enterprise.inject.spi.Bean;
 
-import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.test.TestContext;
 import org.apache.webbeans.test.component.CheckWithCheckPayment;
 import org.apache.webbeans.test.component.CheckWithMoneyPayment;
@@ -50,8 +50,8 @@ public class ProducerFieldComponentTest 
     @Test
     public void testInjectedProducerField()
     {
-        ContextFactory.initRequestContext(null);
-        
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
+
         defineManagedBean(CheckWithCheckPayment.class);
         defineManagedBean(CheckWithMoneyPayment.class);
         
@@ -78,7 +78,7 @@ public class ProducerFieldComponentTest 
     @Test
     public void testInjectedProducerFieldIncorrectType()
     {
-        ContextFactory.initRequestContext(null);
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
 
         defineManagedBean(ProducerFieldDefinitionParameterized.class);
         Bean<ProducerFieldInjectedWrongType> beanInjected = defineManagedBean(ProducerFieldInjectedWrongType.class);
@@ -102,8 +102,8 @@ public class ProducerFieldComponentTest 
     @Test
     public void testProducerFieldTypeVariable()
     {
-        ContextFactory.initRequestContext(null);
-        
+        WebBeansContext.getInstance().getContextFactory().initRequestContext(null);
+
         Exception expected = null;
         try
         {

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/portable/events/ExtensionTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/portable/events/ExtensionTest.java?rev=1056587&r1=1056586&r2=1056587&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/portable/events/ExtensionTest.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/portable/events/ExtensionTest.java Sat Jan  8 01:21:42 2011
@@ -27,7 +27,7 @@ import javax.enterprise.inject.spi.Bean;
 import junit.framework.Assert;
 
 import org.apache.webbeans.annotation.DefaultLiteral;
-import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.portable.events.discovery.BeforeShutdownImpl;
 import org.apache.webbeans.test.component.library.BookShop;
@@ -58,8 +58,8 @@ public class ExtensionTest extends Abstr
         addExtension(new MyExtension());
         
         startContainer(classes);
-        
-        ContextFactory.initApplicationContext(null);
+
+        getWebBeansContext().getContextFactory().initApplicationContext(null);
 
         Bean<MyExtension> extension = (Bean<MyExtension>) getBeanManager().getBeans(MyExtension.class, new DefaultLiteral()).iterator().next();
         
@@ -79,8 +79,8 @@ public class ExtensionTest extends Abstr
         //Fire shut down
         getBeanManager().fireEvent(new BeforeShutdownImpl(), new Annotation[0]);
 
-        ContextFactory.destroyApplicationContext(null);
-        
+        getWebBeansContext().getContextFactory().destroyApplicationContext(null);
+
         Assert.assertNotNull(MyExtension.beforeShutdownEvent);
     }
 }



Mime
View raw message