Package org.eclipse.uml2.uml

Examples of org.eclipse.uml2.uml.Property


    Iterator<Slot> slotIter1 = mock(Iterator.class);
    Iterator<Slot> slotIter2 = mock(Iterator.class);
    Slot slot1 = mock(Slot.class);
    Slot slot2 = mock(Slot.class);

    Property property1 = mock(Property.class);
    Property property2 = mock(Property.class);
    Type type1 = mock(Type.class);
    Type type2 = mock(Type.class);

    EList<ValueSpecification> valueSpecifications1 = mock(EList.class);
    Iterator<ValueSpecification> valueSpecificationIter1 = mock(Iterator.class);
    EList<ValueSpecification> valueSpecifications2 = mock(EList.class);
    Iterator<ValueSpecification> valueSpecificationIter2 = mock(Iterator.class);
    ValueSpecification valueSpecification1 = mock(ValueSpecification.class);
    ValueSpecification valueSpecification2 = mock(ValueSpecification.class);

    when(enumeration.getOwnedLiterals()).thenReturn(enumLiterals);
    when(enumLiterals.iterator()).thenReturn(enumIter);
    when(enumIter.hasNext()).thenReturn(true).thenReturn(false);
    when(enumIter.next()).thenReturn(enumLiteral);
    when(enumLiteral.getName()).thenReturn("Home");

    when(enumLiteral.getSlots()).thenReturn(slots1).thenReturn(slots2);
    when(slots1.iterator()).thenReturn(slotIter1);
    when(slots2.iterator()).thenReturn(slotIter2);
    when(slotIter1.hasNext()).thenReturn(true).thenReturn(true)
        .thenReturn(false);
    when(slotIter2.hasNext()).thenReturn(true).thenReturn(true)
        .thenReturn(false);
    when(slotIter1.next()).thenReturn(slot1).thenReturn(slot2);
    when(slotIter2.next()).thenReturn(slot1).thenReturn(slot2);
    when(slot1.getDefiningFeature()).thenReturn(property1);
    when(slot2.getDefiningFeature()).thenReturn(property2);

    when(property1.getType()).thenReturn(type1);
    when(property2.getType()).thenReturn(type2);
    when(property1.getName()).thenReturn("type");
    when(property2.getName()).thenReturn("name");
    when(type1.getName()).thenReturn("boolean");
    when(type2.getName()).thenReturn("String");

    when(slot1.getValues()).thenReturn(valueSpecifications1);
    when(slot2.getValues()).thenReturn(valueSpecifications2);
View Full Code Here


    td.modifiers().add(modifier);
    td.setName(ast.newSimpleName("Company"));
    MethodDeclaration md = ast.newMethodDeclaration();
    md.setName(ast.newSimpleName("calculateAge"));

    Property property = mock(Property.class,
        Answers.RETURNS_DEEP_STUBS.get());
    EList<Comment> comments = mock(EList.class,
        Answers.RETURNS_DEEP_STUBS.get());
    Iterator<Comment> commentIterator = mock(Iterator.class);
    Comment comment = mock(Comment.class, Answers.RETURNS_DEEP_STUBS.get());

    when(property.getOwnedComments()).thenReturn(comments);
    when(comments.iterator()).thenReturn(commentIterator);
    when(commentIterator.hasNext()).thenReturn(true, false);
    when(commentIterator.next()).thenReturn(comment);
    when(comment.getBody()).thenReturn(
        "Comment...\nTest\n@author: Lofi Dewanto");
