spring
lavender136
这个作者很懒,什么都没留下…
展开
-
spring自动任务
<!-- 每1分钟触发一次 --> <bean id="retryTaskWork" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="retryTask"/&g原创 2018-10-09 19:50:56 · 86 阅读 · 0 评论 -
单测H2
概述 Dbunit是一个基于JUnit的数据库集成测试框架。DBUnit 的设计理念就是在测试之前,给对象数据库植入我们需要的准备数据,最后,在测试完毕后,回溯到测试前的状态;它使数据库在测试过程之间处于一种已知状态,如果一个测试用例对数据库造成了破坏性影响,它可以帮助避免造成后面的测试失败或者给出错误结果。 Spring Test DbUnit提供了Spring T...转载 2018-11-29 21:43:54 · 725 阅读 · 0 评论 -
常用的工具类
org.springframework.util.StringUtils <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> com.google.common.cache.Cache原创 2018-12-13 10:51:14 · 96 阅读 · 0 评论 -
spring配置文件
<context:property-placeholder location="classpath:cfg.properties,classpath:cfg2.properties"/>原创 2018-10-30 18:48:20 · 83 阅读 · 0 评论 -
获取spring容器的几种方式
// classpath:META-INF/spring/spring-config.xml private static ApplicationContext buildApplicationContext(String springConfigPath) { DefaultResourceLoader resourceLoader = new DefaultResourceLoade...原创 2018-10-30 17:33:58 · 1136 阅读 · 0 评论 -
AbstractGenericHttpMessageConverter
<mvc:annotation-driven> <mvc:message-converters> <bean class="com.showe.MyMessageConverter"/> </mvc:message-converters> </mvc:annotation-driven> import...原创 2018-10-10 14:46:02 · 1440 阅读 · 0 评论 -
Mock
初识 Mockito 这个测试框架后,我们要使用 Mock 的属性创建一个被测试类实例时,大概会下面这么纯手工来打造。 假定类 MyService 有一个属性 MyRepository myRepository: @Repository public class MyRepository { public void doSomething() { System.o...转载 2018-12-01 23:44:41 · 486 阅读 · 0 评论