Package com.google.code.mojo.license.util

Examples of com.google.code.mojo.license.util.FileContent


        assertEquals(parser.getEndPosition(), 49);
    }

    @Test
    public void test_parsing_xml1() throws Exception {
        HeaderParser parser = new HeaderParser(new FileContent(new File("src/test/resources/doc/doc4.xml"), System.getProperty("file.encoding")),
                HeaderType.XML_STYLE.getDefinition(), new String[]{"copyright"});
        assertTrue(parser.gotAnyHeader());
        assertEquals(parser.getBeginPosition(), 45);
        assertEquals(parser.getEndPosition(), 862);
    }
View Full Code Here


        assertEquals(parser.getEndPosition(), 862);
    }

    @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);
    }
View Full Code Here

        assertEquals(parser.getEndPosition(), 866);
    }

    @Test
    public void test_parsing_xml3() throws Exception {
        HeaderParser parser = new HeaderParser(new FileContent(new File("src/test/resources/doc/doc6.xml"), System.getProperty("file.encoding")),
                HeaderType.XML_STYLE.getDefinition(), new String[]{"copyright"});
        assertFalse(parser.gotAnyHeader());
    }
View Full Code Here

        assertFalse(parser.gotAnyHeader());
    }

    @Test
    public void test_parsing_xml4() throws Exception {
        HeaderParser parser = new HeaderParser(new FileContent(new File("src/test/resources/doc/doc7.xml"), System.getProperty("file.encoding")),
                HeaderType.XML_STYLE.getDefinition(), new String[]{"copyright"});
        assertFalse(parser.gotAnyHeader());
    }
View Full Code Here

        assertFalse(parser.gotAnyHeader());
    }

    @Test
    public void test_parsing_xml5() throws Exception {
        HeaderParser parser = new HeaderParser(new FileContent(new File("src/test/resources/doc/doc8.xml"), System.getProperty("file.encoding")),
                HeaderType.XML_STYLE.getDefinition(), new String[]{"copyright"});
        assertFalse(parser.gotAnyHeader());
    }
View Full Code Here

        assertFalse(parser.gotAnyHeader());
    }

    @Test
    public void test_parsing_xml6() throws Exception {
        HeaderParser parser = new HeaderParser(new FileContent(new File("src/test/resources/doc/doc9.xml"), System.getProperty("file.encoding")),
                HeaderType.XML_STYLE.getDefinition(), new String[]{"copyright"});
        assertTrue(parser.gotAnyHeader());
        assertEquals(parser.getBeginPosition(), 45);
        assertEquals(parser.getEndPosition(), 870);
    }
View Full Code Here

*/
public final class HeaderParserTest {

    @Test
    public void test_no_header() throws Exception {
        HeaderParser parser = new HeaderParser(new FileContent(new File("src/test/resources/doc/doc1.txt"), System.getProperty("file.encoding")),
                HeaderType.TEXT.getDefinition());
        assertFalse(parser.gotAnyHeader());
    }
View Full Code Here

        assertFalse(parser.gotAnyHeader());
    }

    @Test
    public void test_has_header() throws Exception {
        HeaderParser parser = new HeaderParser(new FileContent(new File("src/test/resources/doc/doc2.txt"), System.getProperty("file.encoding")),
                HeaderType.TEXT.getDefinition());
        assertTrue(parser.gotAnyHeader());
        assertEquals(parser.getBeginPosition(), 0);
        assertEquals(parser.getEndPosition(), 43);
    }
View Full Code Here

        assertEquals(parser.getEndPosition(), 43);
    }

    @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());
        assertTrue(parser.gotAnyHeader());
        assertEquals(parser.getBeginPosition(), 0);
        assertEquals(parser.getEndPosition(), 43);
    }
View Full Code Here

        assertEquals(parser.getEndPosition(), 43);
    }

    @Test
    public void test_parsing_xml1() throws Exception {
        HeaderParser parser = new HeaderParser(new FileContent(new File("src/test/resources/doc/doc4.xml"), System.getProperty("file.encoding")),
                HeaderType.XML_STYLE.getDefinition());
        assertTrue(parser.gotAnyHeader());
        assertEquals(parser.getBeginPosition(), 45);
        assertEquals(parser.getEndPosition(), 862);
    }
View Full Code Here

TOP

Related Classes of com.google.code.mojo.license.util.FileContent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.