mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add class
This commit is contained in:
@@ -9,6 +9,8 @@ import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicIntegerArray;
|
||||
import java.util.concurrent.atomic.AtomicLongArray;
|
||||
|
||||
/**
|
||||
* 类型转换工具单元测试
|
||||
@@ -222,6 +224,20 @@ public class ConvertTest {
|
||||
Assert.assertEquals("5.1.1", product.getVersion());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void toAtomicIntegerArrayTest(){
|
||||
String str = "1,2";
|
||||
final AtomicIntegerArray atomicIntegerArray = Convert.convert(AtomicIntegerArray.class, str);
|
||||
Assert.assertEquals("[1, 2]", atomicIntegerArray.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void toAtomicLongArrayTest(){
|
||||
String str = "1,2";
|
||||
final AtomicLongArray atomicLongArray = Convert.convert(AtomicLongArray.class, str);
|
||||
Assert.assertEquals("[1, 2]", atomicLongArray.toString());
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static class Product implements Serializable {
|
||||
|
@@ -0,0 +1,15 @@
|
||||
package cn.hutool.core.convert;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class StringConvertTest {
|
||||
|
||||
@Test
|
||||
public void timezoneToStrTest(){
|
||||
final String s = Convert.toStr(TimeZone.getTimeZone("Asia/Shanghai"));
|
||||
Assert.assertEquals("Asia/Shanghai", s);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user