▲ MemberMapperTest.java
페이지 정보
본문
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.MemberMapper;
import com.pkt.model.MemberVO;
import lombok.Setter;
import lombok.extern.log4j.Log4j;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "file:src/main/webapp/WEB-INF/root-context.xml" })
@Log4j
public class MemberMapperTest {
@Autowired
private MemberMapper mapper;
//@Test
public void testGetList() {
mapper.getList();
}
//@Test
public void testInsert() {
MemberVO m = new MemberVO();
m.setUserid("2222");
m.setUserpw("2222");
m.setUsername("이순이");
m.setEmail("2222@2222.com");
mapper.insert(m);
log.info("회원가입");
}
//@Test
public void testRead() {
MemberVO user = new MemberVO();
user.setUserid("1111");
user.setUserpw("1111");
MemberVO m = mapper.read(user);
log.info(m); //회원정보
}
//@Test
public void testUpdate() {
MemberVO user = new MemberVO();
user.setUserid("2222");
user.setUserpw("3333");
user.setUsername("유관순");
user.setEmail("abcd@abcd.com");
mapper.update(user); //회원수정
}
//@Test
public void testDelete() {
mapper.delete("2222"); //회원삭제
}
}
- 이전글MemberMapper.xml 24.07.29
- 다음글● Member 회원 ( ① model , mapper , interface 구현 및 테스트 ) 24.07.29
댓글목록
등록된 댓글이 없습니다.