From: <forums_at_java.net>
Date: Thu, 21 Apr 2011 07:14:01 -0500 (CDT)
[quote]It is possible to test secure EJB3s with GF embedded server as well.
Dynamic creation of file users can then be done using the CommandRunner
API.[/quote]
Yes, I know. I'm using it. In my original post the link to a test project
didn't get through but here it is proper:
If I run the test I get a *java.lang.IllegalStateException: No mapping
available for role reference role1* although I provided an *ejb-jar.xml* and
a *sun-ejb-jar.xml* with the necessary mappings.
I also tried with *Glassfish Embedded 3.1* but here I get the error I
mentioned in my original post: a *java.lang.IndexOutOfBoundsException* here:
final List<String> serverNames = Server.getServerNames(); // Empty list!!
final Server server = Server.getServer(serverNames.get(0));
I noticed that for my code to compile with GF 3.1 I had to import
*org.glassfish./internal/.embedded.Server* instead of
*org.glassfish./api/.embedded.Server* for GF 3.0. Both seem to have the same
methods.