Package org.eclipse.uml2.uml

Examples of org.eclipse.uml2.uml.Property


    CompilationUnit cu = ast.newCompilationUnit();
    EnumDeclaration ed = enumGenerator.generateEnum(clazz, ast, cu);

    EList<Property> properties = mock(EList.class);
    Iterator<Property> propertyIter = mock(Iterator.class);
    Property property = mock(Property.class);
    Type type = mock(Type.class);
    String name = "type";

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

    when(clazz.getAttributes()).thenReturn(properties);
    when(properties.iterator()).thenReturn(propertyIter);
    when(propertyIter.hasNext()).thenReturn(true).thenReturn(false);
    when(propertyIter.next()).thenReturn(property);
    when(property.getType()).thenReturn(type);
    when(property.getName()).thenReturn(name);
    when(property.getUpper()).thenReturn(1);
    when(property.getLower()).thenReturn(1);
    when(property.getOwnedComments()).thenReturn(comments);
    when(type.getName()).thenReturn("String");
    when(type.getQualifiedName()).thenReturn("String");

    enumGenerator.generateGetterMethod(clazz, ast, ed);
View Full Code Here


    CompilationUnit cu = ast.newCompilationUnit();
    EnumDeclaration ed = enumGenerator.generateEnum(clazz, ast, cu);

    EList<Property> properties = mock(EList.class);
    Iterator<Property> propertyIter = mock(Iterator.class);
    Property property = mock(Property.class);
    Type type = mock(Type.class);
    String name = "type";

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

    when(clazz.getAttributes()).thenReturn(properties);
    when(properties.iterator()).thenReturn(propertyIter);
    when(propertyIter.hasNext()).thenReturn(true).thenReturn(false);
    when(propertyIter.next()).thenReturn(property);
    when(property.getType()).thenReturn(type);
    when(property.getName()).thenReturn(name);
    when(property.getUpper()).thenReturn(1);
    when(property.getLower()).thenReturn(1);
    when(property.getOwnedComments()).thenReturn(comments);
    when(type.getName()).thenReturn("Data::String");
    when(type.getQualifiedName()).thenReturn("Data::String");

    enumGenerator.generateGetterMethod(clazz, ast, ed);
View Full Code Here

    CompilationUnit cu = ast.newCompilationUnit();
    EnumDeclaration ed = enumGenerator.generateEnum(clazz, ast, cu);

    EList<Property> properties = mock(EList.class);
    Iterator<Property> propertyIter = mock(Iterator.class);
    Property property = mock(Property.class);
    Type type = mock(Type.class);
    String name = "type";

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

    when(clazz.getAttributes()).thenReturn(properties);
    when(properties.iterator()).thenReturn(propertyIter);
    when(propertyIter.hasNext()).thenReturn(true).thenReturn(false);
    when(propertyIter.next()).thenReturn(property);
    when(property.getType()).thenReturn(type);
    when(property.getName()).thenReturn(name);
    when(property.getUpper()).thenReturn(1);
    when(property.getLower()).thenReturn(1);
    when(property.getOwnedComments()).thenReturn(comments);
    when(type.getName()).thenReturn("Data::String");
    when(type.getQualifiedName()).thenReturn("Data::String");

    enumGenerator.generateGetterMethod(clazz, ast, ed, "Data");
View Full Code Here

    CompilationUnit cu = ast.newCompilationUnit();
    EnumDeclaration ed = enumGenerator.generateEnum(clazz, ast, cu);

    EList<Property> properties = mock(EList.class);
    Iterator<Property> propertyIter = mock(Iterator.class);
    Property property = mock(Property.class);
    Type type = mock(Type.class);
    String name = "type";

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

    when(clazz.getAttributes()).thenReturn(properties);
    when(properties.iterator()).thenReturn(propertyIter);
    when(propertyIter.hasNext()).thenReturn(true).thenReturn(false);
    when(propertyIter.next()).thenReturn(property);
    when(property.getType()).thenReturn(type);
    when(property.getName()).thenReturn(name);
    when(property.getUpper()).thenReturn(1);
    when(property.getLower()).thenReturn(1);
    when(property.getOwnedComments()).thenReturn(comments);
    when(type.getName()).thenReturn("String");
    when(type.getQualifiedName()).thenReturn("String");

    enumGenerator.generateAttributes(clazz, ast, ed);
