Package net.sf.jmd.evaluation

Examples of net.sf.jmd.evaluation.IDifference


                List<IMember> addedMethods = checkPublicMethods(
                        getPublicMethods(anInterface),
                        getPublicMethods(implementingClass));

                if (!addedMethods.isEmpty()) {
                    IDifference difference = new Difference();
                    difference.setDescription("The class "
                            + implementingClass.getIdentifier()
                            + " has a public method that is not specified in"
                            + " its interface " + anInterface.getIdentifier());
                    difference.setDMElement((IModelElement)implementingClass);
                    difference.setSeverity(super.getSeverity());
                    difference.setStatus(IDifference.Status.MODIFIED);
                   
                    result.add(difference);
                }
            }
        }
View Full Code Here


            }

            // now we have the added members for this interface

            for (IParameter parameter : removedParameters) {
                IDifference difference = new Difference();
                difference.setName(super.getName());
                difference.setSeverity(super.getSeverity());
                difference.setDescription("The parameter \""
                        + parameter.getIdentifier()
                        + "\" has been removed from the method \""
                        + amElement.getIdentifier() + "\".");
                difference.setLayer(IDifference.Layer.PARAMETER);
                difference.setStatus(IDifference.Status.REMOVED);
                difference.setParentElement(amElement);
                difference.setAMElement((IModelElement) parameter);
                results.add(difference);
            }

        }
        return results;
View Full Code Here

            } else {
                /*
                 * cases: REMOVED, ADDED: impossible
                 * MODIFIED: an interface has become a class or vice versa
                 */
                IDifference typeDifference = new Difference();
           
                typeDifference.setDescription("The type of the item "
                        + am.getIdentifier()
                        + " has been modified to "
                        + dmType);
                typeDifference.setAMElement((IModelElement)am);
                typeDifference.setDMElement((IModelElement)dm);
                typeDifference.setLayer(IDifference.Layer.MODELITEM);
                typeDifference.setStatus(IDifference.Status.MODIFIED);
                typeDifference.setName("AllDifferencesFromOutside");
                results.add(typeDifference);
            }

        results.addAll(getDifferencesFromExtendees(amExtendees, dmExtendees));
        results.addAll(getDifferencesFromMembers(amMembers, dmMembers));
View Full Code Here

                }
            }
        }

        for (IModelElement amItem : modifiedInterfaces.keySet()) {
            IDifference difference = new Difference();
            difference.setName(super.getName());
            difference.setSeverity(super.getSeverity());
            difference.setDescription("The " + ((IModelItem) amItem).getType()
                    + " \"" + amItem.getIdentifier()
                    + "\" has been modified.");
            difference.setLayer(IDifference.Layer.MODELITEM);
            difference.setStatus(IDifference.Status.MODIFIED);
            difference.setAMElement(amItem);
            difference.setDMElement(modifiedInterfaces.get(amItem));
            results.add(difference);
        }

        return results;
    }
View Full Code Here

    }

    public IReport setUpTestReport(){

        IDifference diffHigh = new Difference();
        diffHigh.setSeverity(Severity.HIGH);
        diffHigh.setDescription("The interface IFoo has been brutally deleted "
                + "from the Architecture!!");

        IDifference diffMedium = new Difference();
        diffMedium.setSeverity(Severity.MEDIUM);
        diffMedium.setDescription("The interface IBar has been added to"
                + " the Architecture. Thx! :o)");

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

                }
            }
        }

        for (IModelElement item : addedModelElements) {
            IDifference difference = new Difference();
            difference.setName(super.getName());
            difference.setSeverity(super.getSeverity());
            difference.setDescription("The " + ((IModelItem) item).getType()
                    + " \"" + item.getIdentifier()
                    + "\" has been added to the model.");
            difference.setLayer(IDifference.Layer.MODELITEM);
            difference.setStatus(IDifference.Status.ADDED);
            difference.setDMElement(item);
            results.add(difference);
        }

        return results;
    }
View Full Code Here

                    memberType = "operation";
                } else {
                    memberType = "variable";
                }
               
                IDifference difference = new Difference();
                difference.setName(super.getName());
                difference.setSeverity(super.getSeverity());
                difference.setDescription("The " + memberType + "\""
                        + member.getIdentifier()
                        + "\" has been removed from the interface \""
                        + modifiedInterfaces.get(amElement).getIdentifier()
                        + "\".");
                difference.setLayer(IDifference.Layer.MEMBER);
                difference.setStatus(IDifference.Status.REMOVED);
                difference.setParentElement(modifiedInterfaces.get(amElement));
                difference.setAMElement((IModelElement) member);
                results.add(difference);
            }

        }
        return results;
View Full Code Here

       
        assertNotNull("The check method must not return null", differences);

        assertTrue("There must be one Difference", differences.size() == 1);
       
        IDifference difference = differences.get(0);
        assertTrue("The DMElement of the difference must be the one with the"
                + " added public method in it.",
                difference.getDMElement().equals(dmClass));
    }
View Full Code Here

       
        assertNotNull("The check method must not return null", differences);
       
        assertEquals("There must be one Difference", 1, differences.size());
       
        IDifference difference = differences.get(0);
        String expected = "AClass";
        String actual =  difference.getDMElement().getIdentifier();
        assertEquals("The DMElement of the difference must be the one with the"
                + " added public method in it.", expected, actual);
    }
View Full Code Here

        dmMember.setNamespace(dmModelItem.getIdentifier());
        dmMember.setName("aMember");
       
        dmModelItem.addMember(dmMember);

        IDifference difference = new Difference();
        difference.setLayer(IDifference.Layer.MODELITEM);
        difference.setStatus(IDifference.Status.MODIFIED);
        difference.setAMElement((IModelElement) amModelItem);
        difference.setDMElement((IModelElement) dmModelItem);
        difference.setName("InterfacesModified");

        differences = new ArrayList<IDifference>();
        differences.add(difference);

        membersModified = new MembersModified();
View Full Code Here

TOP

Related Classes of net.sf.jmd.evaluation.IDifference

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.