Sorry,
I forgot to mention that when using ProgrammaticLogin you also have to set the JAAS Config. So please add the following as JVM parameter to your Unit Tests:
-Djava.security.auth.login.config=<%AS_INSTALL%>\lib\appclient\appclientlogin.conf
(Replace AS_INSTALL with your glassfish DIR)
That should do it.
-Daniel
[Message sent by forum member 'barz26' (barz26)]
http://forums.java.net/jive/thread.jspa?messageID=213307