[webbeans-commits] Webbeans SVN: r3601 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: context/conversation/client and 4 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Wed Aug 26 15:49:44 EDT 2009
Author: pete.muir at jboss.org
Date: 2009-08-26 15:49:43 -0400 (Wed, 26 Aug 2009)
New Revision: 3601
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/IntrospectApplication.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ServiceMethodServlet.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/TestFilter.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ConversationStatusServlet.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/IntrospectRequestScope.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ServiceMethodServlet.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/TestFilter.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/IntrospectSession.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/InvalidateSession.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/ServiceMethodServlet.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/TestFilter.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/BeanDiscoveryObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/InjectionIntoNonContextualComponentTest.java
Log:
Enable servlet and JSF injection tests, switch to using Servlet injection
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/IntrospectApplication.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/IntrospectApplication.java 2009-08-26 18:51:00 UTC (rev 3600)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/IntrospectApplication.java 2009-08-26 19:49:43 UTC (rev 3601)
@@ -4,9 +4,6 @@
import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -26,25 +23,4 @@
SimpleApplicationBean aBean = org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(jsr299Manager,SimpleApplicationBean.class);
resp.getWriter().print(aBean.getId());
}
-
- @Override
- public void init() throws ServletException
- {
- //TODO Remove init code once injection works in servlet container
- try
- {
- InitialContext ic = new InitialContext();
- jsr299Manager = (BeanManager) ic.lookup("java:app/BeanManager");
- }
- catch (NamingException e)
- {
- throw new ServletException("Error looking up manager", e);
- }
- }
-
- @Override
- public void init(ServletConfig config) throws ServletException
- {
- init();
- }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ServiceMethodServlet.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ServiceMethodServlet.java 2009-08-26 18:51:00 UTC (rev 3600)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ServiceMethodServlet.java 2009-08-26 19:49:43 UTC (rev 3601)
@@ -22,9 +22,6 @@
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -63,25 +60,4 @@
resp.setContentType("text/text");
resp.getWriter().println("It worked!");
}
-
- @Override
- public void init() throws ServletException
- {
- //TODO Remove init code once injection works in servlet container
- try
- {
- InitialContext ic = new InitialContext();
- jsr299Manager = (BeanManager) ic.lookup("java:app/BeanManager");
- }
- catch (NamingException e)
- {
- throw new ServletException("Error looking up manager", e);
- }
- }
-
- @Override
- public void init(ServletConfig config) throws ServletException
- {
- init();
- }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/TestFilter.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/TestFilter.java 2009-08-26 18:51:00 UTC (rev 3600)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/TestFilter.java 2009-08-26 19:49:43 UTC (rev 3601)
@@ -5,7 +5,6 @@
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.InitialContext;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
@@ -37,19 +36,7 @@
public void init(FilterConfig filterConfig) throws ServletException
{
- //TODO Remove init code once injection works in servlet container
- try
- {
- if (jsr299Manager == null)
- {
- InitialContext ic = new InitialContext();
- jsr299Manager = (BeanManager) ic.lookup("java:app/BeanManager");
- }
- }
- catch (Exception e)
- {
- throw new ServletException("Error looking up manager", e);
- }
+
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ConversationStatusServlet.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ConversationStatusServlet.java 2009-08-26 18:51:00 UTC (rev 3600)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ConversationStatusServlet.java 2009-08-26 19:49:43 UTC (rev 3601)
@@ -6,8 +6,6 @@
import javax.enterprise.context.Conversation;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -17,11 +15,10 @@
public class ConversationStatusServlet extends HttpServlet
{
- /**
- *
- */
+
private static final long serialVersionUID = 2984756941080790899L;
- at Current
+
+ @Current
private BeanManager beanManager;
@Override
@@ -58,21 +55,6 @@
}
}
- @Override
- public void init() throws ServletException
- {
- //TODO Remove init code once injection works in servlet container
- try
- {
- InitialContext ic = new InitialContext();
- beanManager = (BeanManager) ic.lookup("java:app/BeanManager");
- }
- catch (NamingException e)
- {
- throw new ServletException("Error looking up manager", e);
- }
- }
-
private void serializeToResponse(Object object, HttpServletResponse resp) throws IOException
{
ObjectOutputStream oos = new ObjectOutputStream(resp.getOutputStream());
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/IntrospectRequestScope.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/IntrospectRequestScope.java 2009-08-26 18:51:00 UTC (rev 3600)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/IntrospectRequestScope.java 2009-08-26 19:49:43 UTC (rev 3601)
@@ -4,9 +4,6 @@
import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -27,24 +24,4 @@
resp.getWriter().print(aBean.getId());
}
- @Override
- public void init() throws ServletException
- {
- //TODO Remove init code once injection works in servlet container
- try
- {
- InitialContext ic = new InitialContext();
- jsr299Manager = (BeanManager) ic.lookup("java:app/BeanManager");
- }
- catch (NamingException e)
- {
- throw new ServletException("Error looking up manager", e);
- }
- }
-
- @Override
- public void init(ServletConfig config) throws ServletException
- {
- init();
- }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ServiceMethodServlet.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ServiceMethodServlet.java 2009-08-26 18:51:00 UTC (rev 3600)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ServiceMethodServlet.java 2009-08-26 19:49:43 UTC (rev 3601)
@@ -22,9 +22,6 @@
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -64,24 +61,4 @@
resp.getWriter().println("It worked!");
}
- @Override
- public void init() throws ServletException
- {
- //TODO Remove init code once injection works in servlet container
- try
- {
- InitialContext ic = new InitialContext();
- jsr299Manager = (BeanManager) ic.lookup("java:app/BeanManager");
- }
- catch (NamingException e)
- {
- throw new ServletException("Error looking up manager", e);
- }
- }
-
- @Override
- public void init(ServletConfig config) throws ServletException
- {
- init();
- }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/TestFilter.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/TestFilter.java 2009-08-26 18:51:00 UTC (rev 3600)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/TestFilter.java 2009-08-26 19:49:43 UTC (rev 3601)
@@ -5,7 +5,6 @@
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.InitialContext;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
@@ -37,19 +36,7 @@
public void init(FilterConfig filterConfig) throws ServletException
{
- //TODO Remove init code once injection works in servlet container
- try
- {
- if (jsr299Manager == null)
- {
- InitialContext ic = new InitialContext();
- jsr299Manager = (BeanManager) ic.lookup("java:app/BeanManager");
- }
- }
- catch (Exception e)
- {
- throw new ServletException("Error looking up manager", e);
- }
+
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/IntrospectSession.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/IntrospectSession.java 2009-08-26 18:51:00 UTC (rev 3600)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/IntrospectSession.java 2009-08-26 19:49:43 UTC (rev 3601)
@@ -21,9 +21,6 @@
import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -50,24 +47,4 @@
resp.getWriter().print(aBean.hashCode());
}
- @Override
- public void init() throws ServletException
- {
- //TODO Remove init code once injection works in servlet container
- try
- {
- InitialContext ic = new InitialContext();
- jsr299Manager = (BeanManager) ic.lookup("java:app/BeanManager");
- }
- catch (NamingException e)
- {
- throw new ServletException("Error looking up manager", e);
- }
- }
-
- @Override
- public void init(ServletConfig config) throws ServletException
- {
- init();
- }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/InvalidateSession.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/InvalidateSession.java 2009-08-26 18:51:00 UTC (rev 3600)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/InvalidateSession.java 2009-08-26 19:49:43 UTC (rev 3601)
@@ -4,9 +4,6 @@
import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -41,25 +38,4 @@
req.getSession().invalidate();
}
}
-
- @Override
- public void init() throws ServletException
- {
- //TODO Remove init code once injection works in servlet container
- try
- {
- InitialContext ic = new InitialContext();
- jsr299Manager = (BeanManager) ic.lookup("java:app/BeanManager");
- }
- catch (NamingException e)
- {
- throw new ServletException("Error looking up manager", e);
- }
- }
-
- @Override
- public void init(ServletConfig config) throws ServletException
- {
- init();
- }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/ServiceMethodServlet.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/ServiceMethodServlet.java 2009-08-26 18:51:00 UTC (rev 3600)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/ServiceMethodServlet.java 2009-08-26 19:49:43 UTC (rev 3601)
@@ -22,9 +22,6 @@
import javax.enterprise.context.SessionScoped;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -64,24 +61,4 @@
resp.getWriter().println("It worked!");
}
- @Override
- public void init() throws ServletException
- {
- //TODO Remove init code once injection works in servlet container
- try
- {
- InitialContext ic = new InitialContext();
- jsr299Manager = (BeanManager) ic.lookup("java:app/BeanManager");
- }
- catch (NamingException e)
- {
- throw new ServletException("Error looking up manager", e);
- }
- }
-
- @Override
- public void init(ServletConfig config) throws ServletException
- {
- init();
- }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/TestFilter.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/TestFilter.java 2009-08-26 18:51:00 UTC (rev 3600)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/TestFilter.java 2009-08-26 19:49:43 UTC (rev 3601)
@@ -5,7 +5,6 @@
import javax.enterprise.context.SessionScoped;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.InitialContext;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
@@ -37,19 +36,6 @@
public void init(FilterConfig filterConfig) throws ServletException
{
- //TODO Remove init code once injection works in servlet container
- try
- {
- if (jsr299Manager == null)
- {
- InitialContext ic = new InitialContext();
- jsr299Manager = (BeanManager) ic.lookup("java:app/BeanManager");
- }
- }
- catch (Exception e)
- {
- throw new ServletException("Error looking up manager", e);
- }
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/BeanDiscoveryObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/BeanDiscoveryObserver.java 2009-08-26 18:51:00 UTC (rev 3600)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/BeanDiscoveryObserver.java 2009-08-26 19:49:43 UTC (rev 3601)
@@ -2,8 +2,9 @@
import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.Extension;
-class BeanDiscoveryObserver
+public class BeanDiscoveryObserver implements Extension
{
private static int invocationCount = 0;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/InjectionIntoNonContextualComponentTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/InjectionIntoNonContextualComponentTest.java 2009-08-26 18:51:00 UTC (rev 3600)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/InjectionIntoNonContextualComponentTest.java 2009-08-26 19:49:43 UTC (rev 3601)
@@ -41,11 +41,10 @@
@SpecVersion(spec="cdi", version="1.0.20090625")
public class InjectionIntoNonContextualComponentTest extends AbstractJSR299Test
{
- @Test(groups = "jboss-as-broken")
+ @Test
@SpecAssertions( {
@SpecAssertion(section = "5.6", id = "e"),
@SpecAssertion(section = "5.6.4", id = "a") })
- //JBAS-7046
public void testInjectionIntoServlet() throws Exception
{
WebClient webClient = new WebClient();
@@ -53,11 +52,10 @@
webClient.getPage(getContextPath() + "Test/Servlet");
}
- @Test(groups = "jboss-as-broken")
+ @Test
@SpecAssertions( {
@SpecAssertion(section = "5.6", id = "e"),
@SpecAssertion(section = "5.6.4", id = "a") })
- //JBAS-7046
public void testInjectionIntoFilter() throws Exception
{
WebClient webClient = new WebClient();
@@ -65,9 +63,8 @@
webClient.getPage(getContextPath() + "TestFilter");
}
- @Test(groups = "jboss-as-broken")
+ @Test
@SpecAssertion(section = "5.6", id = "e")
- //JBAS-7046
public void testInjectionIntoServletListener() throws Exception
{
WebClient webClient = new WebClient();
@@ -75,9 +72,8 @@
webClient.getPage(getContextPath() + "Test/ServletListener");
}
- @Test(groups = "jboss-as-broken")
+ @Test
@SpecAssertion(section = "5.6", id = "e")
- //JBAS-7046
public void testInjectionIntoTagHandler() throws Exception
{
WebClient webClient = new WebClient();
@@ -87,9 +83,8 @@
assert response.getContentAsString().contains(TestTagHandler.SUCCESS);
}
- @Test(groups = "jboss-as-broken")
+ @Test
@SpecAssertion(section = "5.6", id = "e")
- //JBAS-7046
public void testInjectionIntoTagLibraryListener() throws Exception
{
WebClient webClient = new WebClient();
@@ -97,9 +92,8 @@
webClient.getPage(getContextPath() + "Test/TagLibraryListener");
}
- @Test(groups = "jboss-as-broken")
+ @Test
@SpecAssertion(section = "5.6", id = "d")
- //JBAS-7046
public void testInjectionIntoJSFManagedBean() throws Exception
{
WebClient webclient = new WebClient();
More information about the weld-commits
mailing list