You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2012/07/11 11:12:26 UTC
svn commit: r1360082 -
/openwebbeans/trunk/webbeans-test/cditest-owb/src/main/java/org/apache/webbeans/cditest/owb/CdiTestOpenWebBeansContainer.java
Author: struberg
Date: Wed Jul 11 09:12:26 2012
New Revision: 1360082
URL: http://svn.apache.org/viewvc?rev=1360082&view=rev
Log:
OWB-675 pass ServletContextEvent instead of ServletContext
Modified:
openwebbeans/trunk/webbeans-test/cditest-owb/src/main/java/org/apache/webbeans/cditest/owb/CdiTestOpenWebBeansContainer.java
Modified: openwebbeans/trunk/webbeans-test/cditest-owb/src/main/java/org/apache/webbeans/cditest/owb/CdiTestOpenWebBeansContainer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-test/cditest-owb/src/main/java/org/apache/webbeans/cditest/owb/CdiTestOpenWebBeansContainer.java?rev=1360082&r1=1360081&r2=1360082&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-test/cditest-owb/src/main/java/org/apache/webbeans/cditest/owb/CdiTestOpenWebBeansContainer.java (original)
+++ openwebbeans/trunk/webbeans-test/cditest-owb/src/main/java/org/apache/webbeans/cditest/owb/CdiTestOpenWebBeansContainer.java Wed Jul 11 09:12:26 2012
@@ -30,6 +30,7 @@ import javax.enterprise.inject.Resolutio
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Singleton;
+import javax.servlet.ServletContextEvent;
import org.apache.webbeans.cditest.CdiTestContainer;
import org.apache.webbeans.config.WebBeansContext;
@@ -55,7 +56,7 @@ public class CdiTestOpenWebBeansContaine
servletContext = new MockServletContext();
session = new MockHttpSession();
lifecycle = WebBeansContext.getInstance().getService(ContainerLifecycle.class);
- lifecycle.startApplication(servletContext);
+ lifecycle.startApplication(new ServletContextEvent(servletContext));
}
public void shutdownContainer() throws Exception
@@ -71,8 +72,10 @@ public class CdiTestOpenWebBeansContaine
WebBeansContext webBeansContext = WebBeansContext.getInstance();
ContextFactory contextFactory = webBeansContext.getContextFactory();
- contextFactory.initSingletonContext(servletContext);
- contextFactory.initApplicationContext(servletContext);
+ ServletContextEvent servletContextEvent = new ServletContextEvent(servletContext);
+
+ contextFactory.initSingletonContext(servletContextEvent);
+ contextFactory.initApplicationContext(servletContextEvent);
contextFactory.initSessionContext(session);
contextFactory.initConversationContext(null);
contextFactory.initRequestContext(null);
@@ -83,7 +86,7 @@ public class CdiTestOpenWebBeansContaine
WebBeansContext webBeansContext = WebBeansContext.getInstance();
ContextFactory contextFactory = webBeansContext.getContextFactory();
- contextFactory.initApplicationContext(servletContext);
+ contextFactory.initApplicationContext(new ServletContextEvent(servletContext));
}
public void startConversationScope() throws Exception
@@ -128,7 +131,7 @@ public class CdiTestOpenWebBeansContaine
Context context = contextFactory.getStandardContext(ContextTypes.SINGLETON);
if(context != null && context.isActive())
{
- contextFactory.destroySingletonContext(servletContext);
+ contextFactory.destroySingletonContext(new ServletContextEvent(servletContext));
}
else
{
@@ -150,7 +153,7 @@ public class CdiTestOpenWebBeansContaine
Context context = contextFactory.getStandardContext(ContextTypes.APPLICATION);
if(context != null && context.isActive())
{
- contextFactory.destroyApplicationContext(servletContext);
+ contextFactory.destroyApplicationContext(new ServletContextEvent(servletContext));
}
else
{