package test.service;
import static org.junit.Assert.assertNotNull;
import net.sourceforge.stripes.action.ActionBeanContext;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.chansh.myweb.persistence.UserMapper;
import com.chansh.myweb.service.UserService;
import com.chansh.myweb.web.actions.WelcomeActionBean;
@ContextConfiguration(locations = { "classpath:applicationContext.xml"})
public class WelcomeActionBeanTest extends AbstractJUnit4SpringContextTests {
private WelcomeActionBean wab;
@Autowired
public UserMapper userMapper;
private UserService userSvc;
@Before
public void setUp() throws Exception {
userSvc = (UserService) (new ClassPathXmlApplicationContext("classpath:applicationContext.xml")).getBean("userService");
wab = new WelcomeActionBean();
wab.setUserSvc(userSvc);
assertNotNull(userSvc);
}
@Test
public void test() {
wab.setUsername("chansh");
wab.setContext(new ActionBeanContext());
wab.viewMain();
//assertEquals("/WEB-INF/pages/main.jsp",wab.viewMain().getPath());
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
mybatis+spring+springtest
共64个文件
jar:24个
java:8个
class:8个
4星 · 超过85%的资源 需积分: 6 29 下载量 165 浏览量
2012-07-30
07:32:37
上传
评论 2
收藏 6.45MB RAR 举报
温馨提示
mybatis+spring+springtest 求ActionBean的ut测试
资源推荐
资源详情
资源评论
收起资源包目录
mybatis_spr.rar (64个子文件)
mybatis_spr
webapp
META-INF
MANIFEST.MF 39B
WEB-INF
web.xml 2KB
pages
main.jsp 420B
user
mycenter.jsp 380B
error.jsp 372B
lib
spring-expression-3.0.5.RELEASE.jar 166KB
org.springframework.test-3.0.5.RELEASE.jar 200KB
spring-asm-3.0.5.RELEASE.jar 52KB
spring-context-3.0.5.RELEASE.jar 653KB
log4j-1.2.16.jar 470KB
aopalliance-1.0.jar 4KB
asm-3.1.jar 42KB
mysql-connector-java-5.1.13-bin.jar 750KB
cglib-2.2.jar 272KB
stripes-1.5.6.jar 525KB
hsqldb-1.8.0.10.jar 690KB
spring-jdbc-3.0.5.RELEASE.jar 377KB
commons-logging-1.1.1.jar 59KB
spring-tx-3.0.5.RELEASE.jar 226KB
mybatis-3.0.5.jar 620KB
spring-aop-3.0.5.RELEASE.jar 314KB
spring-core-3.0.5.RELEASE.jar 373KB
commons-pool.jar 61KB
commons-logging-api-1.1.jar 44KB
jstl-1.2.jar 405KB
mybatis-spring-1.0.1.jar 34KB
commons-dbcp.jar 119KB
spring-web-3.0.5.RELEASE.jar 386KB
spring-beans-3.0.5.RELEASE.jar 542KB
index.jsp 454B
.settings
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.wst.common.project.facet.core.xml 345B
org.eclipse.wst.common.component 483B
org.eclipse.wst.jsdt.ui.superType.container 49B
.jsdtscope 499B
org.eclipse.jdt.core.prefs 364B
src
StripesResources.properties 0B
test
service
WelcomeActionBeanTest.java 1KB
BasicTest.java 340B
UserServiceTest.java 886B
jdbc.properties 0B
log4j.properties 391B
com
chansh
myweb
interceptor
persistence
UserMapper.java 361B
UserMapper.xml 992B
domain
User.java 814B
web
actions
WelcomeActionBean.java 1KB
AbstractActionBean.java 757B
service
UserService.java 1KB
utils
applicationContext.xml 3KB
.project 1KB
.classpath 912B
build
classes
StripesResources.properties 0B
test
service
UserServiceTest.class 2KB
WelcomeActionBeanTest.class 2KB
BasicTest.class 522B
jdbc.properties 0B
log4j.properties 391B
com
chansh
myweb
interceptor
persistence
UserMapper.class 458B
UserMapper.xml 992B
domain
User.class 1KB
web
actions
AbstractActionBean.class 1KB
WelcomeActionBean.class 2KB
service
UserService.class 2KB
utils
applicationContext.xml 3KB
共 64 条
- 1
资源评论
- rony_zhang2012-08-05不错,不过就是不全面。
我王大爷
- 粉丝: 0
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功