博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
shell脚本的桩
阅读量:6897 次
发布时间:2019-06-27

本文共 710 字,大约阅读时间需要 2 分钟。

项目代码:
alias book_search="/usr/local/mysql/bin/mysql -h 172.18.12.202 -uppstat -pstatpp book_search"echo "select id,cpname from search_cp_infomation where hide=1;" | book_search -s > $cpFile
使用打桩代码
alias book_search="/home/lishujun/src/mockobject/book_search"echo "select id,cpname from search_cp_infomation where hide=1;" | book_search -s > $cpFile

预置的桩 book_search 通过标准输出打印出从12.208上拿回的真实数据,这样程序可以暂时在没有数据库的情况下执行逻辑,目前打桩之后程序可以运行

 
桩代码:
#!/bin/bash sql="select id,cpname from search_cp_infomation where hide=1;" while read linedo        #echo "$line"        if [ "$line" == "$sql" ] ; then                cat "/home/lishujun/src/mockobject/cplist"        fidone

 

转载于:https://www.cnblogs.com/code-style/p/3228390.html

你可能感兴趣的文章
东大oj-1591 Circle of friends
查看>>
动态IP无法获取默认网关,显示0.0.0.0的解决办法
查看>>
课本[Teb]软件设计
查看>>
[原创]推荐一些在线API生成工具
查看>>
unity5, UI Button "On Button Down"
查看>>
基于注解Spring MVC综合Hibernate(需要jar包,spring和Hibernate整合配置,springMVC组态,重定向,)批量删除...
查看>>
使用命令行备份指定文件夹并保留最新N份
查看>>
关于软件测试人员能力模型的建立(from知乎)
查看>>
匿名管道
查看>>
多线程——继承Thread类别
查看>>
file_operations结构体解析 1
查看>>
表格中的正文如何排版?
查看>>
解决Mac OS下安装MyEclipse报错:Your system does not have sufficient memory to support MyEclipse...
查看>>
让Ecshop网店系统用户自动登陆
查看>>
UVA 1291 Dance Dance Revolution(DP)
查看>>
WCF 数据服务 4.5
查看>>
java14 处理流
查看>>
数据挖掘相关概念
查看>>
HDU2159 研发费用背包
查看>>
OpenGL ES2.0入门详解
查看>>