List of usage examples for org.springframework.beans.factory.parsing FailFastProblemReporter FailFastProblemReporter
FailFastProblemReporter
From source file:grails.spring.BeanBuilder.java
protected void initializeBeanBuilderForClassLoader(ClassLoader classLoader) { xmlBeanDefinitionReader.setBeanClassLoader(classLoader); namespaceHandlerResolver = new DefaultNamespaceHandlerResolver(this.classLoader); readerContext = new XmlReaderContext(beanBuildResource, new FailFastProblemReporter(), new EmptyReaderEventListener(), new NullSourceExtractor(), xmlBeanDefinitionReader, namespaceHandlerResolver);// ww w . j ava2 s . c o m }
From source file:org.springframework.beans.factory.parsing.FailFastProblemReporterTests.java
@Test(expected = BeanDefinitionParsingException.class) public void testError() throws Exception { FailFastProblemReporter reporter = new FailFastProblemReporter(); reporter.error(new Problem("VGER", new Location(new DescriptiveResource("here")), null, new IllegalArgumentException())); }
From source file:org.springframework.beans.factory.parsing.FailFastProblemReporterTests.java
@Test public void testWarn() throws Exception { Problem problem = new Problem("VGER", new Location(new DescriptiveResource("here")), null, new IllegalArgumentException()); Log log = mock(Log.class); FailFastProblemReporter reporter = new FailFastProblemReporter(); reporter.setLogger(log);/*from www . ja va 2s. com*/ reporter.warning(problem); verify(log).warn(any(), isA(IllegalArgumentException.class)); }
From source file:org.springframework.context.annotation.ConfigurationClassPostProcessor.java
/** * Set the {@link ProblemReporter} to use. * <p>Used to register any problems detected with {@link Configuration} or {@link Bean} * declarations. For instance, an @Bean method marked as {@code final} is illegal * and would be reported as a problem. Defaults to {@link FailFastProblemReporter}. *///from www .ja v a 2 s . c om public void setProblemReporter(@Nullable ProblemReporter problemReporter) { this.problemReporter = (problemReporter != null ? problemReporter : new FailFastProblemReporter()); }
From source file:org.springframework.context.groovy.GroovyBeanDefinitionReader.java
protected void initializeGroovyBeanDefinitionReaderForClassLoader(ClassLoader classLoader) { xmlBeanDefinitionReader.setBeanClassLoader(classLoader); this.namespaceHandlerResolver = new DefaultNamespaceHandlerResolver(this.classLoader); this.readerContext = new XmlReaderContext(beanBuildResource, new FailFastProblemReporter(), new EmptyReaderEventListener(), new NullSourceExtractor(), xmlBeanDefinitionReader, namespaceHandlerResolver);//w w w . j av a 2 s . c om }