22package org .javaee7 .ejb .remote .ssl ;
33
44import static org .javaee7 .ServerOperations .addUsersToContainerIdentityStore ;
5+ import static org .jboss .shrinkwrap .api .ShrinkWrap .create ;
56import static org .jboss .shrinkwrap .api .asset .EmptyAsset .INSTANCE ;
67import static org .junit .Assert .assertEquals ;
78import static org .junit .Assume .assumeTrue ;
1819import org .jboss .arquillian .junit .Arquillian ;
1920import org .jboss .shrinkwrap .api .Archive ;
2021import org .jboss .shrinkwrap .api .ShrinkWrap ;
22+ import org .jboss .shrinkwrap .api .spec .EnterpriseArchive ;
2123import org .jboss .shrinkwrap .api .spec .JavaArchive ;
24+ import org .jboss .shrinkwrap .api .spec .WebArchive ;
2225import org .junit .After ;
2326import org .junit .Before ;
2427import org .junit .Test ;
@@ -40,14 +43,36 @@ public class RemoteBeanTest {
4043 private RemoteEJBContextProvider remoteEJBContextProvider ;
4144
4245 @ Deployment
43- public static Archive <? > deployment () {
44-
46+ public static Archive <EnterpriseArchive > deployment () {
47+ try {
4548 // Add user u1 with password p1 and group g1 to the container's native identity store
4649 addUsersToContainerIdentityStore ();
50+
51+ Archive <EnterpriseArchive > archive =
52+ // EAR module
53+ create (EnterpriseArchive .class , "my.ear" )
54+ .setApplicationXML ("META-INF/application.xml" )
55+
56+ // EJB module
57+ .addAsModule (
58+ create (JavaArchive .class , "myEJB.jar" )
59+ .addClasses (Bean .class , BeanRemote .class )
60+ .addAsResource ("META-INF/glassfish-ejb-jar.xml" )
61+ .addAsManifestResource (INSTANCE , "beans.xml" )
62+ )
4763
48- return ShrinkWrap .create (JavaArchive .class )
49- .addClasses (Bean .class , BeanRemote .class )
50- .addAsManifestResource (INSTANCE , "beans.xml" );
64+ // Web module
65+ .addAsModule (
66+ create (WebArchive .class , "test.war" )
67+ );
68+
69+ System .out .println (archive .toString (true ));
70+
71+ return archive ;
72+ } catch (Exception e ) {
73+ e .printStackTrace ();
74+ throw e ;
75+ }
5176 }
5277
5378 @ Before
0 commit comments