小编Raj*_*Raj的帖子

如何测试junit中是否抛出并捕获异常

我需要测试以下代码:

try{
   while((testBean = csvReader.read(TestBean.class,headers,getCellProcessors()))!=null){
      System.out.println("no excpetion");
      i=5;
   }
}catch(SuperCsvException csvExc){
   System.out.println("superCSV excpetion");
   i=0;
}catch(Exception ex){
   System.out.println("excpetion");
   i=0;
}
Run Code Online (Sandbox Code Playgroud)

如何测试是否SuperCsvException被抛出和被捕获。

java junit

1
推荐指数
1
解决办法
1万
查看次数

无法使用curl 在 RHEL 6.10 上安装 Rust

我尝试使用curl 在 RHEL 6.10 上安装 rust 1.48 并收到以下错误

info: downloading installer
Cannot execute /tmp/tmp.ShsTMGuMqK/rustup-init (likely because of mounting /tmp as noexec).
Please copy the file to a location where you can execute binaries and run ./rustup-init.
Run Code Online (Sandbox Code Playgroud)

这是我安装 Rust 的命令

curl --insecure -sSf -o $HOME/rust/rustup-init https://sh.rustup.rs
chmod +x $HOME/rust/rustup-init
./$HOME/rust/rustup-init -s -y --default-toolchain 1.48
Run Code Online (Sandbox Code Playgroud)

我发现这个https://github.com/rust-lang/rust/issues/39771但它不起作用。我的 $HOME 目录也有写权限

rust rust-cargo

0
推荐指数
1
解决办法
1212
查看次数

标签 统计

java ×1

junit ×1

rust ×1

rust-cargo ×1