This commit is contained in:
Looly
2021-09-09 11:53:11 +08:00
parent 57c191fe1c
commit 5be6c0103b
4 changed files with 52 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
package cn.hutool.core.exceptions;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.io.IORuntimeException;
import org.junit.Assert;
import org.junit.Test;
@@ -34,4 +35,15 @@ public class ExceptionUtilTest {
IOException ioException1 = ExceptionUtil.convertFromOrSuppressedThrowable(argumentException, IOException.class, true);
Assert.assertNotNull(ioException1);
}
@Test
public void bytesIntConvertTest(){
final String s = Convert.toStr(12);
final int integer = Convert.toInt(s);
Assert.assertEquals(12, integer);
final byte[] bytes = Convert.intToBytes(12);
final int i = Convert.bytesToInt(bytes);
Assert.assertEquals(12, i);
}
}