add test case of basic type constructing

This commit is contained in:
金戟 2021-05-21 00:25:02 +08:00
parent ea4c6c5b3e
commit fcbdb7275b

View File

@ -1,5 +1,6 @@
package com.alibaba.testable.core.tool;
import com.alibaba.testable.core.model.LogLevel;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
@ -13,4 +14,12 @@ class OmniConstructorTest {
assertEquals(1, demoParent.c.gc.get());
}
@Test
public void should_handle_basic_types() {
assertEquals(0, OmniConstructor.newInstance(int.class));
assertEquals(0L, OmniConstructor.newInstance(Long.class));
assertEquals("", OmniConstructor.newInstance(String.class));
assertEquals(LogLevel.DISABLE, OmniConstructor.newInstance(LogLevel.class));
}
}