mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
完善测试用例
This commit is contained in:
parent
35dd387cb9
commit
b5e4ec9576
@ -20,6 +20,7 @@ public class LazyFunLoaderTest {
|
|||||||
LazyFunLoader<BigObject> loader = new LazyFunLoader<>(BigObject::new);
|
LazyFunLoader<BigObject> loader = new LazyFunLoader<>(BigObject::new);
|
||||||
|
|
||||||
Assert.assertNotNull(loader.get());
|
Assert.assertNotNull(loader.get());
|
||||||
|
Assert.assertTrue(loader.isInitialize());
|
||||||
|
|
||||||
// 对于某些对象,在程序关闭时,需要进行销毁操作
|
// 对于某些对象,在程序关闭时,需要进行销毁操作
|
||||||
loader.ifInitialized(BigObject::destroy);
|
loader.ifInitialized(BigObject::destroy);
|
||||||
@ -38,5 +39,7 @@ public class LazyFunLoaderTest {
|
|||||||
Assert.fail();
|
Assert.fail();
|
||||||
it.destroy();
|
it.destroy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Assert.assertFalse(loader.isInitialize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user