Package org.apache.rat.api

Examples of org.apache.rat.api.Document


     * @param file the file to be reported on
     * @throws RatException
     */
    private void report(final RatReport report, byte[] contents, File file) throws RatException {

        Document document = new ArchiveEntryDocument(file, contents);
        report.report(document);

    }
View Full Code Here


    }

    public void testMatcherLine() throws Exception {
        matcherOne.result = false;
        matcherTwo.result = false;
        final Document subject = new MockLocation("subject");
        multiplexer.match(subject, LINE_ONE);
        assertEquals("One line", 1, matcherOne.lines.size());
        assertEquals("Same as line passed", LINE_ONE, matcherOne.lines.get(0));
        assertEquals("One line", 1, matcherTwo.lines.size());
        assertEquals("Same as line passed", LINE_ONE, matcherTwo.lines.get(0));
View Full Code Here

    boolean readAndMatch(String name) throws Exception {
        File file = Resources.getResourceFile("javadocs/" + name);
        boolean result = false;
        BufferedReader in = new BufferedReader(new FileReader(file));
        String line = in.readLine();
        final Document subject = new MockLocation("subject");
        while (line != null && !result) {
            result = license.match(subject, line);
            line = in.readLine();
        }
        return result;
View Full Code Here

    @Test
    public void match() throws Exception {
        BufferedReader in = new BufferedReader(new StringReader(HEADER));
        String line = in.readLine();
        boolean result = false;
        final Document subject = new MockLocation("subject");
        while (line != null) {
            result = license.match(subject, line);
            line = in.readLine();
        }
        assertTrue("Applied ASL2.0 license should be matched", result);
View Full Code Here

    @Test
    public void noMatch() throws Exception {
        BufferedReader in = Resources.getBufferedResourceReader("elements/Source.java");
        String line = in.readLine();
        boolean result = false;
        final Document subject = new MockLocation("subject");
        while (line != null) {
            result = license.match(subject, line);
            line = in.readLine();
        }
        assertFalse("Applied ASL2.0 license should not be matched", result);
View Full Code Here

    @Test
    public void match() throws Exception {
        BufferedReader in = new BufferedReader(new StringReader(LICENSE));
        String line = in.readLine();
        boolean result = false;
        final Document subject = new MockLocation("subject");
        while (line != null) {
            result = license.match(subject, line);
            line = in.readLine();
        }
        assertTrue("OASIS license should be matched", result);
View Full Code Here

    @Test
    public void noMatch() throws Exception {
        BufferedReader in = Resources.getBufferedResourceReader("elements/Source.java");
        String line = in.readLine();
        boolean result = false;
        final Document subject = new MockLocation("subject");
        while (line != null) {
            result = license.match(subject, line);
            line = in.readLine();
        }
        assertFalse("OASIS license should not be matched", result);
View Full Code Here

  protected void tearDown() throws Exception {
    super.tearDown();
  }
 
  public void testIsFinished() throws Exception {
        final Document subject = new MockLocation("subject");
    HeaderCheckWorker worker = new HeaderCheckWorker(new StringReader(""), new ApacheSoftwareLicense20(), subject);
    assertFalse(worker.isFinished());
    worker.read();
    assertTrue(worker.isFinished());
  }
View Full Code Here

    boolean readAndMatch(String name) throws Exception {
        File file = Resources.getResourceFile("javadocs/" + name);
        boolean result = false;
        BufferedReader in = new BufferedReader(new FileReader(file));
        String line = in.readLine();
        final Document subject = new MockLocation("subject");
        while (line != null && !result) {
            result = license.match(subject, line);
            line = in.readLine();
        }
        return result;
View Full Code Here

    public void testMatch() throws Exception {
        BufferedReader in = new BufferedReader(new StringReader(LICENSE));
        String line = in.readLine();
        boolean result = false;
        final Document subject = new MockLocation("subject");
        while (line != null) {
            result = license.match(subject, line);
            line = in.readLine();
        }
        assertTrue("OASIS license should be matched", result);
View Full Code Here

TOP

Related Classes of org.apache.rat.api.Document

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.