当前位置:网站首页>JUnit exception, a method that asserts that the exception information is not empty
JUnit exception, a method that asserts that the exception information is not empty
2022-06-12 14:44:00 【Micro blog】
@Test
publicvoid alloc3(){
Exception ex =null;
try{
ParentTest.client.alloc(ns1);
}catch(Exception e){
// TODO Auto-generated catch block
e.printStackTrace();
ex=e;
StringWriter sw =newStringWriter();
PrintWriter pw =newPrintWriter(sw);
e.printStackTrace(pw);
String msg = sw.toString();
String exp ="Unable to get the corresponding sharding information according to namespace";
Assert.assertNotEquals(-1, msg.indexOf(exp));
}
finally{
Assert.assertNotNull(ex);
}
}
come from <http://lxw198902165221.blog.163.com/blog/static/258950022201711794136242/>
边栏推荐
- Nesting of C language annotations
- C secret script Chapter 1: data storage (in-depth analysis) supplement
- 【MySQL】数据库基本操作
- 三维重建系统 | L3双视角运动恢复结构(SFM双目SFM)
- Player practice 18 xresample
- Module VIII
- Simple code implementation of addition, subtraction, multiplication and division calculator
- 你敢信?开发一个管理系统我只用了两天
- Ppt cannot be opened, always prompt how to fix it
- Appnium (I) basic use of appnium
猜你喜欢

QT multi thread drawing and real-time refreshing method

Ankai microelectronics rushes to the scientific innovation board: the annual revenue of 500million Xiaomi industry fund is the shareholder

MAT的安装和使用

你敢信?开发一个管理系统我只用了两天

面向优化科学研究领域的软件包

Ali suggests that all POJO attributes use wrapper classes, but have you noticed these pits?
![[wechat applet] 3 The first wechat applet](/img/40/1571c11363e72f5a1e932586a1f240.jpg)
[wechat applet] 3 The first wechat applet

Copy word content to excel and automatically divide it into multiple columns

Player actual combat 25 unpacking module add close

Appnium (II) installation and basic use of mitmproxy
随机推荐
Player practice 17 xvideowidget
Xshell (I) is missing mfc110u DLL file resolution
Thinking: what is asynchrony and thread safety
New technology: efficient self-monitoring visual pre training, local occlusion no longer need to worry!
Soft test (VI) Chrome browser installation selenium IDE
jenkins相关
C secret arts script Chapter 5 (structure) (Section 2)
JS (II) syntaxerror: cannot use import statement outside a module
Markdown edit
Location (I) error: command erred out with exit status
Appnium (II) installation and basic use of mitmproxy
[datetmeformatter] realize the conversion between localdatetime and text
[wechat applet] 3 The first wechat applet
Huawei equipment configuration BGP as number replacement
【Instant】1. Equivalent to date class 2 Represents a moment
对某热水软件的加密参数逆向
Use Baidu AIP to obtain the text in the specified area of the screen
基于TensorRT的深度学习模型部署实战教程!
Mysql之索引和视图
QT database realizes page turning function