Author: pete.muir(a)jboss.org
Date: 2010-02-20 16:48:43 -0500 (Sat, 20 Feb 2010)
New Revision: 5906
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/LogManager.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletContextListenerImpl.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletListenerTest.java
core/trunk/tests/src/test/resources/org/jboss/weld/tests/nonContextual/
core/trunk/tests/src/test/resources/org/jboss/weld/tests/nonContextual/web.xml
Log:
WELD-445
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/LogManager.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/LogManager.java
(rev 0)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/LogManager.java 2010-02-20
21:48:43 UTC (rev 5906)
@@ -0,0 +1,17 @@
+package org.jboss.weld.tests.nonContextual;
+
+import java.util.logging.Logger;
+
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+public class LogManager
+{
+
+ @Produces
+ public Logger createLogger(InjectionPoint injectionPoint)
+ {
+ return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
+ }
+
+}
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/LogManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletContextListenerImpl.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletContextListenerImpl.java
(rev 0)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletContextListenerImpl.java 2010-02-20
21:48:43 UTC (rev 5906)
@@ -0,0 +1,27 @@
+package org.jboss.weld.tests.nonContextual;
+
+import java.util.logging.Logger;
+
+import javax.inject.Inject;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+public class ServletContextListenerImpl implements ServletContextListener
+{
+
+ public static boolean ok;
+
+ @Inject Logger log;
+
+ public void contextDestroyed(ServletContextEvent sce)
+ {
+
+ }
+
+ public void contextInitialized(ServletContextEvent sce)
+ {
+ log.finer("hello!");
+ ok = true;
+ }
+
+}
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletContextListenerImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletListenerTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletListenerTest.java
(rev 0)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletListenerTest.java 2010-02-20
21:48:43 UTC (rev 5906)
@@ -0,0 +1,21 @@
+package org.jboss.weld.tests.nonContextual;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.war.WebXml;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+@Artifact
+@IntegrationTest
+(a)WebXml("web.xml")
+public class ServletListenerTest extends AbstractWeldTest
+{
+
+ @Test(description="WELD-445")
+ public void test()
+ {
+ assert ServletContextListenerImpl.ok;
+ }
+
+}
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletListenerTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/resources/org/jboss/weld/tests/nonContextual/web.xml
===================================================================
--- core/trunk/tests/src/test/resources/org/jboss/weld/tests/nonContextual/web.xml
(rev 0)
+++
core/trunk/tests/src/test/resources/org/jboss/weld/tests/nonContextual/web.xml 2010-02-20
21:48:43 UTC (rev 5906)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.5"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <display-name>JBoss Test Harness</display-name>
+
+ <listener>
+
<listener-class>org.jboss.testharness.impl.runner.servlet.HarnessServletListener</listener-class>
+ </listener>
+
+ <listener>
+
<listener-class>org.jboss.weld.tests.nonContextual.ServletContextListenerImpl</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>JBoss Test Harness Test Runner</servlet-name>
+
<servlet-class>org.jboss.testharness.impl.runner.servlet.ServletTestRunner</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>JBoss Test Harness Test Runner</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on:
core/trunk/tests/src/test/resources/org/jboss/weld/tests/nonContextual/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain