Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- Quartz
- profile
- VirtualBox
- import
- JavaScript
- find
- Source
- context
- netsh
- 줄바꿈 문자
- resource
- Windows
- IntelliJ
- vscode
- 단축키
- lsof
- maVen
- port
- GIT
- Eclipse
- grep
- tomcat
- bash
- Mac
- Windows 10
- plugin
- 네트워크
- xargs
- web.xml
- ssh
Archives
- Today
- Total
develog
[junit] spring junit 설정1 본문
@ContextConfiguration(locations = {}) 를 사용
TestBase.java
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
"file:src/test/resources/WEB-INF/spring/root-context.xml",
"file:src/test/resources/WEB-INF/spring/appServlet/appServlet-context.xml"
})
@WebAppConfiguration
public class TestBase {
@Autowired
protected ApplicationContext applicationContext;
@Test
public void test1() {
System.out.println("test1");
}
}
'Dev > junit' 카테고리의 다른 글
[junit4] pom.xml (0) | 2019.08.27 |
---|---|
[junit] spring junit 설정2 (0) | 2019.08.02 |
[JUnit] JUnit Transaction Rollback (0) | 2015.05.06 |
JUnit 에서 ApplicationContext 접근 (0) | 2013.12.11 |
[junit] ExtSpringJUnit4ClassRunner (0) | 2013.12.09 |
Comments