Package org.eclipse.uml2.uml

Examples of org.eclipse.uml2.uml.EnumerationLiteral


      else if (oPropExp.getElement() instanceof EReferenceImpl) {
        EReferenceImpl oRef = (EReferenceImpl) oPropExp.getElement();
        return oRef.getDefaultValueLiteral();
      }
      else if (oPropExp.getElement() instanceof EnumerationLiteral) {
        EnumerationLiteral oEnum = (EnumerationLiteral)oPropExp.getElement();
        return oEnum.getName();
      }
 
    }
    return null;
  }
View Full Code Here


      else if (oPropExp.getElement() instanceof EReferenceImpl) {
        EReferenceImpl oRef = (EReferenceImpl) oPropExp.getElement();
        return oRef.getDefaultValueLiteral();
      }
      else if (oPropExp.getElement() instanceof EnumerationLiteral) {
        EnumerationLiteral oEnum = (EnumerationLiteral)oPropExp.getElement();
        return oEnum.getName();
      }
 
    }
    return null;
  }
View Full Code Here

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

    Enumeration enumeration = mock(Enumeration.class);
    EList<EnumerationLiteral> enumLiterals = mock(EList.class);
    Iterator<EnumerationLiteral> enumIter = mock(Iterator.class);
    EnumerationLiteral enumLiteral = mock(EnumerationLiteral.class);

    EList<Slot> slots = mock(EList.class);
    Iterator<Slot> slotIter = mock(Iterator.class);
    Slot slot = mock(Slot.class);

    Property property = mock(Property.class);
    Type type = mock(Type.class);

    EList<ValueSpecification> valueSpecifications = mock(EList.class);
    Iterator<ValueSpecification> valueSpecificationIter = mock(Iterator.class);
    ValueSpecification valueSpecification = 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(false);
    when(slotIter.next()).thenReturn(slot);
    when(slot.getDefiningFeature()).thenReturn(property);
View Full Code Here

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

    Enumeration enumeration = mock(Enumeration.class);
    EList<EnumerationLiteral> enumLiterals = mock(EList.class);
    Iterator<EnumerationLiteral> enumIter = mock(Iterator.class);
    EnumerationLiteral enumLiteral = mock(EnumerationLiteral.class);

    EList<Slot> slots = mock(EList.class);
    Iterator<Slot> slotIter = mock(Iterator.class);
    Slot slot = mock(Slot.class);

    Property property = mock(Property.class);
    Type type = mock(Type.class);

    EList<ValueSpecification> valueSpecifications = mock(EList.class);
    Iterator<ValueSpecification> valueSpecificationIter = mock(Iterator.class);
    ValueSpecification valueSpecification = 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(false);
    when(slotIter.next()).thenReturn(slot);
    when(slot.getDefiningFeature()).thenReturn(property);
View Full Code Here

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

    Enumeration enumeration = mock(Enumeration.class);
    EList<EnumerationLiteral> enumLiterals = mock(EList.class);
    Iterator<EnumerationLiteral> enumIter = mock(Iterator.class);
    EnumerationLiteral enumLiteral = mock(EnumerationLiteral.class);

    EList<Slot> slots = mock(EList.class);
    Iterator<Slot> slotIter = mock(Iterator.class);
    Slot slot = mock(Slot.class);

    Property property = mock(Property.class);
    Type type = mock(Type.class);

    EList<ValueSpecification> valueSpecifications = mock(EList.class);
    Iterator<ValueSpecification> valueSpecificationIter = mock(Iterator.class);
    ValueSpecification valueSpecification = 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(false);
    when(slotIter.next()).thenReturn(slot);
    when(slot.getDefiningFeature()).thenReturn(property);
View Full Code Here

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

    Enumeration enumeration = mock(Enumeration.class);
    EList<EnumerationLiteral> enumLiterals = mock(EList.class);
    Iterator<EnumerationLiteral> enumIter = mock(Iterator.class);
    EnumerationLiteral enumLiteral = mock(EnumerationLiteral.class);

    EList<Slot> slots = mock(EList.class);
    Iterator<Slot> slotIter = mock(Iterator.class);
    Slot slot = mock(Slot.class);

    Property property = mock(Property.class);
    Type type = mock(Type.class);

    EList<ValueSpecification> valueSpecifications = mock(EList.class);
    Iterator<ValueSpecification> valueSpecificationIter = mock(Iterator.class);
    ValueSpecification valueSpecification = 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(false);
    when(slotIter.next()).thenReturn(slot);
    when(slot.getDefiningFeature()).thenReturn(property);
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  @Test
  public void testFindSlotByNameFoundIt() {
    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);
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  @Test
  public void testFindSlotByNameNotFound() {
    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);
View Full Code Here

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

    Enumeration enumeration = mock(Enumeration.class);
    EList<EnumerationLiteral> enumLiterals = mock(EList.class);
    Iterator<EnumerationLiteral> enumIter = mock(Iterator.class);
    EnumerationLiteral enumLiteral = mock(EnumerationLiteral.class);

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

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

    Enumeration enumeration = mock(Enumeration.class);
    EList<EnumerationLiteral> enumLiterals = mock(EList.class);
    Iterator<EnumerationLiteral> enumIter = mock(Iterator.class);
    EnumerationLiteral enumLiteral = mock(EnumerationLiteral.class);

    EList<Slot> slots1 = mock(EList.class);
    EList<Slot> slots2 = mock(EList.class);
    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)
View Full Code Here

TOP

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

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.