import ioc.injection.service.InjectionService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@RunWith(BlockJUnit4ClassRunner.class)
public class TestInjection {
private ClassPathXmlApplicationContext context;
@Test
public void testSetter() {
context = new ClassPathXmlApplicationContext("spring.xml");
InjectionService service = (InjectionService) context.getBean("injectionService");
service.save("这是要保存的数据");
}
@Test
public void testCons() {
context = new ClassPathXmlApplicationContext("spring.xml");
InjectionService service = (InjectionService) context.getBean("injectionService");
service.save("这是要保存的数据");
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
spring+junit4
共45个文件
jar:23个
class:5个
java:5个
需积分: 4 6 下载量 61 浏览量
2015-04-01
13:27:37
上传
评论
收藏 6.37MB ZIP 举报
温馨提示
使用spring 和junit的一个小案例,用来了解如何使用spring和junit4。入门级
资源推荐
资源详情
资源评论
收起资源包目录
SpringDemo1.zip (45个子文件)
SpringDemo1
test
TestInjection.java 804B
.settings
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.wst.common.project.facet.core.xml 403B
org.eclipse.wst.common.component 558B
org.eclipse.wst.jsdt.ui.superType.container 49B
.jsdtscope 510B
org.eclipse.jdt.core.prefs 357B
src
ioc
injection
dao
InjectionDAOImpl.java 229B
InjectionDAO.java 104B
service
InjectionServiceImpl.java 568B
InjectionService.java 105B
spring.xml 871B
.project 1KB
WebRoot
META-INF
MANIFEST.MF 39B
WEB-INF
classes
ioc
injection
dao
InjectionDAOImpl.class 776B
InjectionDAO.class 162B
service
InjectionService.class 174B
InjectionServiceImpl.class 1KB
TestInjection.class 1KB
spring.xml 871B
lib
junit-4.10.jar 247KB
spring-test-4.0.5.RELEASE.jar 439KB
spring-tx-4.0.5.RELEASE.jar 242KB
spring-jms-4.0.5.RELEASE.jar 206KB
spring-websocket-4.0.5.RELEASE.jar 271KB
spring-orm-4.0.5.RELEASE.jar 358KB
spring-jdbc-4.0.5.RELEASE.jar 415KB
spring-aspects-4.0.5.RELEASE.jar 51KB
spring-web-4.0.5.RELEASE.jar 657KB
spring-context-4.0.5.RELEASE.jar 954KB
spring-aop-4.0.5.RELEASE.jar 344KB
spring-messaging-4.0.5.RELEASE.jar 262KB
spring-webmvc-4.0.5.RELEASE.jar 647KB
spring-beans-4.0.5.RELEASE.jar 654KB
spring-core-4.0.5.RELEASE.jar 953KB
spring-instrument-tomcat-4.0.5.RELEASE.jar 10KB
spring-context-support-4.0.5.RELEASE.jar 132KB
spring-oxm-4.0.5.RELEASE.jar 79KB
commons-logging-1.1.jar 52KB
spring-framework-bom-4.0.5.RELEASE.jar 6KB
spring-webmvc-portlet-4.0.5.RELEASE.jar 171KB
spring-instrument-4.0.5.RELEASE.jar 7KB
spring-expression-4.0.5.RELEASE.jar 200KB
index.jsp 829B
.classpath 4KB
共 45 条
- 1
资源评论
藏红
- 粉丝: 101
- 资源: 50
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功