Unitils集成

 

 

集成Spring


Unitils 提供了一些在Spring 框架下进行单元测试的特性。Spring 的一个基本特性就是,类要设计成为没有Spring 容器或者在其他容器下仍然易于进行单元测试。但是很多时候在Spring 容器下进行测试还是非常有用的。

Unitils 提供了以下支持 Spring 的特性:

ApplicationContext 配置的管理;

在单元测试代码中注入Spring 的Beans;

使用定义在Spring 配置文件里的Hibernate SessionFactory;

引用在Spring 配置中Unitils 数据源。

ApplicationContext配置

可以简单地在一个类、方法或者属性上加上@SpringApplicationContext 注解,并用Spring的配置文件作为参数,来加载Spring应用程序上下文。下面我们通过实例来介绍一下如何创建ApplicationContext。

代码清单16 14  加载Spring上下文

 

import org.junit.Test;  
import org.springframework.context.ApplicationContext;  
import org.unitils.UnitilsJUnit4;  
import org.unitils.spring.annotation.SpringApplicationContext;  
import org.unitils.spring.annotation.SpringBean;  
import com.baobaotao.service.UserService;  
import static org.junit.Assert.*;  
//①用户服务测试  
public class UserServiceTest extends UnitilsJUnit4 {  
 
//①-1 加载Spring配置文件  
    @SpringApplicationContext({"baobaotao-service.xml", "baobaotao-dao.xml"})  
    private ApplicationContext applicationContext;  
 
//①-1 加载Spring容器中的Bean  
    @SpringBean("userService")  
    private UserService userService;  
      
//①-3 测试Spring容器中的用户服务Bean  
@Test  
    public void testUserService (){  
        assertNotNull(applicationContext);  
        assertNotNull(userService.findUserByUserName("tom"));  
    }  
}  
 

 

在①-1处,通过@SpringApplicationContext 注解加载baobaotao-service.xml和baobaotaodao.xml两个配置文件,生成一个Spring应用上下文,我们就可以在注解的范围内引用applicationContext这个上下文。在①-2处,通过@SpringBean注解注入当前Spring容器中相应的Bean,如实例中加载ID为"userService"的Bean到当前测试范围。在①-3处,通过JUnit断言验证是否成功加载applicationContext和userService。Unitils加载Spring上下文的过程是:首先扫描父类的@SpringApplicationContext注解,如果找到了就在加载子类的配置文件之前加载父类的配置文件,这样就可以让子类重写配置文件和加载特定配置文件。


细心的读者可能会发现,采用这种方式加载Spring应用上下文,每次执行测试时,都会重复加载Spring应用上下文。Unitils为我们提供在类上加载Spring应用上下文的能力,以避免重复加载的问题。

代码清单16 15  通过基类加载ApplicationContext

 

@SpringApplicationContext({"baobaotao-service.xml", "baobaotao-dao.xml"})  
public class BaseServiceTest extends UnitilsJUnit4 {  
      
 //加载Spring上下文  
    @SpringApplicationContext  
    public ApplicationContext applicationContext;  
 
}  
 

 





集成Hibernate


Hibernate是一个优秀的O / R开源框架,它极大地简化了应用程序的数据访问层开发。虽然我们在使用一个优秀的O/R框架,但并不意味我们无须对数据访问层进行单元测试。单元测试仍然非常重要。它不仅可以确保Hibernate映射类的映射正确性,也可以很便捷地测试HQL查询等语句。Unitils为方便测试 Hibernate,提供了许多实用的工具类,如HibernateUnitils就是其中一个,使用assertMappingWithDatabaseConsistent()方法,就可以方便测试映射文件的正确性。


SessionFactory 配置


可以简单地在一个类、方法或者属性上加上@ HibernateSessionFactory 注解,并用Hibernate的配置文件作为参数,来加载Hibernate上下文。下面我们通过实例来介绍一下如何创建SessionFactory。


代码清单16 17  通过基类加载SessionFactory

@HibernateSessionFactory("hibernate.cfg.xml")  
public class BaseDaoTest extends UnitilsJUnit4 {  
    @HibernateSessionFactory  
    public SessionFactory sessionFactory;  
      
 
    @Test  
    public void testSessionFactory(){  
        assertNotNull(sessionFactory);  
    }  
}

   

