Package net.sf.jmd.metarepresentation.impl

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


        IModelItem item = new ModelItem();
        item.setName("anItem");
        item.setNamespace("de.dlr.modi");
        item.setType("interface");
       
        Operation operation = new Operation();
        operation.setName("anOperation");
        operation.setNamespace(item.getIdentifier());
       
        Parameter parameter = new Parameter();
        parameter.setName("aParameter");
        parameter.setNamespace(operation.getIdentifier());
       
        operation.addParameter(parameter);
       
        Variable variable = new Variable();
        variable.setName("aVariable");
        variable.setNamespace(item.getIdentifier());
View Full Code Here


        assertTrue(model.equals(other));
        ModelItem newItem = new ModelItem();
        newItem.setName("anIdentifier");
        newItem.setType("interface");
       
        Operation operation = new Operation();
        operation.setName("voidFoo");
        operation.setNamespace(newItem.getIdentifier());
        newItem.addMember(operation);
       
        model.addModelItem(newItem);
        assertFalse(model.equals(other));
       
View Full Code Here

       
        ModelItem amItem = new ModelItem();
        amItem.setName("anotherInterface");
        amItem.setType("interface");
       
        Operation amOperation = new Operation();
        amOperation.setName("anotherMethod");
        amOperation.setNamespace(amItem.getIdentifier());
       
        Parameter amParameter = new Parameter();
        amParameter.setName("aParameter");
        amParameter.setNamespace(amOperation.getIdentifier());
       
        amOperation.addParameter(amParameter);
        amItem.addMember(amOperation);
        model.addModelItem(amItem);
       
        assertFalse(model.equals(other));
       
        ModelItem dmItem = new ModelItem();
        dmItem.setName("anotherInterface");
        dmItem.setType("interface");
       
        Operation dmOperation = new Operation();
        dmOperation.setName("anotherMethod");
        dmOperation.setNamespace(dmItem.getIdentifier());
       
        Parameter dmParameter = new Parameter();
        dmParameter.setName("aParameter");
        dmParameter.setNamespace(dmOperation.getIdentifier());
       
        dmOperation.addParameter(dmParameter);
        dmItem.addMember(dmOperation);
        other.addModelItem(dmItem);
       
        assertTrue(model.equals(other));
       
        //now the developer adds a parameter to the method:
        Parameter newParameter = new Parameter();
        newParameter.setName("newParameter");
        dmOperation.addParameter(newParameter);
       
        assertFalse(model.equals(other));
    }
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

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