mirror of https://github.com/apache/poi.git
Fix TestFileMagic
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847454 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
aad955d3bf
commit
2f6911a8ae
|
@ -17,6 +17,7 @@
|
|||
|
||||
package org.apache.poi.poifs.filesystem;
|
||||
|
||||
import org.apache.commons.codec.Charsets;
|
||||
import org.apache.poi.POIDataSamples;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -31,12 +32,12 @@ public class TestFileMagic {
|
|||
@Test
|
||||
public void testFileMagic() {
|
||||
assertEquals(FileMagic.XML, FileMagic.valueOf("XML"));
|
||||
assertEquals(FileMagic.XML, FileMagic.valueOf("<?xml".getBytes()));
|
||||
assertEquals(FileMagic.XML, FileMagic.valueOf("<?xml".getBytes(Charsets.UTF_8)));
|
||||
|
||||
assertEquals(FileMagic.HTML, FileMagic.valueOf("HTML"));
|
||||
assertEquals(FileMagic.HTML, FileMagic.valueOf("<!DOCTYP".getBytes()));
|
||||
assertEquals(FileMagic.HTML, FileMagic.valueOf("<!DOCTYPE".getBytes()));
|
||||
assertEquals(FileMagic.HTML, FileMagic.valueOf("<html".getBytes()));
|
||||
assertEquals(FileMagic.HTML, FileMagic.valueOf("<!DOCTYP".getBytes(Charsets.UTF_8)));
|
||||
assertEquals(FileMagic.HTML, FileMagic.valueOf("<!DOCTYPE".getBytes(Charsets.UTF_8)));
|
||||
assertEquals(FileMagic.HTML, FileMagic.valueOf("<html".getBytes(Charsets.UTF_8)));
|
||||
|
||||
try {
|
||||
FileMagic.valueOf("some string");
|
||||
|
|
Loading…
Reference in New Issue