标签:
aaa
package com.sniper.common.service.impl; import java.util.Date; import org.apache.log4j.Logger; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.sniper.common.po.User; import com.sniper.common.service.UserService; public class UserServiceImplTest { private static Logger logger = Logger.getLogger(UserServiceImplTest.class); private ApplicationContext context; private UserService userService; @Before public void before() { context = new ClassPathXmlApplicationContext("beans.xml"); userService = (UserService)this.context.getBean("userService"); } @Test public void testTestTransaction() { User user = new User(); user.setEmail("email"); user.setNickName("nickName"); user.setPassword("password"); user.setRegDate(new Date()); userService.testTransaction(user, 0); } @Test @Ignore public void saveTest() { User user = new User(); user.setEmail("email"); user.setNickName("nickName"); user.setPassword("password"); user.setRegDate(new Date()); long id = userService.save(user); logger.debug("================================= id:" + id); } }
标签:
原文地址:http://my.oschina.net/sniperLi/blog/416642