When running Java EE 7 Samples with Swarm, all the security related samples (modules jacc and jaspic) fail due to a cascading failure:
- first, the tests obviously fail because default security subsystem in Swarm doesn't match default security subsystem in WildFly
- once that is fixed, the tests fail because JAX-RS is autodetected (because of some dependency), but there's no JAX-RS Application class, so Swarm creates the default one, which maps to /, which takes precedence over servlets
- once that is worked around (I don't have a fix), the tests fail because the ShrinkWrap archive from Java EE 7 Samples contains custom jboss-web.xml, which nullifies the changes done by JBossWebContainer.setDefaultContextRoot, but Swarm doesn't know that this setting is gone and still assumes that the application is available at /, and this is what the Swarm Arquillian container injects into the test as the @ArquillianResource URL
Once all that is fixed / worked around, the tests pass just fine . I'll be creating JIRAs for all 3 items above, but I only have a fix for the 1st problem.
To see the issue(s) in action, follow these steps:
My key takeaway from this is that Swarm is full of automagic, which seems to work fine in 99 % of cases, but when it backfires, it burns really hard and is impossible to figure out without diving deep into Swarm internals.
 Except of two tests in jaspic/dispatching-jsf-cdi that are also failing with WildFly proper.