mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-08-18 20:38:02 +08:00
add compiler
This commit is contained in:
@@ -21,6 +21,7 @@ public class JavaSourceCompilerTest {
|
||||
*/
|
||||
@Test
|
||||
public void testCompile() throws ClassNotFoundException {
|
||||
// 依赖A,编译B和C
|
||||
final File libFile = ZipUtil.zip(FileUtil.file("lib.jar"),
|
||||
new String[]{"a/A.class", "a/A$1.class", "a/A$InnerClass.class"},
|
||||
new InputStream[]{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package cn.hutool.core.io.resource;
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -10,4 +11,12 @@ public class ResourceUtilTest {
|
||||
final String str = ResourceUtil.readUtf8Str("test.xml");
|
||||
Assert.assertNotNull(str);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void stringResourceTest(){
|
||||
final StringResource stringResource = new StringResource("testData", "test");
|
||||
Assert.assertEquals("test", stringResource.getName());
|
||||
Assert.assertArrayEquals("testData".getBytes(), stringResource.readBytes());
|
||||
Assert.assertArrayEquals("testData".getBytes(), IoUtil.readBytes(stringResource.getStream()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user