neo4j/neo4j — pull request #847 by sarmbruster (2013-05-30 21:06:34+00:00)
Title: fix compliance for non-default logback implemenatations

There are use cases when Neo4j is used embedded and the environment provides a custom implementation of SLF4j's StaticLoggerBinder (e.g. https://github.com/grails/grails-core/blob/061f020de1b8563c2ac7aaed421f079d10208237/grails-plugin-log4j/src/main/groovy/org/slf4j/impl/StaticLoggerBinder.java)

These custom implementation might not return a LoggerContext when getSingleton().getLoggerFactory() is called, since it's only guaranteed to retrieve a ILoggerFactory. Neo4j needs to deal with this situation gracefully.

Therefore InternalAbstractGraphDatabase should catch any exceptions upon logging initialization and fall back to ClassicLoggingService if necessary.

Testing this is a PITA, since static methods need to be mocked. PowerMock to the rescue!