▲ TimeMapperTest
페이지 정보
작성자 관리자 작성일 24-07-16 14:50 조회 516 댓글 0본문
package com.pkt.controller;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.pkt.mapper.TimeMapper;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("file:src/main/webapp/WEB-INF/root-context.xml")
public class TimeMapperTest {
@Autowired
private TimeMapper timeMapper;
@Test
public void tetGetTime() {
System.out.println("현재시간:"+timeMapper.getTime());
}
}
[ 콘솔 결과 ]
현재시간:2024-07-16 14:49:30
INFO : com.pkt.controller.TimeMapperTest - 현재시간:2023-06-01 13:51:52
두개의 출력 구문의 차이 : log객체를 이용하면 패키지 경로.클래스 명을 알려준다.
댓글목록 0
등록된 댓글이 없습니다.