在父类BaseDaoTest里指定了Hibernate配置文件,Hibernate应用上下文只会创建一次,然后在子类SimpleUserDaoTest里会重用这个应用程序上下文。加载Hibernate应用上下文是一个非常繁重的操作,如果重用这个Hibernate应用上下文就会大大提升测试的性能。

代码清单16 18  通过继承使用父类的SessionFactory

 

public class SimpleUserDaoTest extends BaseDaoTest {  
    private UserDao userDao;  
 
//① 初始化UserDao  
@Before  
    public void init(){  
         userDao = new WithoutSpringUserDaoImpl();  
        userDao.setSessionFactory(sessionFactory); //使用父类的SessionFactory  
    }  
 
//② Hibernate映射测试  
@Test  
    public void testMappingToDatabase() {  
        HibernateUnitils.assertMappingWithDatabaseConsistent();  
}  
 
//③ 测试UserDao  
    @Test  
    public void testUserDao(){  
        assertNotNull(userDao);  
        assertNotNull(userDao.findUserByUserName("tom"));  
        assertEquals("tom", userDao.findUserByUserName("tom").getUserName());  
    }  
}  
 

 

为了更好演示如何应用Unitils测试基于Hibernate数据访问层,在这个实例中不使用Spring框架。所以在执行测试时,需要先创建相应的数据访问层实例,如实例中的userDao。其创建过程如①处所示,先手工实例化一个UserDao,然后获取父类中创建的SessionFactory,并设置到UserDao中。在②处,使用Unitils提供的工具类HibernateUnitils中的方法测试我们的Hibernate映射文件。在③处,通过JUnit的断言验证 UserDao相关方法,看是否与我们预期的结果一致。




集成Dbunit


Dbunit是一个基于JUnit扩展的数据库测试框架。它提供了大量的类,对数据库相关的操作进行了抽象和封装。Dbunit通过使用用户自定义的数据集以及相关操作使数据库处于一种可知的状态,从而使得测试自动化、可重复和相对独立。虽然不用Dbunit也可以达到这种目的,但是我们必须为此付出代价(编写大量代码、测试及维护)。既然有了这么优秀的开源框架,我们又何必再造轮子。目前其最新的版本是2.4.8。


随着Unitils的出现,将Spring、Hibernate、DbUnit等整合在一起,使得DAO层的单元测试变得非常容易。Unitils采用模块化方式来整合第三方框架,通过实现扩展模块接口org.unitils.core.Module来实现扩展功能。在Unitils中已经实现一个DbUnitModule,很好整合了DbUnit。通过这个扩展模块,就可以在Unitils中使用Dbunit强大的数据集功能,如用于准备数据的@DataSet注解、用于验证数据的@ExpectedDataSet注解。



 

自定义扩展模块


Unitils通过模块化的方式来组织各个功能模块,对外提供一个统一的扩展模块接口org.unitils.core.Module来实现与第三方框架的集成及自定义扩展。在Unitils中已经实现目前一些主流框架的模块扩展,如Spring、Hibernate、DbUnit、Testng等。如果这些内置的扩展模块无法满足需求,我们可以实现自己的一些扩展模块。扩展Unitils模块很简单,如代码清单16-19所示。

代码清单16 19  CustomExtModule

package sample.unitils.module;  
import java.lang.reflect.Method;  
import org.unitils.core.TestListener;  
import org.unitils.core. Module;  
//① 实现Module接口  
public class CustomExtModule implements Module {  
     //② 实现获取测试监听的方法  
    public TestListener getTestListener() {  
        return new CustomExtListener();  
    }  
      
    //② 新建监听模块   
    protected class CustomExtListener extends TestListener {  
         //③ 重写 TestListener里的相关方法,完成相关扩展的功能  
        @Override  
        public void afterTestMethod(Object testObject, Method testMethod,  
                Throwable testThrowable) {  
…  
        }  

        @Override  
        public void beforeTestMethod(Object testObject, Method testMethod) {  
…  
        }  
    }  
…  
}  
 

在①处新建自定义扩展模块CustomExtModule,实现Module接口。在②处新建自定义监听模块,继承TestListener。在③处重写(@Override)TestListener里的相关方法,完成相关扩展的功能。实现自定义扩展模块之后,剩下的工作就是在Unitils配置文件unitils.properties中注册这个自定义扩展的模块:

unitils.modules=…,custom  

unitils.module. custom.className= sample.unitils.module.CustomExtModule 

 



 

