|
|
|
|
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
|
|
|
|
/* |
|
|
|
|
* Copyright 2002-2018 the original author or authors. |
|
|
|
|
* Copyright 2002-2023 the original author or authors. |
|
|
|
|
* |
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
|
@ -16,6 +16,7 @@
@@ -16,6 +16,7 @@
|
|
|
|
|
|
|
|
|
|
package org.springframework.context.annotation; |
|
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.Disabled; |
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.support.DefaultBeanNameGenerator; |
|
|
|
|
@ -29,38 +30,40 @@ import org.springframework.core.type.filter.TypeFilter;
@@ -29,38 +30,40 @@ import org.springframework.core.type.filter.TypeFilter;
|
|
|
|
|
* @since 3.1 |
|
|
|
|
* @see ComponentScanAnnotationIntegrationTests |
|
|
|
|
*/ |
|
|
|
|
public class ComponentScanAnnotationTests { |
|
|
|
|
@Disabled("Compilation of this test class is sufficient to serve its purpose") |
|
|
|
|
class ComponentScanAnnotationTests { |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void noop() { |
|
|
|
|
// no-op; the @ComponentScan-annotated MyConfig class below simply exercises
|
|
|
|
|
void noop() { |
|
|
|
|
// no-op; the @ComponentScan-annotated classes below simply exercise
|
|
|
|
|
// available attributes of the annotation.
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@interface MyAnnotation { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@interface MyAnnotation { |
|
|
|
|
} |
|
|
|
|
@Configuration |
|
|
|
|
@ComponentScan( |
|
|
|
|
basePackageClasses = TestBean.class, |
|
|
|
|
nameGenerator = DefaultBeanNameGenerator.class, |
|
|
|
|
scopedProxy = ScopedProxyMode.NO, |
|
|
|
|
scopeResolver = AnnotationScopeMetadataResolver.class, |
|
|
|
|
resourcePattern = "**/*custom.class", |
|
|
|
|
useDefaultFilters = false, |
|
|
|
|
includeFilters = { |
|
|
|
|
@Filter(type = FilterType.ANNOTATION, value = MyAnnotation.class) |
|
|
|
|
}, |
|
|
|
|
excludeFilters = { |
|
|
|
|
@Filter(type = FilterType.CUSTOM, value = TypeFilter.class) |
|
|
|
|
}, |
|
|
|
|
lazyInit = true |
|
|
|
|
) |
|
|
|
|
static class MyConfig { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Configuration |
|
|
|
|
@ComponentScan( |
|
|
|
|
basePackageClasses = TestBean.class, |
|
|
|
|
nameGenerator = DefaultBeanNameGenerator.class, |
|
|
|
|
scopedProxy = ScopedProxyMode.NO, |
|
|
|
|
scopeResolver = AnnotationScopeMetadataResolver.class, |
|
|
|
|
resourcePattern = "**/*custom.class", |
|
|
|
|
useDefaultFilters = false, |
|
|
|
|
includeFilters = { |
|
|
|
|
@Filter(type = FilterType.ANNOTATION, value = MyAnnotation.class) |
|
|
|
|
}, |
|
|
|
|
excludeFilters = { |
|
|
|
|
@Filter(type = FilterType.CUSTOM, value = TypeFilter.class) |
|
|
|
|
}, |
|
|
|
|
lazyInit = true |
|
|
|
|
) |
|
|
|
|
class MyConfig { |
|
|
|
|
} |
|
|
|
|
@ComponentScan(basePackageClasses = example.scannable.NamedComponent.class) |
|
|
|
|
static class SimpleConfig { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ComponentScan(basePackageClasses = example.scannable.NamedComponent.class) |
|
|
|
|
class SimpleConfig { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|