View Full Code Here

    Modifier modifier = ast
        .newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
    td.modifiers().add(modifier);
    td.setName(ast.newSimpleName("Company"));

    Property property = mock(Property.class);

    MethodDeclaration mdGetter = ast.newMethodDeclaration();
    mdGetter.setName(ast.newSimpleName("getCompanies"));

    String umlQualifiedTypeName = "test.de.Company";
    String umlTypeName = "Company";

    when(property.isOrdered()).thenReturn(true);
    when(property.isUnique()).thenReturn(false);

    interfaceGenerator.generateAssociationEndUpperCardinalityMultiples(ast,
        td, property, mdGetter, umlTypeName, umlQualifiedTypeName);

    assertEquals("java.util.List<test.de.Company>", mdGetter
View Full Code Here

    Modifier modifier = ast
        .newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
    td.modifiers().add(modifier);
    td.setName(ast.newSimpleName("Company"));

    Property property = mock(Property.class);

    MethodDeclaration mdGetter = ast.newMethodDeclaration();
    mdGetter.setName(ast.newSimpleName("getCompanies"));

    String umlQualifiedTypeName = "test.de.Company";
    String umlTypeName = "Company";

    when(property.isOrdered()).thenReturn(false);
    when(property.isUnique()).thenReturn(true);

    interfaceGenerator.generateAssociationEndUpperCardinalityMultiples(ast,
        td, property, mdGetter, umlTypeName, umlQualifiedTypeName);

    assertEquals("java.util.Set<test.de.Company>", mdGetter
View Full Code Here

    Modifier modifier = ast
        .newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
    td.modifiers().add(modifier);
    td.setName(ast.newSimpleName("Company"));

    Property property = mock(Property.class);

    MethodDeclaration mdGetter = ast.newMethodDeclaration();
    mdGetter.setName(ast.newSimpleName("getCompanies"));

    String umlQualifiedTypeName = "test.de.Company";
    String umlTypeName = "Company";

    when(property.isOrdered()).thenReturn(false);
    when(property.isUnique()).thenReturn(false);

    interfaceGenerator.generateAssociationEndUpperCardinalityMultiples(ast,
        td, property, mdGetter, umlTypeName, umlQualifiedTypeName);

    assertEquals("java.util.Collection<test.de.Company>", mdGetter
View Full Code Here

    Modifier modifier = ast
        .newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
    td.modifiers().add(modifier);
    td.setName(ast.newSimpleName("Company"));

    Property property = mock(Property.class);

    MethodDeclaration mdGetter = ast.newMethodDeclaration();
    mdGetter.setName(ast.newSimpleName("getCompanies"));

    String umlQualifiedTypeName = "test.de.Company";
    String umlTypeName = "Company";

    when(property.isOrdered()).thenReturn(true);
    when(property.isUnique()).thenReturn(true);

    interfaceGenerator.generateAssociationEndUpperCardinalityMultiples(ast,
        td, property, mdGetter, umlTypeName, umlQualifiedTypeName);

    assertEquals("java.util.SortedSet<test.de.Company>", mdGetter
View Full Code Here

    Modifier modifier = ast
        .newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
    td.modifiers().add(modifier);
    td.setName(ast.newSimpleName("Company"));

    Property property = mock(Property.class);

    String umlQualifiedTypeName = "test.de.Company";
    String umlTypeName = "Company";

    EList<Comment> comments = mock(EList.class,
        Answers.RETURNS_DEEP_STUBS.get());

    when(property.getName()).thenReturn("name");
    when(property.getUpper()).thenReturn(0);
    when(property.getOwnedComments()).thenReturn(comments);

    interfaceGenerator.generateGetterMethod(ast, td, property, umlTypeName,
        umlQualifiedTypeName);

    MethodDeclaration[] methods = td.getMethods();
View Full Code Here

    Modifier modifier = ast
        .newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
    td.modifiers().add(modifier);
    td.setName(ast.newSimpleName("Company"));

    Property property = mock(Property.class);

    String umlQualifiedTypeName = "test.de.Company";
    String umlTypeName = "Company";

    EList<Comment> comments = mock(EList.class,
        Answers.RETURNS_DEEP_STUBS.get());

    when(property.getName()).thenReturn("name");
    when(property.getUpper()).thenReturn(-1);
    when(property.getOwnedComments()).thenReturn(comments);

    interfaceGenerator.generateGetterMethod(ast, td, property, umlTypeName,
        umlQualifiedTypeName);

    MethodDeclaration[] methods = td.getMethods();
View Full Code Here

    Modifier modifier = ast
        .newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
    td.modifiers().add(modifier);
    td.setName(ast.newSimpleName("Company"));

    Property property = mock(Property.class);

    String umlQualifiedTypeName = "Boolean";
    String umlTypeName = "Boolean";

    EList<Comment> comments = mock(EList.class,
        Answers.RETURNS_DEEP_STUBS.get());

    when(property.getName()).thenReturn("name");
    when(property.getUpper()).thenReturn(0);
    when(property.getOwnedComments()).thenReturn(comments);

    interfaceGenerator.generateGetterMethod(ast, td, property, umlTypeName,
        umlQualifiedTypeName);

    MethodDeclaration[] methods = td.getMethods();
View Full Code Here

    Modifier modifier = ast
        .newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
    td.modifiers().add(modifier);
    td.setName(ast.newSimpleName("Company"));

    Property property = mock(Property.class);

    String umlQualifiedTypeName = "boolean";
    String umlTypeName = "boolean";

    EList<Comment> comments = mock(EList.class,
        Answers.RETURNS_DEEP_STUBS.get());

    when(property.getName()).thenReturn("name");
    when(property.getUpper()).thenReturn(0);
    when(property.getOwnedComments()).thenReturn(comments);

    interfaceGenerator.generateGetterMethod(ast, td, property, umlTypeName,
        umlQualifiedTypeName);

    MethodDeclaration[] methods = td.getMethods();
View Full Code Here

TOP

Related Classes of org.eclipse.uml2.uml.Property

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.