mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -7,6 +7,7 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.SneakyThrows;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
@@ -71,6 +72,7 @@ public class LambdaFactoryTest {
|
||||
* @author nasodaengineer
|
||||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
@Ignore
|
||||
public static class PerformanceTest {
|
||||
|
||||
@Parameterized.Parameter
|
||||
@@ -140,6 +142,7 @@ public class LambdaFactoryTest {
|
||||
@SuppressWarnings({"rawtypes", "unchecked", "Convert2MethodRef"})
|
||||
@Test
|
||||
@SneakyThrows
|
||||
@Ignore
|
||||
public void lambdaGetPerformanceTest() {
|
||||
final Something something = new Something();
|
||||
something.setId(1L);
|
||||
@@ -216,6 +219,7 @@ public class LambdaFactoryTest {
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Test
|
||||
@SneakyThrows
|
||||
@Ignore
|
||||
public void lambdaSetPerformanceTest() {
|
||||
final Something something = new Something();
|
||||
something.setId(1L);
|
||||
|
@@ -348,4 +348,23 @@ public class XmlUtilTest {
|
||||
|
||||
Console.log(XmlUtil.format(doc));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void xmlStrToBeanTest(){
|
||||
final String xml = "<user><name>张三</name><age>20</age><email>zhangsan@example.com</email></user>";
|
||||
final Document document = XmlUtil.readXML(xml);
|
||||
final UserInfo userInfo = XmlUtil.xmlToBean(document, UserInfo.class);
|
||||
Assert.assertEquals("张三", userInfo.getName());
|
||||
Assert.assertEquals("20", userInfo.getAge());
|
||||
Assert.assertEquals("zhangsan@example.com", userInfo.getEmail());
|
||||
}
|
||||
|
||||
@Data
|
||||
static class UserInfo {
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String age;
|
||||
private String email;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user