use of org.springframework.core.io.DefaultResourceLoader in project spring-framework by spring-projects.
the class ClassPathScanningCandidateComponentProviderTests method customAssignableTypeIncludeFilterWithIndex.
@Test
public void customAssignableTypeIncludeFilterWithIndex() {
ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false);
provider.setResourceLoader(new DefaultResourceLoader(TEST_BASE_CLASSLOADER));
testCustomAssignableTypeIncludeFilter(provider, AnnotatedGenericBeanDefinition.class);
}
use of org.springframework.core.io.DefaultResourceLoader in project spring-framework by spring-projects.
the class ClassPathScanningCandidateComponentProviderTests method bogusPackageWithIndex.
@Test
public void bogusPackageWithIndex() {
ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(true);
provider.setResourceLoader(new DefaultResourceLoader(TEST_BASE_CLASSLOADER));
Set<BeanDefinition> candidates = provider.findCandidateComponents("bogus");
assertEquals(0, candidates.size());
}
use of org.springframework.core.io.DefaultResourceLoader in project spring-framework by spring-projects.
the class ClassPathScanningCandidateComponentProviderTests method customSupportedIncludeAndExcludedFilterWithScan.
@Test
public void customSupportedIncludeAndExcludedFilterWithScan() {
ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false);
provider.setResourceLoader(new DefaultResourceLoader(CandidateComponentsTestClassLoader.disableIndex(getClass().getClassLoader())));
testCustomSupportedIncludeAndExcludeFilter(provider, ScannedGenericBeanDefinition.class);
}
use of org.springframework.core.io.DefaultResourceLoader in project spring-framework by spring-projects.
the class ClassPathScanningCandidateComponentProviderTests method customSupportIncludeFilterWithNonIndexedTypeUseScan.
@Test
public void customSupportIncludeFilterWithNonIndexedTypeUseScan() {
ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false);
provider.setResourceLoader(new DefaultResourceLoader(TEST_BASE_CLASSLOADER));
// This annotation type is not directly annotated with Indexed so we can use
// the index to find candidates
provider.addIncludeFilter(new AnnotationTypeFilter(CustomStereotype.class));
Set<BeanDefinition> candidates = provider.findCandidateComponents(TEST_BASE_PACKAGE);
assertTrue(containsBeanClass(candidates, DefaultNamedComponent.class));
assertEquals(1, candidates.size());
assertBeanDefinitionType(candidates, ScannedGenericBeanDefinition.class);
}
use of org.springframework.core.io.DefaultResourceLoader in project spring-framework by spring-projects.
the class ClassPathScanningCandidateComponentProviderTests method customAnnotationTypeIncludeFilterWithIndex.
@Test
public void customAnnotationTypeIncludeFilterWithIndex() {
ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false);
provider.setResourceLoader(new DefaultResourceLoader(TEST_BASE_CLASSLOADER));
testCustomAnnotationTypeIncludeFilter(provider, AnnotatedGenericBeanDefinition.class);
}
Aggregations