重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

spring项目中怎么实现单元测试

本篇文章给大家分享的是有关spring项目中怎么实现单元测试,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。

创新互联公司2013年成立,是专业互联网技术服务公司,拥有项目成都网站设计、网站建设网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元阿荣做网站,已为上家服务,为阿荣各地企业和个人服务,联系电话:18982081108

import org.junit.Test;import org.junit.runner.RunWith;import org.springframework.test.context.ContextConfiguration;import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;@RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration(locations={    "classpath:application-context.xml",    "classpath:application-database.xml",    "classpath:application-redis.xml"})public class PartRelevanceTest {@Resource  private PartRelevanceMapper partRelevanceMapper;@Test  public void selectTypeNumOne() {PartRelevanceTypeNum record = new PartRelevanceTypeNum();record.setRelCode("2222112");record.setType("2");PartRelevanceTypeNum typeNum = partRelevanceMapper.selectTypeNumOne(record);System.out.println(typeNum==null?"typeNum-数据为空":typeNum.toString());}}

以上就是spring项目中怎么实现单元测试,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注创新互联行业资讯频道。


文章标题:spring项目中怎么实现单元测试
本文URL:http://cqcxhl.cn/article/ipdjpj.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP