Package net.sf.jmd.report

Examples of net.sf.jmd.report.IReport


   
    /**
     * 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


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

            log.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);

            log.info("reporting");
            modi.report(report, modi.getReportStyle(Config.getStringProperty("MoDi.Report.Style")));
//            modi.report(report, MoDi.ReportStyle.XML);
//            modi.report(report, MoDi.ReportStyle.HTML); // html implies xml
           
            boolean doCommunicate = Boolean.parseBoolean(Config.getStringProperty("MoDi.do.communicate"));
            log.debug("communicate?: " + doCommunicate);
            if ( doCommunicate ) {
                log.info("communicating");
                modi.communicate(report); // communication needs html report
            }
           
            log.info(report.getDifferences().size() + " differences found.");
            long duration = start + System.currentTimeMillis();
            log.info("Done (" + duration + " ms).");

        } catch (MoDiException e) {
            log.error(e.getMessage());
View Full Code Here

        IDifference diffLow = new Difference();
        diffLow.setSeverity(Severity.LOW);
        diffLow.setDescription("The class FooImpl has a new private method "
                + "generateStringFromODS");

        IReport report = new Report();
        report.setArchitect("Jan Hinzmann");
        report.setDate(new Date(System.currentTimeMillis()));
        report.add(diffHigh);
        report.add(diffMedium);
        report.add(diffLow);

        IReporter htmlReporter = ReporterFactory.create(ReportStyle.HTML);
        htmlReporter.report(report);// the report is now stored on the harddrive
       
        return report;
View Full Code Here

        comparator.add(interfacesAddedCheck);
    }


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

        assertNotNull("There should be at least an empty list of differences",
                differences);
       
        int actualSize = differences.size();
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.