mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add test
This commit is contained in:
parent
82f5b2b154
commit
d3f7fdcdd5
@ -5,7 +5,9 @@ import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 文件类型判断单元测试
|
||||
@ -62,4 +64,15 @@ public class FileTypeUtilTest {
|
||||
Assert.assertEquals("xlsx", type);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void getTypeFromInputStream() throws IOException {
|
||||
File file = FileUtil.file("d:/test/pic.jpg");
|
||||
final BufferedInputStream inputStream = FileUtil.getInputStream(file);
|
||||
inputStream.mark(0);
|
||||
String type = FileTypeUtil.getType(inputStream);
|
||||
|
||||
inputStream.reset();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user