사용자 도구

사이트 도구


springframework:test

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

다음 판
이전 판
마지막 판 양쪽 다음 판
springframework:test [2015/05/07 10:56]
kwon37xi 만듦
springframework:test [2020/07/08 14:04]
kwon37xi [Springframework Test]
줄 1: 줄 1:
 ====== Springframework Test ====== ====== Springframework Test ======
 +  * [[java:junit|JUnit]]
 +  * [[java:unittest|Java Unit Test]]
   * [[http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.html|SpringJUnit4ClassRunner]]   * [[http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.html|SpringJUnit4ClassRunner]]
 +  * [[java:junit:database_rider|database-rider]]
 +  * [[springframework:spring_test_dbunit|Spring Test DBUnit]]
 +  * [[springframework:mvc:unittest|Spring MVC UnitTest]]
 +
 +===== @ContextHierarchy =====
 +  * ''@org.springframework.test.context.ContextHierarchy''
 +  * 컨텍스트간의 계층을 두어 설정. 이 안에 ''@ContextConfiguration''을 계층적으로 선언
  
 ===== @ContextConfiguration 이중 지정문제 ===== ===== @ContextConfiguration 이중 지정문제 =====
-  * ''@ContextConfiguration''로 동일한 클래스를 부모클래스와 자식 클래스에도 중복 지정하자 Gradle + JDK 7에서는 JDK Crash가 발생했고, JDK 8 에서는 Proxy 객체를 올바르게 생성하지 못해서 오류가 발생했다.+  * ''@ContextConfiguration''로 동일한 클래스를 부모클래스와 자식 클래스에도 중복 지정하자 Spring 3.2.8 + Gradle + JDK 7에서는 JDK Crash가 발생했고, JDK 8 에서는 Proxy 객체를 올바르게 생성하지 못해서 오류가 발생했다.
   * ''hs_err_pid'' 파일이 생성되면서 다음 오류 발생.<code>   * ''hs_err_pid'' 파일이 생성되면서 다음 오류 발생.<code>
-Caused by: org.gradle.process.internal.ExecException: Process 'Gradle Test Executor 1' finished with non-zero exit value 134+Caused by: org.gradle.process.internal.ExecException:  
 +    Process 'Gradle Test Executor 1' finished with non-zero exit value 134
 </code> </code>
 +
 +===== Test Class 자체에 컨텍스트 설정 넣기 =====
 +<code java>
 +@RunWith(SpringJUnit4ClassRunner.class)
 +@ContextConfiguration // 이 부분 추가
 +public class MySpringTest {
 +    @Configuration
 +    public static class TestConfig {
 +        // 기타 설정..
 +    }
 +    
 +    @Autowired //.. injection...
 +}
 +</code>
 +
 +===== @TestPropertySource =====
 +  * [[https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/test/context/TestPropertySource.html|@TestPropertySource]]
 +
 +
 +===== WebClient / WebTestClient =====
 +  * [[https://www.callicoder.com/spring-5-reactive-webclient-webtestclient-examples/?fbclid=IwAR2QMj5NdEHL4NHopq_0FCfk-l3dMk46mX2Oy72-MN1Ptu-URVfJImtpXsg|Spring 5 WebClient and WebTestClient Tutorial with Examples | CalliCoder]]
  
springframework/test.txt · 마지막으로 수정됨: 2021/07/22 17:01 저자 kwon37xi