Package net.sf.jmd.metarepresentation.impl

Examples of net.sf.jmd.metarepresentation.impl.Operation


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


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

        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 "
View Full Code Here

        amModelItem = new ModelItem();
        amModelItem.setType("interface");
        amModelItem.setName("AnInterface");
        amModelItem.addMember(amMember);
       
        amMember = new Operation();
        amMember.addModifier("public");
        amMember.addModifier("static");
        amMember.setType(voidTypeAM);
        amMember.setName("aMember");
        amMember.setNamespace(amModelItem.getIdentifier());

        architectsModel = new Model();
        architectsModel.setType(Model.Type.AM);
        architectsModel.addModelItem(amModelItem);

       
        //the DM with an interface and a member
        voidTypeDM = new ModelItem();
        voidTypeDM.setName("void");
       
        dmModelItem = new ModelItem();
        dmModelItem.setType("interface");
        dmModelItem.setName("AnInterface");
        dmModelItem.addMember(dmMember);

        dmMember = new Operation();
        dmMember.addModifier("public");
        dmMember.setType(voidTypeAM);
        dmMember.setName("aMember");
        dmMember.setNamespace(amModelItem.getIdentifier());
View Full Code Here

        assertFalse(modelItem.equals(other));
        other.addExtendee(new ModelItem());
        assertTrue(modelItem.equals(other));

        //operation
        Operation modelItemOperation = new Operation();
        modelItem.addMember(modelItemOperation);
        assertFalse(modelItem.equals(other));

        Operation othersOperation = new Operation();
        other.addMember(othersOperation);
        assertTrue(modelItem.equals(other));
       
        Parameter modelItemParameter = new Parameter();
        modelItemOperation.addParameter(modelItemParameter);
        assertFalse(modelItem.equals(other));
       
        Parameter othersParameter = new Parameter();
        othersOperation.addParameter(othersParameter);
        assertTrue(modelItem.equals(other));
       
       
        // other.addMember(new Variable());
        // assertFalse(modelItem.equals(other));
View Full Code Here

    public MemberTest(){
        this.setName(this.getClass().getName());
    }
   
    public void setUp() {
        operation = new Operation();
        operation.setName("execute");
        operation.setNamespace(NAMESPACE);
       
        variable = new Variable();
        variable.setName("aMember");
View Full Code Here

    public void testOperationEquals() {
        assertFalse(operation.equals(null));
        assertTrue("An opration must be equal to it self.",
                operation.equals(operation));

        Operation otherOperation = new Operation();
        otherOperation.setNamespace(NAMESPACE);

        String identifier = "getValue";
        operation.setName(identifier);
        assertFalse(operation.equals(otherOperation));

        otherOperation.setName(identifier);
        assertTrue(operation.equals(otherOperation));
       
        Parameter parameter = new Parameter();
        operation.addParameter(parameter);
        assertFalse(operation.equals(otherOperation));

        otherOperation.addParameter(parameter);
        assertTrue(operation.equals(otherOperation));
       
        parameter.setName("i");
    }
View Full Code Here

    /**
     * <b>The equals method is reflexive:</b> for any reference value x,
     * x.equals(x) should return true.
     */
    public void testOperationEqualsReflexive() {
        IOperation x = new Operation();
        assertTrue(x.equals(x));
    }
View Full Code Here

    /**
     * <b>The equals method is symmetric:</b> for any reference values x and y,
     * x.equals(y) should return true if and only if y.equals(x) returns true.
     */
    public void testOperationEqualsSymmetric() {
        IOperation x = new Operation();
        IOperation y = new Operation();
        assertTrue(x.equals(y) && y.equals(x));
    }
View Full Code Here

     * <b>The equals method is transitive:</b> for any reference values x, y,
     * and z, if x.equals(y) returns true and y.equals(z) returns true, then
     * x.equals(z) should return true.
     */
    public void testOperationEqualsTransivity() {
        IOperation x = new Operation();
        IOperation y = new Operation();
        IOperation z = new Operation();
        assertTrue(x.equals(y) && y.equals(z) && x.equals(z));
    }
View Full Code Here

TOP

Related Classes of net.sf.jmd.metarepresentation.impl.Operation

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.