40b11bdb5246001c1ed6e8bb434c180f
来自「尚学堂Java148班的spring的所有源码」· 代码 · 共 28 行
TXT
28 行
package com.bjsxt.usermgr;
import java.util.Date;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.bjsxt.usermgr.manager.UserManager;
import com.bjsxt.usermgr.manager.UserManagerImpl;
import com.bjsxt.usermgr.model.User;
import junit.framework.TestCase;
public class UserMgrTest extends TestCase {
public void testSave1() {
User user = new User();
user.setName("张三");
user.setPassword("123");
user.setCreateTime(new Date());
user.setExpireTime(new Date());
//读取配置文件,获取BeanFactory
BeanFactory factory = new ClassPathXmlApplicationContext("applicationContext-*.xml");
UserManager userManager = (UserManager)
userManager.addUser(user);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?