zoukankan      html  css  js  c++  java
  • java使用Test测试接口类

    package com.jy.demo.web;
    
    import java.util.Map;
    
    import org.junit.BeforeClass;
    import org.junit.Test;
    import org.springframework.context.support.ClassPathXmlApplicationContext;
    
    import com.jy.modules.client.service.MainDataService;
    
    public class InterfaceTest {
        private static MainDataService mainDataService;
        
          @BeforeClass
            public static void setUpBeforeClass() throws Exception {
                ClassPathXmlApplicationContext ct=new ClassPathXmlApplicationContext("spring-base.xml");//取到系统核心配置文件
                mainDataService=ct.getBean("com.jy.modules.client.service.MainDataService",MainDataService.class);//从bean工程获取接口bean
            }
        
          @Test
    //调用接口
    public void testInterface2001(){ Map<String, String> map = null; try { map = mainDataService.searchCustInfoByCr("CR20150500000153"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
  • 相关阅读:
    毕设进度28
    任务27
    任务26
    任务25
    任务24
    第二次冲刺
    课堂作业-搜狗输入法
    课堂作业-寻找水王
    博客花园典型用户和场景
    第十天
  • 原文地址:https://www.cnblogs.com/yy123/p/5098781.html
Copyright © 2011-2022 走看看