File tree Expand file tree Collapse file tree
java/org/javaee7/cdi/nobeans/xml
java/org/javaee7/cdi/nobeans/xml Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545 * @author Arun Gupta
4646 */
4747@ RequestScoped
48- public class MyBean {
48+ public class ScopedBean {
4949 public String sayHello (String name ) {
5050 return "Hello " + name ;
5151 }
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 .nobeans .xml ;
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 .inject .Inject ;
12+
13+ import static org .hamcrest .CoreMatchers .is ;
14+ import static org .hamcrest .CoreMatchers .notNullValue ;
15+ import static org .junit .Assert .assertThat ;
16+
17+ /**
18+ * @author Alexis Hassler
19+ */
20+ @ RunWith (Arquillian .class )
21+ public class ScopedBeanTest {
22+ @ Deployment
23+ public static Archive <?> deploy () {
24+ return ShrinkWrap .create (JavaArchive .class )
25+ .addClass (ScopedBean .class );
26+ }
27+
28+ @ Inject ScopedBean bean ;
29+
30+ @ Test
31+ public void should_scope_bean_be_injected () throws Exception {
32+ assertThat (bean , is (notNullValue ()));
33+ }
34+ }
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 >
You can’t perform that action at this time.
0 commit comments