Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
tests/src/test/java/org/jboss/weld/test/unit/extensions/ExtensionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
@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()); | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
tests/src/test/java/org/jboss/weld/test/unit/extensions/Foo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
tests/src/test/java/org/jboss/weld/test/unit/extensions/SimpleExtension.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
.../test/resources/org/jboss/weld/test/unit/extensions/javax.enterprise.inject.spi.Extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.jboss.weld.test.unit.extensions.SimpleExtension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters