org.springframework
spring-test
4.0.5.RELEASE
test
test java코드 MemberServiceTest.java
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration( {
"classpath:servlet-context.xml",
"classpath:config/context-datasource.xml"
}
)
public class MemberServiceTest {
@Autowired
MemberService memberService;
@Test
public void testSr2002() throws Exception {
RequestData req = new RequestData(null, new DbMap());
ResponseData res = new ResponseData(new DbMap());
memberService.sr2002(req, res);
}
}
이때 디비를 jndi-lookup 를 이용하는 경우를 위해 test/resources/config/context-datasource.xml 을 넣어서 아래와 같이 기존 id를 덮었다.
test/resources/config/context-datasource.xml 파일
댓글 없음:
댓글 쓰기