Type-c超声波切割刀 接下来,我将提供Type-C超声波切割刀项目的C代码实现示例,代码将按照上述分层架构和模块化设计进行组织。为了达到3000行以上的代码量,我将尽可能详细地实现各个模块的功能,并添加必要的注释和错误处理。通过采用分层架构和模块化设计,我们可以建立一个可靠、高效、可扩展的系统平台,为产品的成功奠定坚实的基础。实际项目中,需要更详细的硬件驱动、更完善的功能模块、更严格的测试验证和更周全的维护升级计划。针对Type-C超声波切割刀这个项目,我将从以下几个方面详细阐述最适合的代码设计架构,并提供具体的C代码实现。 阅读详情

相关推荐

【Aseprite】制作Unity2D瓦片地图素材(平台游戏)

本文章用于记录用Aseprite软件制作2D平台游戏的瓦片地图的方法。

凡心所向,素履以往 5563

Unitils集成DBUnit、Spring-单元测试

  Unitils集成DBUnit、Spring-单元测试   1、maven-pom文件中引入相关jar包   <!-- Unitils -dbunit、Spring --> <dependency> <groupId>org.unitils</groupId> &...

weixin_30325793的博客 80

51单片机——LCD12864驱动函数深度解析与实战优化

本文深入解析了51单片机驱动LCD12864液晶屏的核心驱动函数,从底层时序、关键延时到地址计算进行逐行剖析,并针对常见显示问题提供系统性的调试技巧与实战优化方案。重点探讨了如何将基础代码优化为稳定高效的驱动,涵盖延时精准化、批量写入及显示缓冲区等高级技巧,旨在帮助开发者从“点亮”屏幕进阶到“精通”驱动,确保显示稳定可靠。

weixin_29190169的博客 92

Unitils集成DBUnit的问题-解决方案

Unitils集成DBUnit的问题-解决方案

jcoiwenwfkowe的博客 88

重带电粒子的能量歧离(energy straggling)

能量歧离,Bethe-Bloch

G751888629的博客 2304

从门禁到支付:Uniapp+NFC开发避坑指南(支持Mifare Classic)

本文详细介绍了Uniapp结合NFC技术开发门禁与支付系统的实战指南,特别针对Mifare Classic卡片进行深度优化。内容涵盖环境配置、设备兼容性处理、卡片安全机制解析以及高性能读写优化策略,帮助开发者快速实现跨平台的智能硬件交互解决方案。

t1u2v的博客 756

dbunit mysql bug no_Unitils集成DBUnit、Spring-单元测试

Unitils集成DBUnit、Spring-单元测试1、maven-pom文件中引入相关jar包org.unitilsunitils-dbunit3.4.2org.unitilsunitils-io3.4.2org.unitilsunitils-database3.4.2org.unitilsunitils-spring3.4.2以上Unitils集成dbunit、Spring所必须jar包,工...

weixin_39859220的博客 186

基于YOLOv5的隧道衬砌缺陷智能检测系统

计算机视觉在工程检测领域正发挥越来越重要的作用,特别是目标检测技术通过深度学习算法实现了对复杂场景的智能分析。YOLOv5作为当前主流的目标检测框架,通过改进网络结构和训练策略,可以显著提升检测精度和效率。在隧道工程领域,结合通道注意力机制和多尺度特征融合技术,能够有效解决衬砌缺陷识别中的小目标检测难题。这种AI检测系统相比传统人工判读地质雷达图像,不仅将效率提升20倍,还能将识别准确率提高到92.3%,特别适用于3cm以上结构缺陷的自动化检测。系统通过深度可分离卷积等优化,实现了模型轻量化,便于在边缘计算

weixin_29064103的博客 331

Unitils 使用指南[翻译]-和Spring的集成

  1.1.1           和Spring的集成   Unitils 也提供了对Spring框架的支持。Sping的一个基本远侧就是你的对象应该被设计成容易测试的,即使没有Spring或者其他容器。There are times however, when it can be useful to work with object structures that ...

软件生产流程和软件人员心理的思考-Alfred 187

【教培管家】小程序实战(五):体验课预约——从流量到转化的闭环

本节我们通过变量状态管理和数据联动,实现了孩子选择和日期选定。下一篇我们继续讲解预约页面,根据选择的日期来筛选排课,供用户进行预约。

低代码布道师的博客 1568

