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
- xargs
- tomcat
- IntelliJ
- ssh
- 줄바꿈 문자
- Mac
- Source
- maVen
- vscode
- GIT
- resource
- 단축키
- Quartz
- find
- Windows
- import
- JavaScript
- profile
- context
- port
- bash
- grep
- lsof
- Eclipse
- VirtualBox
- web.xml
- 네트워크
- plugin
- Windows 10
- netsh
Archives
- Today
- Total
develog
[junit] ExtSpringJUnit4ClassRunner 본문
import org.junit.internal.runners.InitializationError;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.jndi.JndiTemplate;
import org.springframework.mock.jndi.SimpleNamingContextBuilder;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
public class ExtSpringJUnit4ClassRunner extends SpringJUnit4ClassRunner {
public ExtSpringJUnit4ClassRunner(Class<?> clazz) throws InitializationError, Exception {
super(clazz);
bindJndi();
}
private void bindJndi() throws Exception {
SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder();
builder.activate();
DriverManagerDataSource ds = new DriverManagerDataSource();
ds.setDriverClassName("oracle.jdbc.driver.OracleDriver");
ds.setUrl("jdbc:oracle:thin:@127.0.0.1:1521:ORCL");
ds.setUsername("scott");
ds.setPassword("tiger");
JndiTemplate jt = new JndiTemplate();
jt.bind("jdbc/oracle", ds);
}
}
'Dev > junit' 카테고리의 다른 글
[JUnit] JUnit Transaction Rollback (0) | 2015.05.06 |
---|---|
JUnit 에서 ApplicationContext 접근 (0) | 2013.12.11 |
JUnit 버전 확인 (0) | 2013.12.09 |
JUnit 4 in 60 Seconds (0) | 2013.08.07 |
JUnit Test Project '.classpath' (0) | 2013.07.09 |
Comments