8007a5d45246001c1ed6e8bb434c180f

来自「尚学堂Java148班的spring的所有源码」· 代码 · 共 30 行

TXT
30
字号
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 = new UserManagerImpl();
		userManager.addUser(user);
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?