Examples of ModelItem


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

   
    private void setUpDM() {
        List<String> modifiers = new ArrayList<String>();
        modifiers.add("public");
        //set up an interface
        dmInterface = new ModelItem();
        dmInterface.setName("AnInterface");
        dmInterface.setType("interface");
       
        IMember dmMethod =  new Operation();
        dmMethod.setName("myMethod");
        dmInterface.addMember(dmMethod);
       
        //set up a implementing class
        dmClass = new ModelItem();
        dmClass.setName("MyClass");
        dmClass.setType("class");
        dmClass.addExtendee(dmInterface);//MyClass implements AnInterface
       
        IMember dmClassMethod =  new Operation();
View Full Code Here

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

        architectsModel.setType(Model.Type.AM);

        developersModel = new Model();
        developersModel.setType(Model.Type.DM);

        dmModelItem = new ModelItem();
        dmModelItem.setType("interface");
        dmModelItem.setName("AnInterface");

        amModelItem = new ModelItem();
        amModelItem.setType("interface");
        amModelItem.setName("AnInterface");

        developersModel.addModelItem(dmModelItem);
        architectsModel.addModelItem(amModelItem);
View Full Code Here

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

        architectsModel.setType(Model.Type.AM);

        developersModel = new Model();
        developersModel.setType(Model.Type.DM);

        amModelItem = new ModelItem();
        amModelItem.setType("interface");
        amModelItem.setName("RemovedInterface");

        architectsModel.addModelItem(amModelItem);
View Full Code Here

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

     * @see junit.framework.TestCase#setUp()
     */
    protected void setUp() throws Exception {
        super.setUp();
        //an AM with an interface and a member in it
        voidTypeAM = new ModelItem();
        voidTypeAM.setName("void");
       
        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();
View Full Code Here

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

        model = new Model();
        other = new Model();
    }

    public void setUp() {
        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());

        item.addMember(operation);
        item.addMember(variable);
       
        //these two models are equal
        model.addModelItem(item);
        other.addModelItem(item);
    }
View Full Code Here

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

    }
   
    public void testAddModelItem(){
        IModel newModel = new Model();
        assertTrue(newModel.getItems().isEmpty());
        ModelItem newItem = new ModelItem();
        newModel.addModelItem(newItem);
        assertTrue(newModel.getItems().contains(newItem));
    }
View Full Code Here

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

        other.setRevision("r123");
        assertTrue(model.equals(other));

        //items
        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));
       
        other.addModelItem(newItem);
View Full Code Here

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

   
    public void testEqualsAfterInterfaceAdded() {
        assertEquals(model, other);
       
        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:
View Full Code Here

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

     * Test method for {@link de.dlr.sistec.modi.metarepresentation.impl
     *          .Parameter#setType(de.dlr.sistec.modi.metarepresentation.impl
     *          .ModelItem)}.
     */
    public void testSetType() {
        ModelItem newType = new ModelItem();
        parameter.setType(newType);
        assertSame(newType, parameter.getType());
    }
View Full Code Here

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

public class ModelItemTest extends TestCase {

    ModelItem modelItem;

    public void setUp() {
        modelItem = new ModelItem();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.