sonatype/nexus-oss — pull request #46 by cstamas (2013-06-18 11:51:11+00:00)
Title: Removal of deprecated security components.

As almost all of them were unused since the switch to
Shiro Guice Support (ShiroModule that we extend).
Still, by the fact that many UTs were not setup properly,
many UTs did pull in those deprecated plexus components
instead performing tests with code we use at runtime.
These plexus components are now removed, and
SecurityModule properly installed, that involved
some UT class hierarchy changes too. NexusAppTestSupport
is now the class that should be extended when
security is needed to be present in UT.

Another change never applied to UTs is that
Shiro since use of ShiroModule is _not restartable_,
as on shutdown Shiro nullifies some fields of it, that
are reinited only on lookup from Injector (are injected).
Hence, no "bounce" of Nexus or Security is possible
as some tests assume, since same instance
cannot be reused (as they tried).

Another problem was pollution of "main" thread
Shiro related threadLocals, as when one test performed
login, the whole Shiro object graph remained pinned
in memory (as delegating subject tied to main thread
referenced SecurityManager and other stuff). Hence,
some UTs were able and were testing against
SecurityManager started in some completely different
UTs (as all the tests are run in single JVM).
NexusAppTestSupport (and few other classes in some
non-core modules) modified now, to properly clean
the thread local state of main thread.

Also, fixed the branutils dependency, as that one is needed dependency
of shiro-core, but it's excluded in buildsupport-shiro, to have it replaced by
out patched beanutils. This dependency is now added as
"normal" dependency of nexus-security, not as test scoped.

Some cleanup applied too, as MAT showed that many
tests actually did not clean up after themselves,
most typically the connMgr of HC4Provider and
EHCacheManager (hence the NexusStopped event
that makes those affected components to cleanly
shut down).