@Test public void testEstablishLogInitialisationClass() { CougarSpringCtxFactoryImpl classUnderTest = new CougarSpringCtxFactoryImpl(); Class logInitialisationClass = classUnderTest.establishLogInitialisationClass(null); assertNotNull(logInitialisationClass); assertEquals(CougarSpringCtxFactoryImpl.DEFAULT_COUGAR_LOG_INIT_CLASS, logInitialisationClass); logInitialisationClass = classUnderTest.establishLogInitialisationClass("com.betfair.cougar.core.impl.TestLogBootstrap"); assertNotNull(logInitialisationClass); assertEquals(TestLogBootstrap.class, logInitialisationClass); logInitialisationClass = classUnderTest.establishLogInitialisationClass("none"); assertNotNull(logInitialisationClass); assertEquals(NullLogBootstrap.class, logInitialisationClass); logInitialisationClass = classUnderTest.establishLogInitialisationClass("wibble"); assertNotNull(logInitialisationClass); assertEquals(CougarSpringCtxFactoryImpl.DEFAULT_COUGAR_LOG_INIT_CLASS, logInitialisationClass); }
public Class establishLogInitialisationClass(String loggingBootstrapClassName) { Class logBootstrapClass; if (loggingBootstrapClassName != null) { if (loggingBootstrapClassName.equals("none")) { logBootstrapClass = NullLogBootstrap.class; } else { try { logBootstrapClass = Class.forName(loggingBootstrapClassName); } catch (ClassNotFoundException cnfe) { System.err.println("Unable to resolve logging initialisation class: [" + loggingBootstrapClassName + "] falling back to default log4j initialisation for logging"); logBootstrapClass = DEFAULT_COUGAR_LOG_INIT_CLASS; } } } else { logBootstrapClass = DEFAULT_COUGAR_LOG_INIT_CLASS; } return logBootstrapClass; }
CougarSpringCtxFactoryImpl implements CougarSpringCtxFactory { public Class establishLogInitialisationClass(String loggingBootstrapClassName) { Class logBootstrapClass; if (loggingBootstrapClassName != null) { if (loggingBootstrapClassName.equals("none")) { logBootstrapClass = NullLogBootstrap.class; } else { try { logBootstrapClass = Class.forName(loggingBootstrapClassName); } catch (ClassNotFoundException cnfe) { System.err.println("Unable to resolve logging initialisation class: [" + loggingBootstrapClassName + "] falling back to default log4j initialisation for logging"); logBootstrapClass = DEFAULT_COUGAR_LOG_INIT_CLASS; } } } else { logBootstrapClass = DEFAULT_COUGAR_LOG_INIT_CLASS; } return logBootstrapClass; } }
CougarSpringCtxFactoryImpl implements CougarSpringCtxFactory { public Class establishLogInitialisationClass(String loggingBootstrapClassName) { Class logBootstrapClass; if (loggingBootstrapClassName != null) { if (loggingBootstrapClassName.equals("none")) { logBootstrapClass = NullLogBootstrap.class; } else { try { logBootstrapClass = Class.forName(loggingBootstrapClassName); } catch (ClassNotFoundException cnfe) { System.err.println("Unable to resolve logging initialisation class: [" + loggingBootstrapClassName + "] falling back to default log4j initialisation for logging"); logBootstrapClass = DEFAULT_COUGAR_LOG_INIT_CLASS; } } } else { logBootstrapClass = DEFAULT_COUGAR_LOG_INIT_CLASS; } return logBootstrapClass; }  }
CougarSpringCtxFactoryImpl implements CougarSpringCtxFactory { public Class establishLogInitialisationClass(String loggingBootstrapClassName) { Class logBootstrapClass; if (loggingBootstrapClassName != null) { if (loggingBootstrapClassName.equals("none")) { logBootstrapClass = NullLogBootstrap.class; } else { try { logBootstrapClass = Class.forName(loggingBootstrapClassName); } catch (ClassNotFoundException cnfe) { System.err.println("Unable to resolve logging initialisation class: [" + loggingBootstrapClassName + "] falling back to default log4j initialisation for logging"); logBootstrapClass = DEFAULT_COUGAR_LOG_INIT_CLASS; } } } else { logBootstrapClass = DEFAULT_COUGAR_LOG_INIT_CLASS; } return logBootstrapClass; }  ClassPathXmlApplicationContext create(); @Override ClassPathXmlApplicationContext create(ApplicationContext parentCtx); void logInitialisation(String loggingBootstrapClassName); void runLogInitialisation(Class logBootstrapClass); Class establishLogInitialisationClass(String loggingBootstrapClassName); }
CougarSpringCtxFactoryImpl implements CougarSpringCtxFactory { public Class establishLogInitialisationClass(String loggingBootstrapClassName) { Class logBootstrapClass; if (loggingBootstrapClassName != null) { if (loggingBootstrapClassName.equals("none")) { logBootstrapClass = NullLogBootstrap.class; } else { try { logBootstrapClass = Class.forName(loggingBootstrapClassName); } catch (ClassNotFoundException cnfe) { System.err.println("Unable to resolve logging initialisation class: [" + loggingBootstrapClassName + "] falling back to default log4j initialisation for logging"); logBootstrapClass = DEFAULT_COUGAR_LOG_INIT_CLASS; } } } else { logBootstrapClass = DEFAULT_COUGAR_LOG_INIT_CLASS; } return logBootstrapClass; }  ClassPathXmlApplicationContext create(); @Override ClassPathXmlApplicationContext create(ApplicationContext parentCtx); void logInitialisation(String loggingBootstrapClassName); void runLogInitialisation(Class logBootstrapClass); Class establishLogInitialisationClass(String loggingBootstrapClassName); static final String LOGGING_BOOTSTRAP_CLASS_PROPERTY; static final Class DEFAULT_COUGAR_LOG_INIT_CLASS; }