Author: pete.muir(a)jboss.org
Date: 2009-10-29 19:52:46 -0400 (Thu, 29 Oct 2009)
New Revision: 4432
Added:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/ExtensionTest.java
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/Foo.java
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/SimpleExtension.java
core/trunk/tests/src/test/resources/org/jboss/weld/test/unit/extensions/
core/trunk/tests/src/test/resources/org/jboss/weld/test/unit/extensions/javax.enterprise.inject.spi.Extension
Modified:
core/trunk/tests/unit-tests.xml
Log:
tests for WELD-234
Added:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/ExtensionTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/ExtensionTest.java
(rev 0)
+++
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/ExtensionTest.java 2009-10-29
23:52:46 UTC (rev 4432)
@@ -0,0 +1,22 @@
+package org.jboss.weld.test.unit.extensions;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.jsr299.Extension;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+@Artifact
+@IntegrationTest
+(a)Extension("javax.enterprise.inject.spi.Extension")
+public class ExtensionTest extends AbstractWeldTest
+{
+
+ @Test(description="WELD-234", groups="broken")
+ public void testExtensionInjectableAsBean()
+ {
+ assert SimpleExtension.getInstance() != null;
+ assert
getCurrentManager().getInstanceByType(SimpleExtension.class).equals(SimpleExtension.getInstance());
+ }
+
+}
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/ExtensionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/Foo.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/Foo.java
(rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/Foo.java 2009-10-29
23:52:46 UTC (rev 4432)
@@ -0,0 +1,15 @@
+package org.jboss.weld.test.unit.extensions;
+
+import javax.inject.Inject;
+
+public class Foo
+{
+
+ @Inject SimpleExtension simpleExtension;
+
+ public SimpleExtension getSimpleExtension()
+ {
+ return simpleExtension;
+ }
+
+}
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/Foo.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/SimpleExtension.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/SimpleExtension.java
(rev 0)
+++
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/SimpleExtension.java 2009-10-29
23:52:46 UTC (rev 4432)
@@ -0,0 +1,22 @@
+package org.jboss.weld.test.unit.extensions;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.Extension;
+
+
+public class SimpleExtension implements Extension
+{
+
+ private static SimpleExtension instance;
+
+ public void observe(@Observes BeforeBeanDiscovery event)
+ {
+ SimpleExtension.instance = this;
+ }
+
+ public static SimpleExtension getInstance()
+ {
+ return instance;
+ }
+
+}
Property changes on:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/SimpleExtension.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
core/trunk/tests/src/test/resources/org/jboss/weld/test/unit/extensions/javax.enterprise.inject.spi.Extension
===================================================================
---
core/trunk/tests/src/test/resources/org/jboss/weld/test/unit/extensions/javax.enterprise.inject.spi.Extension
(rev 0)
+++
core/trunk/tests/src/test/resources/org/jboss/weld/test/unit/extensions/javax.enterprise.inject.spi.Extension 2009-10-29
23:52:46 UTC (rev 4432)
@@ -0,0 +1 @@
+org.jboss.weld.test.unit.extensions.SimpleExtension
\ No newline at end of file
Modified: core/trunk/tests/unit-tests.xml
===================================================================
--- core/trunk/tests/unit-tests.xml 2009-10-29 23:15:12 UTC (rev 4431)
+++ core/trunk/tests/unit-tests.xml 2009-10-29 23:52:46 UTC (rev 4432)
@@ -37,7 +37,8 @@
<package name="org.jboss.weld.test.unit.decorator.simple" />
<package name="org.jboss.weld.test.unit.definition" />
<package name="org.jboss.weld.test.unit.deployment.structure"
/>
- <package name="org.jboss.weld.test.unit.evironments.servlet" />
+ <package name="org.jboss.weld.test.unit.environments.servlet"
/>
+ <package name="org.jboss.weld.test.unit.extensions" />
<package name="org.jboss.weld.test.unit.implementation" />
<package
name="org.jboss.weld.test.unit.implementation.annotatedItem" />
<package name="org.jboss.weld.test.unit.implementation.enterpise"
/>