@Test public void test_parsing_xml2() throws Exception { HeaderParser parser = new HeaderParser( new FileContent( new File("src/test/resources/doc/doc5.xml"), System.getProperty("file.encoding")), HeaderType.XML_STYLE.getDefinition(), new String[] {"copyright"}); assertTrue(parser.gotAnyHeader()); assertEquals(parser.getBeginPosition(), 45); assertEquals(parser.getEndPosition(), 866); }
@Test public void test_has_header2() throws Exception { HeaderParser parser = new HeaderParser( new FileContent( new File("src/test/resources/doc/doc3.txt"), System.getProperty("file.encoding")), HeaderType.TEXT.getDefinition(), new String[] {"copyright"}); assertTrue(parser.gotAnyHeader()); assertEquals(parser.getBeginPosition(), 0); assertEquals(parser.getEndPosition(), 49); }