zoukankan      html  css  js  c++  java
  • Spring基于注解TestContext 测试框架使用问题

    import cn.itcast.mybatis.pojo.User;
    
    import org.junit.Test;
    import org.junit.runner.RunWith;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.test.context.ContextConfiguration;
    import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests;
    import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
    
    @RunWith(SpringJUnit4ClassRunner.class)
    @ContextConfiguration({"classpath*:mybatis-config2.xml"}) //载入配置xml文件
    public class UserMapperTest3 extends   AbstractTransactionalJUnit4SpringContextTests {
    	@Autowired
    	private UserMapper userMapper;
    
        @Test
        public void testQueryUserByUserNameAndPassword() {
            User user = this.userMapper.queryUserByUserNameAndPassword("zw", "2");
            System.out.println(user);
        }
    }
    

     注:http://blog.csdn.net/yaerfeng/article/details/25368447

  • 相关阅读:
    移动端调试解决方案-转载
    移动端调试工具-Weinre
    css颜色大全-转载
    目录
    多版本python import 问题解决方案
    annoy安装
    word2vec
    GBDT
    Adaptive Boosting
    融合模型Aggregation
  • 原文地址:https://www.cnblogs.com/zy2009/p/6606743.html
Copyright © 2011-2022 走看看