• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

子把瓢总

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

Spring学习笔记之Testing

测试嘛,一般也就两种,一种就是单元测试,另外一个就是集成测试。都是废话

一、单元测试

以前也就是搞个模拟,main函数一写搞定。

现在呢,有了个spring,也有了个推荐规范?这个是个什么东西?什么叫干净的分层,什么叫部件化的代码?

基于IOC的的应用时什么样子的?action里边也需要注入么?

那从哪制造模拟对象呢?org.springframework.mock.env 这个包提供的。

这包到底提供了啥?MockEnvironment 和MockPropertySource ,这些玩意主要就是解决与环境相关属性的

 

org.springframework.mock.jndi        ----------------JNDI

org.springframework.mock.web      ----------------Servlet API

org.springframework.mock.web.portlet  --------------Portlet API

org.springframework.test.util  -------------------General utilities

org.springframework.test.web    ----------------------ModelAndViewAssert

    二、集成测试

      The correct wiring of your Spring IoC container contexts.

    1. To manage Spring IoC container caching between test execution.
    2. To provide Dependency Injection of test fixture instances.
    3. To provide transaction management appropriate to integration testing.
    4. To supply Spring-specific base classes that assist developers in writing integration tests

    .

      posted on 2014-12-11 21:59  子把瓢总  阅读(310)  评论(0)    收藏  举报

      刷新页面返回顶部
       
      博客园  ©  2004-2025
      浙公网安备 33010602011771号 浙ICP备2021040463号-3