Package net.sf.jmd.report

Examples of net.sf.jmd.report.IReport


     * @see org.apache.maven.reporting.AbstractMavenReport#executeReport(java.util.Locale)
     */
    @Override
    protected void executeReport(Locale locale) throws MavenReportException {

        IReport jmdReport;
        try {
            jmdReport = getJMDReport();
        } catch (MoDiException e) {
            throw new MavenReportException(e.getMessage(), e);
        }

        // we use Doxia to create our report. See further annotations below.
        Sink sink = getSink();
        sink.head();
        sink.title();
        sink.text(getName(locale));
        sink.title_();
        sink.head_();

        sink.body();
       
        sink.anchor("top");
        sink.anchor_();
       
        sink.section1();
        sink.sectionTitle1();
        sink.text(getName(locale));
        sink.sectionTitle1_();
        sink.paragraph();
        sink.text(this.getBundle(locale).getString("meta.description"));
        sink.lineBreak();
        sink.text(this.getProject().getName() + " Version: " + this.getProject().getVersion());
        sink.paragraph_();
        sink.section2();
        sink.sectionTitle2();
        sink.text(this.getBundle(locale).getString("meta.title"));
        sink.sectionTitle2_();
        sink.text("Date: " + jmdReport.getDate());
        sink.lineBreak();
        sink.text("Architect: " + jmdReport.getArchitect());
        sink.lineBreak();
        sink.text("Developer: " + jmdReport.getDeveloper());
        sink.lineBreak();
        sink.text("Architects Model: " + jmdReport.getArchitectsModelVersion());
        sink.lineBreak();
        sink.text("Developers Model: " + jmdReport.getDevelopersModelVersion());
        sink.lineBreak();
        sink.lineBreak();
        sink.text("Differences found: " + jmdReport.getDifferences().size());
        sink.section2_();
       
        sink.section2();
        sink.sectionTitle2();
        sink.text(this.getBundle(locale).getString("differences.title"));
View Full Code Here


        getLog().info("transforming models into metamodel");
        modi.transformArchitectsModel(MoDi.Language.JAVA);
        modi.transformDevelopersModel(MoDi.Language.JAVA);

        getLog().info("evaluating the differences.");
        IReport report = modi.evaluate();
        String projectName = Config.getStringProperty("MoDi.Meta.Project.Name");

        report.setArchitect(Config.getStringProperty("MoDi.Meta.Architect"));

        report.setArchitectsModelVersion(projectName + ": " + amRoot);

        report.setDeveloper(Config.getStringProperty("MoDi.Meta.Developer"));

        report.setDevelopersModelVersion(projectName + ": " + dmRoot);

        return report;
    }
View Full Code Here

            //transform,
            modi.transformArchitectsModel(MoDi.Language.JAVA);
            modi.transformDevelopersModel(MoDi.Language.JAVA);
           
            //compare,
            IReport report = modi.evaluate();
           
            //communicate!
            IReporter reporter = ReporterFactory.create(MoDi.ReportStyle.CONSOLE);
            reporter.report(report);
           
View Full Code Here

   
    /**
     * Evaluates all known Checks in the order they have been added.
     */
    public IReport evaluate() {
        IReport result = new Report();
        result.setDate(new GregorianCalendar().getTime());

        for (ICheck check : checks) {
            List<IDifference> differences = check
                    .check(result.getDifferences());
            result.addAll(differences);
        }

        return result;
    }
