当前位置:网站首页>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/>
边栏推荐
- 程序构造和解释之过程抽象
- 【LocalDate LocalTime LocalDateTime】1. Using immutability to achieve thread safety 2 Current date, current time, current date time 3 Since the time zone is not considered, you need to add 8 hours to th
- ADB command (I) record
- 你敢信?开发一个管理系统我只用了两天
- Markdown edit
- Reverse order of Excel
- Nesting of C language annotations
- Recursive summary of learning function
- Dataset and dataframe in sparksql
- 【OCR】AspriseOCR C# 英文、数字识别(中文不行)
猜你喜欢

【LDA】EM变分推理 粗略版笔记【待完善

Analysis of two-dimensional array passing as function parameter (C language)

C語言中主函數調用另外一個函數,匯編代碼理解

Copy word content to excel and automatically divide it into multiple columns
![[wechat applet] 6.1 applet configuration file](/img/8c/eadaa6d0cadde459c3f817a23303ea.jpg)
[wechat applet] 6.1 applet configuration file
![[wechat applet] 4 Introduction to wechat developer tools](/img/9d/0d6c5cc675fb70dde98b25649bd8d8.jpg)
[wechat applet] 4 Introduction to wechat developer tools

En langage C, la fonction principale appelle une autre fonction et assemble le Code pour comprendre

基于TensorRT的深度学习模型部署实战教程!

亿纬锂能拟募资90亿:刘金成骆锦红夫妇合计认购60亿 布局光谷

JS (II) syntaxerror: cannot use import statement outside a module
随机推荐
【OCR】AspriseOCR C# 英文、數字識別(中文不行)
Producers (send syncask requests) and consumers (with xxxask monitoring and Implementation)
Nesting of C language annotations
阿里建议所有 POJO 类属性使用包装类,但这些坑你有注意到吗?
【LDA】LDA主题模型笔记—主要是狄利克雷
华为设备配置H虚拟专用网
C secret arts script Chapter 2 (detailed explanation of pointer) (Section 1)
Player practice 26 adding slider and window maximization
Introduction to functions (inline functions and function overloading)
Leader education was forced to be delisted: Softbank CMC suffered heavy losses only one year after listing
Location (I) error: command erred out with exit status
recursive learning
Recursive summary of learning function
Printing colored messages on the console with printf
JMeter (V) pressure test of Excel file upload interface
【MySQL】数据库基本操作
En langage C, la fonction principale appelle une autre fonction et assemble le Code pour comprendre
C secret script Chapter 3 (detailed explanation of string function) (Section 2)
How to package QT program learning records with inno setup
【OCR】AspriseOCR C# 英文、数字识别(中文不行)