资源简介
网上书城、传智播客、ssh2改写、完美运行!
代码片段和文件信息
package com.test;
import java.util.List;
import javax.mail.MessagingException;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathxmlApplicationContext;
import _cn.uuid.Uuid;
import _com.GoodsMenu.action.GoodsMenuAction;
import _com.GoodsMenu.bean.GoodsMenu;
import _com.GoodsMenu.service.GoodsMenuInetrface;
import _com.admin.bean.Admin;
import _com.admin.serviceinterface.AdminServiceInterface;
import _com.goods.bean.Book;
import _com.goods.serviceInterface.BookServiceInterface;
import _com.user.bean.User;
import _com.user.serviceinterface.UserServiceInterface;
public class SpingTest {
public static UserServiceInterface userServiceInterface;
public static BookServiceInterface bookServiceInterface;
public static AdminServiceInterface adminServiceInterface;
public static GoodsMenuInetrface goodsMenuInetrface;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
try {
ApplicationContext applicationContext = new ClassPathxmlApplicationContext(“applicationContext.xml“);
userServiceInterface = (UserServiceInterface) applicationContext.getBean(“userService“);
bookServiceInterface = (BookServiceInterface) applicationContext.getBean(“bookService“);
adminServiceInterface = (AdminServiceInterface)applicationContext.getBean(“adminService“);
goodsMenuInetrface = (GoodsMenuInetrface)applicationContext.getBean(“goodsMenuService“);
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void testGetUser(){
String name =“zhangSan“;
User user= userServiceInterface.getUserByName(name);
System.out.println(user.getEmail()+“--“+user.getLoginpass());
}
@Test
public void testGetEmail(){
String email =“itcast_cxf@qq.com“;
User user= userServiceInterface.getUserByEmail(email);
System.out.println(user.getLoginname()+“--“+user.getLoginpass());
}
@Test
public void testRegist() throws MessagingException{
User user= new User();
userServiceInterface.regist(user);
}
@Test
public void testLogin(){
User user = new User();
user.setLoginname(“zhangsan“);
User user1 = userServiceInterface.login(user);
System.out.println(user1.getLoginname()+“ “+user1.getLoginpass());
}
@Test
public void testGetGoodsMenu2(){
GoodsMenuInetrface goodsMenuInetrface = null;
try {
ApplicationContext applicationContext = new ClassPathxmlApplicationContext(“applicationContext.xml“);
goodsMenuInetrface = (GoodsMenuInetrface) applicationContext.getBean(“goodsMenuService“);
} catch (Exception e) {
e.printStackTrace();
}
GoodsMenu goodsMenu = new GoodsMenu();
List list = goodsMenuInetrface.getGoodsMenu2(“3“);
for (GoodsMenu m : list) {
goodsMenu= m;
System.out.println(goodsMenu.getCid()+goodsMenu.getCname());
}
}
@Test
public void testFindAll(){
GoodsMenuAct
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1619 2015-04-07 14:31 goods\.classpath
文件 536 2015-04-07 13:33 goods\.myhibernatedata
文件 288 2015-04-23 12:59 goods\.myme
文件 240 2015-04-07 14:31 goods\.mystrutsdata
文件 2241 2015-04-07 14:31 goods\.project
文件 500 2014-02-24 15:26 goods\.settings\.jsdtscope
文件 111 2015-04-12 22:26 goods\.settings\com.genuitec.eclipse.core.prefs
文件 395 2014-02-24 15:26 goods\.settings\org.eclipse.jdt.core.prefs
文件 534 2015-04-07 13:37 goods\.settings\org.eclipse.wst.common.component
文件 252 2014-02-24 15:26 goods\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2014-02-24 15:26 goods\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2014-02-24 15:26 goods\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 462 2015-04-07 13:02 goods\.springBeans
文件 3932 2015-04-23 19:27 goods\junit.Test\com\test\SpingTest.java
文件 4806 2015-05-01 20:56 goods\src\applicationContext.xm
文件 377 2015-04-08 13:14 goods\src\email_template.properties
文件 118264 2014-02-24 15:26 goods\src\goods.sql
文件 391 2015-04-07 13:33 goods\src\hibernate.cfg.xm
文件 205 2015-04-07 13:04 goods\src\jdbc.properties
文件 1543 2015-04-07 13:04 goods\src\log4j.properties
文件 150 2015-04-19 12:54 goods\src\payment.properties
文件 4767 2015-05-01 21:30 goods\src\struts.xm
文件 180 2015-04-30 11:18 goods\src\_cn\uuid\Uuid.java
文件 1060 2015-04-21 16:22 goods\src\_com\admin\action\AdminAction.java
文件 683 2015-04-20 23:17 goods\src\_com\admin\bean\Admin.java
文件 914 2015-04-21 15:57 goods\src\_com\admin\service\AdminService.java
文件 176 2015-04-21 15:47 goods\src\_com\admin\serviceinterface\AdminServiceInterface.java
文件 3074 2015-04-12 21:27 goods\src\_com\cart\action\CartAction.java
文件 1566 2015-04-12 17:18 goods\src\_com\cart\bean\Cart.java
文件 444 2015-04-12 21:27 goods\src\_com\cart\cartserviceinterface\CartServiceInterface.java
............此处省略819个文件信息
- 上一篇:PageRefresh
- 下一篇:Unity_实现残影
评论
共有 条评论