Buggy code:
@ RunWith ( Arquillian . class ) public class GetCallerPrincipalTestCase extends SecurityTest { private static final String QUEUE_NAME = "queue//callerPrincipal" ; private static final Logger log = Logger . getLogger ( GetCallerPrincipalTestCase . class ) ; private static final String ANONYMOUS = "anonymous" ; private static final String OK = "OK" ; private static ModelControllerClient modelControllerClient ; @ ArquillianResource Deployer deployer ; @ Deployment ( managed = true , testable = false , name = "single" , order = 0 ) public static Archive < ? > deploymentSingleton ( ) { } @ Deployment ( managed = false , testable = false , name = "slsb" , order = 100 ) public static Archive < ? > deploymentSlsb ( ) { } @ Deployment ( managed = false , testable = false , name = "sfsb" , order = 101 ) public static Archive < ? > deploymentSfsb ( ) { } @ Deployment ( managed = false , testable = false , name = "mdb" , order = 102 ) public static Archive < ? > deploymentMdb ( ) { } @ Deployment ( managed = false , testable = false , name = "eb" , order = 103 ) public static Archive < ? > deploymentEntityBean ( ) { } @ Deployment ( managed = true , testable = true , name = "test" , order = 3 ) public static Archive < ? > deployment ( ) { } @ BeforeClass public static void init ( ) throws Exception { } @ AfterClass public static void clearUp ( ) throws Exception { } private InitialContext getInitialContext ( ) throws NamingException { } private static void createQueue ( ModelControllerClient modelClient , String queueName ) throws Exception { } private static void destroyQueue ( ModelControllerClient modelClient , String queueName ) throws Exception { } private static ModelNode getQueueAddr ( String name ) { } private ITestResultsSingleton getResultsSingleton ( ) throws NamingException { } private SecurityClient login ( ) throws Exception { } @ Test public void testUnauthenticatedNoSecurityDomain ( ) throws Exception { } @ Test public void testStatelessLifecycle ( ) throws Exception { } @ Test public void testStatefulLifecycle ( ) throws Exception { } @ OperateOnDeployment ( "test" ) @ Test public void testMDBLifecycle ( ) throws Exception { deployer . deploy ( "mdb" ) ; SecurityClient client = this . login ( ) ; ITestResultsSingleton results = this . getResultsSingleton ( ) ; MessageProducer producer = null ; MessageConsumer consumer = null ; QueueConnection conn = null ; Session session = null ; try { QueueConnectionFactory qcf = ( ( QueueConnectionFactory ) ( new InitialContext ( ) . lookup ( "java://RemoteConnectionFactory" ) ) ) ; Queue queue = ( ( Queue ) ( new InitialContext ( ) . lookup ( ( "java:jboss//" + ( GetCallerPrincipalTestCase . QUEUE_NAME ) ) ) ) ) ; <START_BUG> conn = qcf . createQueueConnection ( ) ; <END_BUG> conn . start ( ) ; session = conn . createQueueSession ( false , AUTO_ACKNOWLEDGE ) ; TemporaryQueue replyQueue = session . createTemporaryQueue ( ) ; TextMessage msg = session . createTextMessage ( "Hello<seq2seq4repair_space>world" ) ; msg . setJMSDeliveryMode ( NON_PERSISTENT ) ; msg . setJMSReplyTo ( replyQueue ) ; producer = session . createProducer ( queue ) ; producer . send ( msg ) ; consumer = session . createConsumer ( replyQueue ) ; Message replyMsg = consumer . receive ( 5000 ) ; Object obj = ( ( javax . jms . ObjectMessage ) ( replyMsg ) ) . getObject ( ) ; GetCallerPrincipalTestCase . log . info ( ( "MDB<seq2seq4repair_space>message<seq2seq4repair_space>get:<seq2seq4repair_space>" + obj ) ) ; Assert . assertEquals ( ( ( GetCallerPrincipalTestCase . OK ) + "start" ) , results . getMdb ( "postconstruct" ) ) ; deployer . undeploy ( "mdb" ) ; Assert . assertEquals ( ( ( GetCallerPrincipalTestCase . OK ) + "stop" ) , results . getMdb ( "predestroy" ) ) ; } finally { if ( consumer != null ) { consumer . close ( ) ; } if ( producer != null ) { producer . close ( ) ; } if ( session != null ) { session . close ( ) ; } if ( conn != null ) { conn . stop ( ) ; } client . logout ( ) ; } } @ Test public void testEBActivate ( ) throws Exception { } private < T extends EJBHome > T getHome ( final Class < T > homeClass , final String beanName ) { } private EntityBean setUpEB ( ) throws Exception { } private void tearDownEB ( EntityBean eb ) throws Exception { } }

Fix:
conn = qcf . createQueueConnection ( "guest" , "guest" ) ;