사용자 도구

사이트 도구


intellij_idea:unittest

차이

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

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
intellij_idea:unittest [2013/10/10 20:37]
kwon37xi
intellij_idea:unittest [2018/08/06 17:07] (현재)
kwon37xi
줄 1: 줄 1:
 ====== IntelliJ IDEA Unit Test ====== ====== IntelliJ IDEA Unit Test ======
  
-===== 고속 단위 테스트 설정 =====+===== 코드를 수정했으나 테스트 실행시 반영이 안되는 문제 ===== 
 +  * [[https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000119890-updated-tests-are-not-compiling-unless-whole-project-is-rebuilt|updated tests are not compiling unless whole project is rebuilt – IDEs Support (IntelliJ Platform) | JetBrains]] 
 +  * 테스트 코드를 수정했으나 테스트 실행시 테스트 코드 변경사항이 반영이 안되고 꼭 프로젝트 build 를 수행해야만 하는 경우가 있다. 
 +  * 이는 output 디렉토리 설정이 잘 못 돼 있을 경우 나타나는 현상으로 IntelliJ가 실제로 테스트 코드를 컴파일한 디렉토리와 실행시 참조하는 클래스패스가 다를 때 발생한다. 
 +  * **Run/Debug Configurations** 에서 **Use classpath of module** 값을 변경해본다. 
 + 
 +===== Branch Coverage 측정 ===== 
 +  * **Run/Debug Configurations -> Defaults -> JUnit -> Code Coverage**에서 다음 상태로 설정한 뒤에 테스트를 수행하면 된다. 
 +    * Choose coverage Runner : **IntelliJ IDEA** 
 +    * check **Tracing** 
 +      * check **Track per test coverage** 
 +  * **Run With Coverage**로 테스트를 실행하면 다음과 같이 어느 조건이 히트했고 안했는지를 코드 상에서 볼 수 있다. 
 +    {{:intellij_idea:intellij_branch_coverage_show.png|}} 
 + 
 +===== 고속 단위 테스트 설정 : 하지 말 것 =====
   * [[http://plugins.jetbrains.com/plugin/?id=3822|Eclipse Mode]] 플러그인을 설치하고, 설정에서 **Enable incremental compilation on Save**를 체크한다.   * [[http://plugins.jetbrains.com/plugin/?id=3822|Eclipse Mode]] 플러그인을 설치하고, 설정에서 **Enable incremental compilation on Save**를 체크한다.
     * 혹시 이로인해 문제가 생기면 [[http://www.stitchy.org/?p=107|IntelliJ IDEA 12 and Incremental Builds | Stitchy]] 참조.     * 혹시 이로인해 문제가 생기면 [[http://www.stitchy.org/?p=107|IntelliJ IDEA 12 and Incremental Builds | Stitchy]] 참조.
intellij_idea/unittest.1381405055.txt.gz · 마지막으로 수정됨: 2013/10/10 20:37 저자 kwon37xi