View Full Code Here

    Iterator<Property> firstPropertyIter = mock(Iterator.class);

    EList<Property> secondProperties = mock(EList.class);
    Iterator<Property> secondPropertyIter = mock(Iterator.class);

    Property property = mock(Property.class);
    Type type = mock(Type.class);
    String name = "type";

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

    when(clazz.getAttributes()).thenReturn(firstProperties).thenReturn(
        secondProperties);
    when(firstProperties.iterator()).thenReturn(firstPropertyIter);
    when(firstPropertyIter.hasNext()).thenReturn(true).thenReturn(false);
    when(firstPropertyIter.next()).thenReturn(property);

    when(secondProperties.iterator()).thenReturn(secondPropertyIter);
    when(secondPropertyIter.hasNext()).thenReturn(true).thenReturn(false);
    when(secondPropertyIter.next()).thenReturn(property);

    when(property.getType()).thenReturn(type);
    when(property.getName()).thenReturn(name);
    when(property.getUpper()).thenReturn(1);
    when(property.getLower()).thenReturn(1);
    when(property.getOwnedComments()).thenReturn(comments);
    when(type.getName()).thenReturn("String");
    when(type.getQualifiedName()).thenReturn("String");

    enumGenerator.generateConstructor(clazz, ast, ed);
View Full Code Here

    Iterator<Property> firstPropertyIter = mock(Iterator.class);

    EList<Property> secondProperties = mock(EList.class);
    Iterator<Property> secondPropertyIter = mock(Iterator.class);

    Property firstProperty = mock(Property.class);
    Type firstType = mock(Type.class);
    String firstName = "type";

    Property secondProperty = mock(Property.class);
    Type secondType = mock(Type.class);
    String secondName = "count";

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

    when(clazz.getAttributes()).thenReturn(firstProperties).thenReturn(
        secondProperties);
    when(firstProperties.iterator()).thenReturn(firstPropertyIter);
    when(firstPropertyIter.hasNext()).thenReturn(true).thenReturn(true)
        .thenReturn(false);
    when(firstPropertyIter.next()).thenReturn(firstProperty).thenReturn(
        secondProperty);

    when(secondProperties.iterator()).thenReturn(secondPropertyIter);
    when(secondPropertyIter.hasNext()).thenReturn(true).thenReturn(true)
        .thenReturn(false);
    when(secondPropertyIter.next()).thenReturn(firstProperty).thenReturn(
        secondProperty);

    when(firstProperty.getType()).thenReturn(firstType);
    when(firstProperty.getName()).thenReturn(firstName);
    when(firstProperty.getUpper()).thenReturn(1);
    when(firstProperty.getLower()).thenReturn(1);
    when(firstProperty.getOwnedComments()).thenReturn(comments);
    when(firstType.getName()).thenReturn("String");
    when(firstType.getQualifiedName()).thenReturn("String");

    when(secondProperty.getType()).thenReturn(secondType);
    when(secondProperty.getName()).thenReturn(secondName);
    when(secondProperty.getUpper()).thenReturn(1);
    when(secondProperty.getLower()).thenReturn(1);
    when(secondProperty.getOwnedComments()).thenReturn(comments);
    when(secondType.getName()).thenReturn("Integer");
    when(secondType.getQualifiedName()).thenReturn("Integer");

    enumGenerator.generateConstructor(clazz, ast, ed);
