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); } }
时间: 2024-11-09 02:45:38