View Full Code Here

     * <li>a Member has been removed</li>
     * <li>a Member has been modified</li>
     * </ul>
     */
    public void testInterfacesModified() {
        IReport report = comparator.evaluate();
        List<IDifference> differencesFound = report.getDifferences();

        assertNotNull("The list of differences must not be null",
                differencesFound);

        assertTrue("The check method must return at least an empty list of "
                + "differences", differencesFound.isEmpty());

        // now we modifiy an interface
        Operation operation = new Operation();
        dmModelItem.addMember(operation);

        report = comparator.evaluate();
        differencesFound = report.getDifferences();

        assertTrue(
                "A Member has been added. This should result in a difference",
                differencesFound.size() == 1);
        assertEquals("After adding an operation in the DM there must be a "
View Full Code Here

                        .getStatus());
    }

    public void testDifferencesContainBothInterfacesModified() {
       
        IReport report = comparator.evaluate();
        List<IDifference> differences = report.getDifferences();

        assertNotNull(report);
        assertNotNull(differences);
        assertTrue(differences.isEmpty());
      
        dmModelItem.addMember(new Operation());
       
        report = comparator.evaluate();
        differences = report.getDifferences();
        int diffs = differences.size();
        assertTrue("There must be one difference, found: " + diffs, diffs == 1);
       
        assertNotNull(differences.get(0).getAMElement());
        assertNotNull(differences.get(0).getDMElement());
View Full Code Here

        comparator.add(membersRemoved);

    }

    public void testCheckRemoved() {
        IReport report = comparator.evaluate();
        assertNotNull(report);

        List<IDifference> differences = report.getDifferences();
        assertNotNull(differences);
       
        assertTrue(differences.isEmpty());
       
        //now we modify the model: adding a member to the AM is equal to remove
        //the member from the DM
        amModelItem.addMember(new Operation());

        //reevaluate
        report = comparator.evaluate();
        differences = report.getDifferences();
       
        assertFalse(differences.isEmpty());
        assertTrue("There must be 2 differences. Found: " + differences.size(),
                differences.size() == 2);
       
        assertEquals("There must be a Difference in the state MODIFIED",
                IDifference.Status.MODIFIED,
                report.getDifferences().get(0).getStatus());
       
        assertEquals("There must be a Difference in the state REMOVED",
                IDifference.Status.REMOVED,
                report.getDifferences().get(1).getStatus());
       
    }
View Full Code Here

     * Test method for {@link de.dlr.sistec.modi.checks.impl
     * .MembersAdded#check()}.
     */
    public void testMembersAdded() {

        IReport report = comparator.evaluate();

        assertNotNull("The check must not return null.", report);

        assertTrue("The models are equal, so the list of differences must be "
                + "empty", report.getDifferences().isEmpty());

        dmModelItem.addMember(new Operation());
        report = comparator.evaluate();

        List<IDifference> differences = report.getDifferences();
        assertFalse(differences.isEmpty());
        assertTrue("After adding an operation to the DM item, there must be 2 "
                + "differences - found " + differences.size(),
                differences.size() == 2);

View Full Code Here

     * Test method for evaluate.
     * {@link de.dlr.sistec.modi.evaluation.checks.ModelItemsRemoved#
     * evaluate(java.util.List, java.util.List)}.
     */
    public void testInterfacesRemoved() {
        IReport report = new Report();
        List<IDifference> differencesFound = interfacesRemovedCheck
                .check(report.getDifferences());

        assertNotNull("There should be at least an empty list of differences",
                differencesFound);
        int differences = differencesFound.size();
        assertTrue("There must be 1 difference, found: " + differences,
View Full Code Here

    /**
     * Test method for {@link de.dlr.sistec.modi.checks.impl
     *          .MembersModified#check(java.util.List)}.
     */
    public void testCheckMemberModified() {
        IReport report = comparator.evaluate();
        List<IDifference> differences = report.getDifferences();
        assertTrue("There must not be differences at this point",
                differences.isEmpty());
       
        //now we modify the member a bit
        //"public void aMember();" -> "public static void aMember();"
        dmMember.addModifier("static");
       
        report = comparator.evaluate();
        differences = report.getDifferences();
       
        assertTrue("Now we want differences!", differences.isEmpty());
       
    }
View Full Code Here

TOP

Related Classes of net.sf.jmd.report.IReport

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.