@Test public void testFactory() { Logger log = factory.getLogger("foo"); assertNotNull(log); Logger log2 = factory.getLogger("foo"); assertTrue("Loggers with same name must be same", log == log2); }
synchronized public Logger getLogger(String name) { SubstituteLogger logger = loggers.get(name); if (logger == null) { logger = new SubstituteLogger(name, eventQueue, postInitialization); loggers.put(name, logger); } return logger; }
SubstituteLoggerFactory implements ILoggerFactory { synchronized public Logger getLogger(String name) { SubstituteLogger logger = loggers.get(name); if (logger == null) { logger = new SubstituteLogger(name, eventQueue, postInitialization); loggers.put(name, logger); } return logger; } }
SubstituteLoggerFactory implements ILoggerFactory { synchronized public Logger getLogger(String name) { SubstituteLogger logger = loggers.get(name); if (logger == null) { logger = new SubstituteLogger(name, eventQueue, postInitialization); loggers.put(name, logger); } return logger; }  }
SubstituteLoggerFactory implements ILoggerFactory { synchronized public Logger getLogger(String name) { SubstituteLogger logger = loggers.get(name); if (logger == null) { logger = new SubstituteLogger(name, eventQueue, postInitialization); loggers.put(name, logger); } return logger; }  synchronized Logger getLogger(String name); List<String> getLoggerNames(); List<SubstituteLogger> getLoggers(); LinkedBlockingQueue<SubstituteLoggingEvent> getEventQueue(); void postInitialization(); void clear(); }
SubstituteLoggerFactory implements ILoggerFactory { synchronized public Logger getLogger(String name) { SubstituteLogger logger = loggers.get(name); if (logger == null) { logger = new SubstituteLogger(name, eventQueue, postInitialization); loggers.put(name, logger); } return logger; }  synchronized Logger getLogger(String name); List<String> getLoggerNames(); List<SubstituteLogger> getLoggers(); LinkedBlockingQueue<SubstituteLoggingEvent> getEventQueue(); void postInitialization(); void clear();  }