문서의 선택한 두 판 사이의 차이를 보여줍니다.
다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
springframework:test [2015/05/07 10:56] kwon37xi 만듦 |
springframework:test [2018/09/28 12:12] kwon37xi |
||
---|---|---|---|
줄 1: | 줄 1: | ||
====== Springframework Test ====== | ====== Springframework Test ====== | ||
+ | * [[java: | ||
+ | * [[java: | ||
* [[http:// | * [[http:// | ||
+ | * [[springframework: | ||
+ | * [[springframework: | ||
+ | |||
+ | ===== @ContextHierarchy ===== | ||
+ | * '' | ||
+ | * 컨텍스트간의 계층을 두어 설정. 이 안에 '' | ||
===== @ContextConfiguration 이중 지정문제 ===== | ===== @ContextConfiguration 이중 지정문제 ===== | ||
- | * '' | + | * '' |
* '' | * '' | ||
- | Caused by: org.gradle.process.internal.ExecException: | + | Caused by: org.gradle.process.internal.ExecException: |
+ | | ||
</ | </ | ||
+ | |||
+ | ===== Test Class 자체에 컨텍스트 설정 넣기 ===== | ||
+ | <code java> | ||
+ | @RunWith(SpringJUnit4ClassRunner.class) | ||
+ | @ContextConfiguration // 이 부분 추가 | ||
+ | public class MySpringTest { | ||
+ | @Configuration | ||
+ | public static class TestConfig { | ||
+ | // 기타 설정.. | ||
+ | } | ||
+ | | ||
+ | @Autowired //.. injection... | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== @TestPropertySource ===== | ||
+ | * [[https:// | ||
+ | |||
+ | |||