Package org.apache.rat.document

Examples of org.apache.rat.document.IDocumentAnalyser


    }
   
    public static final IDocumentAnalyser createDefaultAnalyser(final IClaimReporter reporter,
            final IHeaderMatcher matcher) {
       
        final IDocumentAnalyser binaryAnalyser = createDefaultBinaryAnalyser(reporter);
        final IDocumentAnalyser archiveAnalyser = createDefaultArchiveAnalyser(reporter);
        final IDocumentAnalyser noticeAnalyser = createDefaultNoticeAnalyser(reporter);
        final IDocumentAnalyser standardAnalyser = createDefaultStandardAnalyser(reporter, matcher);
       
        return createDefaultAnalyser(binaryAnalyser, archiveAnalyser, noticeAnalyser, standardAnalyser);
    }
View Full Code Here


    }


    public void testStandardTypeAnalyser() throws Exception {
        MonolithicFileDocument document = new MonolithicFileDocument(new File("src/test/resources/elements/Text.txt"));
        IDocumentAnalyser analyser = DefaultAnalyserFactory.createDefaultAnalyser(matcherStub);
        analyser.analyse(document);
        reporter.report(document);
        assertEquals("Open standard element", "<resource name='src/test/resources/elements/Text.txt'><header-sample>/*\n" +
                " * Licensed to the Apache Software Foundation (ASF) under one\n" +
                " * or more contributor license agreements.  See the NOTICE file\n" +
                " * distributed with this work for additional information\n" +
View Full Code Here

                "</header-sample><header-type name='?????'/><license-family name='?????'/><type name='standard'/>", out.toString());
    }

    public void testNoteTypeAnalyser() throws Exception {
        MonolithicFileDocument document = new MonolithicFileDocument(new File("src/test/elements/LICENSE"));
        IDocumentAnalyser analyser = DefaultAnalyserFactory.createDefaultAnalyser(matcherStub);
        analyser.analyse(document);
        reporter.report(document);
        assertEquals("Open note element", "<resource name='src/test/elements/LICENSE'><type name='notice'/>", out.toString());
    }
View Full Code Here

        assertEquals("Open note element", "<resource name='src/test/elements/LICENSE'><type name='notice'/>", out.toString());
    }

    public void testBinaryTypeAnalyser() throws Exception {
        MonolithicFileDocument document = new MonolithicFileDocument(new File("src/test/elements/Image.png"));
        IDocumentAnalyser analyser = DefaultAnalyserFactory.createDefaultAnalyser(matcherStub);
        analyser.analyse(document);
        reporter.report(document);
        assertEquals("Open binary element", "<resource name='src/test/elements/Image.png'><type name='binary'/>", out.toString());
    }
View Full Code Here

        assertEquals("Open binary element", "<resource name='src/test/elements/Image.png'><type name='binary'/>", out.toString());
    }

    public void testArchiveTypeAnalyser() throws Exception {
        MonolithicFileDocument document = new MonolithicFileDocument(new File("src/test/elements/Dummy.jar"));
        IDocumentAnalyser analyser = DefaultAnalyserFactory.createDefaultAnalyser(matcherStub);
        analyser.analyse(document);
        reporter.report(document);
        assertEquals("Open archive element", "<resource name='src/test/elements/Dummy.jar'><type name='archive'/>", out.toString());
    }
View Full Code Here

            }

            public void reset() {
            }           
        };
        IDocumentAnalyser analyser = DefaultAnalyserFactory.createDefaultAnalyser(matcher);
        final List reporters = new ArrayList();
        reporters.add(reporter);
        report = new ClaimReporterMultiplexer(analyser, reporters);
    }
View Full Code Here

            }

            public void reset() {
            }           
        };
        IDocumentAnalyser analyser = DefaultAnalyserFactory.createDefaultAnalyser(matcher);
        final List<AbstractReport> reporters = new ArrayList<AbstractReport>();
        reporters.add(reporter);
        report = new ClaimReporterMultiplexer(analyser, reporters);
    }
View Full Code Here

     }

    @Test
    public void standardTypeAnalyser() throws Exception {
        MonolithicFileDocument document = new MonolithicFileDocument(new File("src/test/resources/elements/Text.txt"));
        IDocumentAnalyser analyser = DefaultAnalyserFactory.createDefaultAnalyser(matcherStub);
        analyser.analyse(document);
        reporter.report(document);
        assertEquals("Open standard element", "<resource name='src/test/resources/elements/Text.txt'><header-sample>/*\n" +
                " * Licensed to the Apache Software Foundation (ASF) under one\n" +
                " * or more contributor license agreements.  See the NOTICE file\n" +
                " * distributed with this work for additional information\n" +
View Full Code Here

    }

    @Test
    public void noteTypeAnalyser() throws Exception {
        MonolithicFileDocument document = new MonolithicFileDocument(new File("src/test/elements/LICENSE"));
        IDocumentAnalyser analyser = DefaultAnalyserFactory.createDefaultAnalyser(matcherStub);
        analyser.analyse(document);
        reporter.report(document);
        assertEquals("Open note element", "<resource name='src/test/elements/LICENSE'><type name='notice'/>", out.toString());
    }
View Full Code Here

    }

    @Test
    public void binaryTypeAnalyser() throws Exception {
        MonolithicFileDocument document = new MonolithicFileDocument(new File("src/test/elements/Image.png"));
        IDocumentAnalyser analyser = DefaultAnalyserFactory.createDefaultAnalyser(matcherStub);
        analyser.analyse(document);
        reporter.report(document);
        assertEquals("Open binary element", "<resource name='src/test/elements/Image.png'><type name='binary'/>", out.toString());
    }
View Full Code Here

TOP

Related Classes of org.apache.rat.document.IDocumentAnalyser

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.