Package org.tinyuml.model

Examples of org.tinyuml.model.UmlModelElement


  /**
   * Tests the initial state.
   */
  public void testInitial() {
    // initial
    UmlModelElement elem = new AbstractUmlModelElement() { };
    assertEquals(0, elem.getReferenceCount());
  }
View Full Code Here


  /**
   * Tests the clone() method.
   */
  public void testClone() {
    Mock mockListener = mock(UmlModelElementListener.class);
    UmlModelElement element = new MyModelElement();
    element.addModelElementListener((UmlModelElementListener)
      mockListener.proxy());
    UmlModelElement cloned = (UmlModelElement) element.clone();
    assertTrue(element != cloned);
    assertTrue(element.getModelElementListeners() !=
      cloned.getModelElementListeners());
  }
View Full Code Here

  /**
   * Tests the reference count access methods.
   */
  public void testReferenceCounting() {
    UmlModelElement elem = new AbstractUmlModelElement() { };
   
    elem.incrementReferenceCount();
    elem.incrementReferenceCount();
    assertEquals(2, elem.getReferenceCount());
    elem.decrementReferenceCount();
    assertEquals(1, elem.getReferenceCount());
    elem.decrementReferenceCount();
    elem.decrementReferenceCount();
   
    // can not be less than 0
    assertEquals(0, elem.getReferenceCount());   
  }
View Full Code Here

   * Tests the setter method  behaviour.
   */
  public void testSetters() {
    Mock mockSource = mock(UmlModelElement.class);
    Mock mockTarget = mock(UmlModelElement.class);
    UmlModelElement source = (UmlModelElement) mockSource.proxy();
    UmlModelElement target = (UmlModelElement) mockTarget.proxy();
   
    relation.setElement1(source);
    relation.setElement2(target);
    assertEquals(source, relation.getElement1());
    assertEquals(target, relation.getElement2());
View Full Code Here

   * Tests the clone() method.
   */
  public void testClone() {
    Mock mockSource = mock(UmlModelElement.class);
    Mock mockTarget = mock(UmlModelElement.class);
    UmlModelElement source = (UmlModelElement) mockSource.proxy();
    UmlModelElement target = (UmlModelElement) mockTarget.proxy();   
    relation.setElement1(source);
    relation.setElement2(target);
    relation.setName("name");
    relation.setCanSetElement1Navigability(false);
    relation.setCanSetElement2Navigability(true);
View Full Code Here

   * Tests the setter method  behaviour.
   */
  public void testSetters() {
    Mock mockSource = mock(UmlModelElement.class);
    Mock mockTarget = mock(UmlModelElement.class);
    UmlModelElement source = (UmlModelElement) mockSource.proxy();
    UmlModelElement target = (UmlModelElement) mockTarget.proxy();
   
    assoc.setElement1(source);
    assoc.setElement2(target);
    assertEquals(source, assoc.getElement1());
    assertEquals(target, assoc.getElement2());
View Full Code Here

   * Tests the setter method  behaviour.
   */
  public void testSetters() {
    Mock mockSource = mock(UmlModelElement.class);
    Mock mockTarget = mock(UmlModelElement.class);
    UmlModelElement source = (UmlModelElement) mockSource.proxy();
    UmlModelElement target = (UmlModelElement) mockTarget.proxy();
   
    relation.setElement1(source);
    relation.setElement2(target);
    assertEquals(source, relation.getElement1());
    assertEquals(target, relation.getElement2());
View Full Code Here

   * Tests the clone() method.
   */
  public void testClone() {
    Mock mockSource = mock(UmlModelElement.class);
    Mock mockTarget = mock(UmlModelElement.class);
    UmlModelElement source = (UmlModelElement) mockSource.proxy();
    UmlModelElement target = (UmlModelElement) mockTarget.proxy();   
    relation.setElement1(source);
    relation.setElement2(target);
    relation.setName("name");
    relation.setCanSetElement1Navigability(false);
    relation.setCanSetElement2Navigability(true);
View Full Code Here

  /**
   * Tests the initial state.
   */
  public void testInitial() {
    // initial
    UmlModelElement elem = new UmlModelElement();
    assertEquals(0, elem.getReferenceCount());
  }
View Full Code Here

  /**
   * Tests the reference count access methods.
   */
  public void testReferenceCounting() {
    UmlModelElement elem = new UmlModelElement();
   
    elem.incrementReferenceCount();
    elem.incrementReferenceCount();
    assertEquals(2, elem.getReferenceCount());
    elem.decrementReferenceCount();
    assertEquals(1, elem.getReferenceCount());
    elem.decrementReferenceCount();
    elem.decrementReferenceCount();
   
    // can not be less than 0
    assertEquals(0, elem.getReferenceCount());   
  }
View Full Code Here

TOP

Related Classes of org.tinyuml.model.UmlModelElement

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.