티스토리 뷰
>> <context:annotation-config/> 가 하는 내용
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <context:annotation-config/>
</bean>
<context:annotation-config>태그로 등록되는 BeanPostProcessor
RequiredAnnotationBeanPostProcessor : @Required 어노테이션 처리
AutowiredAnnotationBeanPostProcessor : @Autowired 어노테이션 처리
CommonAnnotationBeanPostProcessor : @Resource, @PostConstruct,@PreDestroy 어노테이션 처리
ConfigurationClassBeanPostProcessor : @Configuration 어노테이션 처리
>> Junit Spring 테스트를 위한 설정
pom.xml dependency추가
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.maven.artifact.version}</version>
</dependency>
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={
"file:src/main/webapp/WEB-INF/config/egovframework/springmvc/dispatcher-servlet.xml",
"classpath:egovframework/spring/*.xml"
})
@WebAppConfiguration
public class CarTest {
@Test
public void test() {
fail("Not yet implemented");
}
}
- Total
- Today
- Yesterday