mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
JavaSourceCompilerTest
This commit is contained in:
parent
dc74b829a4
commit
ccc316ee8c
@ -22,6 +22,7 @@
|
|||||||
* 【core 】 修复ReflectUtil.invokeRaw方法中参数类型转换动作未生效的问题(pr#2912@Github)
|
* 【core 】 修复ReflectUtil.invokeRaw方法中参数类型转换动作未生效的问题(pr#2912@Github)
|
||||||
* 【core 】 修复isXXX转换时的匹配问题(issue#I6H0XF@Gitee)
|
* 【core 】 修复isXXX转换时的匹配问题(issue#I6H0XF@Gitee)
|
||||||
* 【core 】 修复MutableObj.equals空指针问题
|
* 【core 】 修复MutableObj.equals空指针问题
|
||||||
|
* 【core 】 修复JavaSourceFileObject在编译错误时抛出IOException异常而非CompilerException问题(pr#2942@Github)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ public class JavaSourceCompilerTest {
|
|||||||
// .addLibrary(FileUtil.file("D:\\m2_repo\\cn\\hutool\\hutool-all\\5.5.7\\hutool-all-5.5.7.jar"))
|
// .addLibrary(FileUtil.file("D:\\m2_repo\\cn\\hutool\\hutool-all\\5.5.7\\hutool-all-5.5.7.jar"))
|
||||||
.compile();
|
.compile();
|
||||||
final Class<?> clazz = classLoader.loadClass("c.C");
|
final Class<?> clazz = classLoader.loadClass("c.C");
|
||||||
Object obj = ReflectUtil.newInstance(clazz);
|
final Object obj = ReflectUtil.newInstance(clazz);
|
||||||
Assert.assertTrue(String.valueOf(obj).startsWith("c.C@"));
|
Assert.assertTrue(String.valueOf(obj).startsWith("c.C@"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ public class JavaSourceCompilerTest {
|
|||||||
CompilerUtil.getCompiler(null)
|
CompilerUtil.getCompiler(null)
|
||||||
.addSource(FileUtil.file("test-compile/error/ErrorClazz.java"))
|
.addSource(FileUtil.file("test-compile/error/ErrorClazz.java"))
|
||||||
.compile();
|
.compile();
|
||||||
} catch (Exception ex) {
|
} catch (final Exception ex) {
|
||||||
exception = ex;
|
exception = ex;
|
||||||
} finally {
|
} finally {
|
||||||
Assert.assertTrue(exception instanceof CompilerException);
|
Assert.assertTrue(exception instanceof CompilerException);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user