本月博客排行
-
第1名
duanfei -
第2名
benladeng5225 -
第3名
steven789654 - wddpwzzhao123
年度博客排行
-
第1名
龙儿筝 -
第2名
宏天软件 -
第3名
wy_19921005 - benladeng5225
- kaizi1992
- tanling8334
- vipbooks
- sam123456gz
- arpenker
- zysnba
- fantaxy025025
- wallimn
- e_e
- jh108020
- ganxueyun
- Xeden
- xyuma
- wangchen.ily
- zhanjia
- johnsmith9th
- zxq_2017
- forestqqqq
- jbosscn
- daizj
- xiangjie88
- xpenxpen
- 喧嚣求静
- lchb139128
- kristy_yy
- javashop
- lzyfn123
- sunj
- yeluowuhen
- ajinn
- lerf
- lemonhandsome
- chenqisdfx
- xiaoxinye
- flashsing123
- lyndon.lin
- bosschen
- zhangjijun
- sunnylocus
- lyj86
- paulwong
- sgqt
- hudiemeng870329
- 青否云后端云
- mft8899
- duanfei
最新文章列表
Java IO 之System类及其它
System类管理标准输入输出流和错误流
一、使用System.out作为输出流
package cn.sisy.io;
import java.io.*;
public class SystemDemo01 {
public static void main(String[] args)throws Exception {
//抽象类通过子类实现不同的功能
Outpu ...
java实现从键盘接收一个输入字符
public static void main(String[] args) throws IOException {
char ch = (char)System.in.read();
char state = ' ';
switch (ch) {
case 'a':
state = ...
使用jmock测试System.in和System.out
本文要求读者已具备juit和jmock基础
在TDD过程中需要测试代码中的System.in和System.out。
技术难点包括
1、mock宿主还原
2、inout参数的行为模拟
3、mock system.in和out
1、测试主体
@Service
class ConsoleManagerBizImpl{
private static Logger LOGGER ...