View Full Code Here

    md.modifiers().add(
        ast.newModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD));

    EList<Property> properties = mock(EList.class);
    Iterator<Property> propertyIter = mock(Iterator.class);
    Property propertyName = mock(Property.class);
    String name = "name";
    Type typeName = mock(Type.class);
    Property propertyCount = mock(Property.class);
    String count = "count";
    Type typeCount = mock(Type.class);

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

    when(clazz.getAttributes()).thenReturn(properties);
    when(properties.iterator()).thenReturn(propertyIter);
    when(propertyIter.hasNext()).thenReturn(true).thenReturn(true)
        .thenReturn(false);
    when(propertyIter.next()).thenReturn(propertyName).thenReturn(
        propertyCount);

    when(propertyName.getType()).thenReturn(typeName);
    when(propertyName.getName()).thenReturn(name);
    when(propertyName.getUpper()).thenReturn(1);
    when(propertyName.getLower()).thenReturn(1);
    when(propertyName.getOwnedComments()).thenReturn(comments);
    when(typeName.getName()).thenReturn("String");
    when(typeName.getQualifiedName()).thenReturn("String");

    when(propertyCount.getType()).thenReturn(typeCount);
    when(propertyCount.getName()).thenReturn(count);
    when(propertyCount.getUpper()).thenReturn(1);
    when(propertyCount.getLower()).thenReturn(1);
    when(propertyCount.getOwnedComments()).thenReturn(comments);
    when(typeCount.getName()).thenReturn("Integer");
    when(typeCount.getQualifiedName()).thenReturn("Integer");

    enumGenerator.generateContructorParameters(clazz, ast, md);
View Full Code Here

    EnumerationLiteral enumLiteral = mock(EnumerationLiteral.class);
    EList<Slot> slots = mock(EList.class, Answers.RETURNS_DEEP_STUBS.get());
    Iterator<Slot> slotIter = mock(Iterator.class);
    Slot slot1 = mock(Slot.class);
    Slot slot2 = mock(Slot.class);
    Property property1 = mock(Property.class);
    Property property2 = mock(Property.class);

    when(enumLiteral.getSlots()).thenReturn(slots);
    when(slots.iterator()).thenReturn(slotIter);
    when(slotIter.hasNext()).thenReturn(true).thenReturn(true)
        .thenReturn(false);
    when(slotIter.next()).thenReturn(slot1).thenReturn(slot2);
    when(slot1.getDefiningFeature()).thenReturn(property1);
    when(slot2.getDefiningFeature()).thenReturn(property2);
    when(property1.getName()).thenReturn("test1");
    when(property2.getName()).thenReturn("test2");

    Slot slotResult = enumGenerator.findSlotByName("test1", enumLiteral);

    assertEquals(slot1, slotResult);
  }
View Full Code Here

    EnumerationLiteral enumLiteral = mock(EnumerationLiteral.class);
    EList<Slot> slots = mock(EList.class, Answers.RETURNS_DEEP_STUBS.get());
    Iterator<Slot> slotIter = mock(Iterator.class);
    Slot slot1 = mock(Slot.class);
    Slot slot2 = mock(Slot.class);
    Property property1 = mock(Property.class);
    Property property2 = mock(Property.class);

    when(enumLiteral.getSlots()).thenReturn(slots);
    when(slots.iterator()).thenReturn(slotIter);
    when(slotIter.hasNext()).thenReturn(true).thenReturn(true)
        .thenReturn(false);
    when(slotIter.next()).thenReturn(slot1).thenReturn(slot2);
    when(slot1.getDefiningFeature()).thenReturn(property1);
    when(slot2.getDefiningFeature()).thenReturn(property2);
    when(property1.getName()).thenReturn("test1");
    when(property2.getName()).thenReturn("test2");

    Slot slotResult = enumGenerator.findSlotByName("test3", enumLiteral);

    assertEquals(null, slotResult);
  }
View Full Code Here

    EList<Slot> slots = mock(EList.class);
    Iterator<Slot> slotIter = 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(slots);
    when(slots.iterator()).thenReturn(slotIter);
    when(slotIter.hasNext()).thenReturn(true).thenReturn(true)
        .thenReturn(false);
    when(slotIter.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

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.