File tree Expand file tree Collapse file tree 8 files changed +71
-237
lines changed
bean-discovery-annotated/src/test/java/org/javaee7/cdi/bean/discovery/annotated
java/org/javaee7/cdi/bean/discovery/none
java/org/javaee7/cdi/bean/discovery/none Expand file tree Collapse file tree 8 files changed +71
-237
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public class GreetingTest {
2323 @ Deployment
2424 public static Archive <?> deploy () {
2525 return ShrinkWrap .create (JavaArchive .class )
26- .addClasses (Greeting .class , SimpleGreeting .class )
26+ .addClasses (Greeting .class , SimpleGreeting .class , FancyGreeting . class )
2727 .addAsManifestResource ("beans.xml" );
2828 }
2929
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ package org .javaee7 .cdi .bean .discovery .none ;
2+
3+ import org .jboss .arquillian .container .test .api .Deployment ;
4+ import org .jboss .arquillian .junit .Arquillian ;
5+ import org .jboss .shrinkwrap .api .Archive ;
6+ import org .jboss .shrinkwrap .api .ShrinkWrap ;
7+ import org .jboss .shrinkwrap .api .spec .JavaArchive ;
8+ import org .junit .Test ;
9+ import org .junit .runner .RunWith ;
10+
11+ import javax .enterprise .inject .spi .Bean ;
12+ import javax .enterprise .inject .spi .BeanManager ;
13+ import javax .inject .Inject ;
14+ import java .util .Set ;
15+
16+ import static org .hamcrest .CoreMatchers .is ;
17+ import static org .hamcrest .collection .IsEmptyCollection .empty ;
18+ import static org .junit .Assert .assertThat ;
19+
20+ @ RunWith (Arquillian .class )
21+ public class GreetingTest {
22+ @ Deployment
23+ public static Archive <?> deploy () {
24+ return ShrinkWrap .create (JavaArchive .class )
25+ .addClasses (Greeting .class , FancyGreeting .class )
26+ .addAsManifestResource ("beans.xml" );
27+ }
28+
29+ @ Inject BeanManager beanManager ;
30+
31+ @ Test
32+ public void should_bean_be_injected () throws Exception {
33+ // Cannot try to inject the bean because it would fail at deployment time (in WildFly 8)
34+ Set <Bean <?>> beans = beanManager .getBeans (Greeting .class );
35+ assertThat (beans , is (empty ()));
36+ }
37+ }
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <arquillian xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xmlns =" http://jboss.org/schema/arquillian" xsi : schemaLocation =" http://jboss.org/schema/arquillian
3+ http://jboss.org/schema/arquillian/arquillian_1_0.xsd" >
4+
5+ <defaultProtocol type =" Servlet 3.0" />
6+
7+ <container qualifier =" test" default =" true" >
8+ <configuration >
9+ <property name =" jbossHome" >${serverRoot:target/wildfly-8.0.0.Beta1}</property >
10+ <property name =" serverConfig" >${serverProfile:standalone-full.xml}</property >
11+ </configuration >
12+ </container >
13+
14+ </arquillian >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <beans
3+ xmlns =" http://xmlns.jcp.org/xml/ns/javaee"
4+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5+ xsi : schemaLocation =" http://xmlns.jcp.org/xml/ns/javaee
6+ http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
7+ bean-discovery-mode =" none" >
8+ </beans >
Original file line number Diff line number Diff line change 1717 <!-- Plugin versions -->
1818 <plugin .enforcer.version>1.3.1</plugin .enforcer.version>
1919 <maven .test.skip>false</maven .test.skip>
20+ <hamcrest .version>1.3</hamcrest .version>
2021 </properties >
2122 <dependencyManagement >
2223 <dependencies >
5657 <version >4.11</version >
5758 <scope >test</scope >
5859 </dependency >
60+ <dependency >
61+ <groupId >org.hamcrest</groupId >
62+ <artifactId >hamcrest-core</artifactId >
63+ <version >${hamcrest.version} </version >
64+ </dependency >
65+ <dependency >
66+ <groupId >org.hamcrest</groupId >
67+ <artifactId >hamcrest-library</artifactId >
68+ <version >${hamcrest.version} </version >
69+ </dependency >
5970 <dependency >
6071 <groupId >org.jboss.arquillian.junit</groupId >
6172 <artifactId >arquillian-junit-container</artifactId >
You can’t perform that action at this time.
0 commit comments