example.scannable.FooDao Java Examples

The following examples show how to use example.scannable.FooDao. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EnableAspectJAutoProxyTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Bean
public FooService fooServiceImpl(final ApplicationContext context) {
	return new FooServiceImpl() {
		@Override
		public String foo(int id) {
			assertNotNull(AopContext.currentProxy());
			return super.foo(id);
		}
		@Override
		protected FooDao fooDao() {
			return context.getBean(FooDao.class);
		}
	};
}
 
Example #2
Source File: ClassPathScanningCandidateComponentProviderTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void customNotSupportedIncludeFilterUseScan() {
	ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false);
	provider.setResourceLoader(new DefaultResourceLoader(TEST_BASE_CLASSLOADER));
	provider.addIncludeFilter(new AssignableTypeFilter(FooDao.class));
	Set<BeanDefinition> candidates = provider.findCandidateComponents(TEST_BASE_PACKAGE);
	assertTrue(containsBeanClass(candidates, StubFooDao.class));
	assertEquals(1, candidates.size());
	assertBeanDefinitionType(candidates, ScannedGenericBeanDefinition.class);
}
 
Example #3
Source File: ClassPathScanningCandidateComponentProviderTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void testWithInterfaceType() {
	ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false);
	provider.addIncludeFilter(new AssignableTypeFilter(FooDao.class));
	Set<BeanDefinition> candidates = provider.findCandidateComponents(TEST_BASE_PACKAGE);
	assertEquals(1, candidates.size());
	assertTrue(containsBeanClass(candidates, StubFooDao.class));
}
 
Example #4
Source File: EnableAspectJAutoProxyTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Bean
public FooService fooServiceImpl(final ApplicationContext context) {
	return new FooServiceImpl() {
		@Override
		public String foo(int id) {
			assertNotNull(AopContext.currentProxy());
			return super.foo(id);
		}
		@Override
		protected FooDao fooDao() {
			return context.getBean(FooDao.class);
		}
	};
}
 
Example #5
Source File: ClassPathScanningCandidateComponentProviderTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void customNotSupportedIncludeFilterUseScan() {
	ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false);
	provider.setResourceLoader(new DefaultResourceLoader(TEST_BASE_CLASSLOADER));
	provider.addIncludeFilter(new AssignableTypeFilter(FooDao.class));
	Set<BeanDefinition> candidates = provider.findCandidateComponents(TEST_BASE_PACKAGE);
	assertTrue(containsBeanClass(candidates, StubFooDao.class));
	assertEquals(1, candidates.size());
	assertBeanDefinitionType(candidates, ScannedGenericBeanDefinition.class);
}
 
Example #6
Source File: ClassPathScanningCandidateComponentProviderTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void testWithInterfaceType() {
	ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false);
	provider.addIncludeFilter(new AssignableTypeFilter(FooDao.class));
	Set<BeanDefinition> candidates = provider.findCandidateComponents(TEST_BASE_PACKAGE);
	assertEquals(1, candidates.size());
	assertTrue(containsBeanClass(candidates, StubFooDao.class));
}
 
Example #7
Source File: ClassPathScanningCandidateComponentProviderTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void testWithInterfaceType() {
	ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false);
	provider.addIncludeFilter(new AssignableTypeFilter(FooDao.class));
	Set<BeanDefinition> candidates = provider.findCandidateComponents(TEST_BASE_PACKAGE);
	assertEquals(1, candidates.size());
	assertTrue(containsBeanClass(candidates, StubFooDao.class));
}