微信小程序 - {“errMsg”:”requestPayment:fail banned”} 微信小程序调用wx.requestPayment支付失败返回错误(uniapp微信小程序微信支付报错)

{“errMsg”:”requestPayment:fail banned”},微信小程序调用wx.requestPayment报错requestPayment:fail banned,uni-app微信小程序wx.requestPayment支付报错requestPayment:fail banned,拉起小程序支付报错,iPhone苹果ios真机微信支付报错,Android安卓手机微信支付报错,支付报错,商户配置,签名验证,uniapp 小程序支付微信支付一场,设置过b2b类目,确认了商户号相关功能正常

🏆 前端领域优质创作者 3373

TMS320F280049C点灯例程详解:从系统时钟到GPIO初始化

在嵌入式开发中,点亮一颗LED常被视为入门的第一步,但背后却串联着处理器启动流程、系统时钟配置、PLL倍频以及GPIO复用与方向控制等一系列基础而关键的环节。对于C2000系列DSP而言,系统时钟(SYSCLK)由内部振荡器经PLL倍频与分频得到,它决定了CPU和外设的时序基准;而GPIO引脚需要显式配置复用功能与输入输出方向,才能真正输出预期的电平信号。理解这些原理,不仅有助于快速定位延时异常、程序跑飞、引脚无响应等工程问题,也是后续开发PWM、ADC、通信接口等复杂外设的能力基础。本文以TMS320F2

weixin_33835103的博客 345

题解:洛谷 P14357 [CSP-J 2025] 拼数

等知名刷题平台精心挑选而来,并结合各平台提供的算法标签和难度等级进行了系统分类。题目涵盖了从基础到进阶的多种算法和数据结构,旨在为不同阶段的编程学习者提供一条清晰、平稳的学习提升路径。小 R 想知道,在他所有能拼成的正整数中,最大的是多少。你需要帮助小 R 求出他能拼成的正整数的最大值。小 X 给了小 R 一个字符串。输出一行一个正整数,表示小 R 能拼成的正整数的最大值。中的任意多个数字,按任意顺序拼成一个正整数。,表示小 X 给小 R 的字符串。#普及-# #其他排序#洛谷:[P14357。

团爸讲算法 1402

Unitils集成DBUnit、Spring-单元测试(转)

1、maven-pom文件中引入相关jar包   <!-- Unitils -dbunit、Spring --> <dependency> <groupId>org.unitils</groupId> <artifactId>unitils-dbunit&lt...

weixin_30352645的博客 119

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

【让开发自动化】Unitils集成Feed4junit

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34072857的博客 261

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

dbunit mysql_unitils集成dbunit与MySQL的NoSuchColumnException问题

org.unitils.core.UnitilsException: Error inserting test data from DbUnit dataset for method public void com.smart.dao.UserDaoTest.findUserByUserName()at org.unitils.dbunit.DbUnitModule.insertDataSet(D...

weixin_35698069的博客 428

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

[Unitils]初识Unitils

http://www.unitils.org/summary.html# Summary Unitils is an open source library aimed at making unit and integration testing easy and maintainable. It is divided into several modules, each of th...

自娱《测试开发》专栏 163

单元测试三叉戟—JUNIT,DBUNIT,UNITILS

在Java单元测试领域,JUNIT一直各位开发人员和测试人员的最佳选择,它不仅提供了很多标准的API,同时很多IDE也对它提供了运行环境支持。特别是JUNIT4以后,引入了Java annotation的方式,进一步规范了测试脚本的结构,使测试脚本在原有的框架下更加灵活。DBUNIT是一款基于JAVA的数据库维护工具,让在单元测试中使数据库中的数据维护透明化成为可能。UNITILS是一

phphot 3037

unitils 测试框架介绍(一)

Junit 是用于自动化测试Java代码的框架,而Unitils是测试整合之王,目的是 让单元测试更加容易和可维护,Unitils构建在DbUnit与EasyMock 项目之上并与JUnit和TestNG相结合,支持数据库测试,支持利用Mock对象进行测试并提供与Spring和Hibernate相集成。Unitils模块组件有一下组成: 1、unitils-core: 核心内核包 2、unitils-dat...

lgxzzz的博客 588
上一篇: Unitils概述
下一篇: Linux 系统命令及其使用详解
gufengjava
博客等级 码龄16年 1粉丝 59原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址