Package org.jmock

Examples of org.jmock.Mock.expects()


    UmlStereotype stereo3 = (UmlStereotype) UmlStereotype.getPrototype().clone();
    stereotypeList.add(stereo1);
    stereotypeList.add(stereo2);
    stereotypeList.add(stereo3);
   
    mockListener.expects(once()).method("elementChanged").with(eq(clonedClass));
    clonedClass.setStereotypes(stereotypeList);
    assertEquals(stereotypeList, clonedClass.getStereotypes());
  }
 
  /**
 
View Full Code Here


    diagram.setSize(originalWidth, originalHeight);

    // simulate a node that is inside the bounds
    Mock mockNode1 = mock(Node.class);
    double node1X2 = 10.0, node1Y2 = 5.0;
    mockNode1.expects(atLeastOnce()).method("getAbsoluteX2").
      will(returnValue(node1X2));
    mockNode1.expects(atLeastOnce()).method("getAbsoluteY2").
      will(returnValue(node1Y2));
    diagram.nodeMoved((Node) mockNode1.proxy());
    assertEquals(originalWidth, diagram.getSize().getWidth());
View Full Code Here

    // simulate a node that is inside the bounds
    Mock mockNode1 = mock(Node.class);
    double node1X2 = 10.0, node1Y2 = 5.0;
    mockNode1.expects(atLeastOnce()).method("getAbsoluteX2").
      will(returnValue(node1X2));
    mockNode1.expects(atLeastOnce()).method("getAbsoluteY2").
      will(returnValue(node1Y2));
    diagram.nodeMoved((Node) mockNode1.proxy());
    assertEquals(originalWidth, diagram.getSize().getWidth());
    assertEquals(originalHeight, diagram.getSize().getHeight());
View Full Code Here

    assertEquals(originalHeight, diagram.getSize().getHeight());

    // simulate a node that is moved outside the bounds, resize the diagram
    Mock mockNode2 = mock(Node.class);
    double node2X2 = 55.0, node2Y2 = 67.0;
    mockNode2.expects(atLeastOnce()).method("getAbsoluteX2").
      will(returnValue(node2X2));
    mockNode2.expects(atLeastOnce()).method("getAbsoluteY2").
      will(returnValue(node2Y2));
    diagram.nodeMoved((Node) mockNode2.proxy());
    assertTrue(diagram.getSize().getWidth() >= node2X2);
View Full Code Here

    // simulate a node that is moved outside the bounds, resize the diagram
    Mock mockNode2 = mock(Node.class);
    double node2X2 = 55.0, node2Y2 = 67.0;
    mockNode2.expects(atLeastOnce()).method("getAbsoluteX2").
      will(returnValue(node2X2));
    mockNode2.expects(atLeastOnce()).method("getAbsoluteY2").
      will(returnValue(node2Y2));
    diagram.nodeMoved((Node) mockNode2.proxy());
    assertTrue(diagram.getSize().getWidth() >= node2X2);
    assertTrue(diagram.getSize().getHeight() >= node2Y2);
  }
View Full Code Here

    diagram.setSize(originalWidth, originalHeight);

    // simulate a node that is inside the bounds
    Mock mockNode1 = mock(Node.class);
    double node1X2 = 10.0, node1Y2 = 5.0;
    mockNode1.expects(once()).method("setParent").with(eq(diagram));
    mockNode1.expects(atLeastOnce()).method("getAbsoluteX2").
      will(returnValue(node1X2));
    mockNode1.expects(atLeastOnce()).method("getAbsoluteY2").
      will(returnValue(node1Y2));
    diagram.addChild((DiagramElement) mockNode1.proxy());
View Full Code Here

    // simulate a node that is inside the bounds
    Mock mockNode1 = mock(Node.class);
    double node1X2 = 10.0, node1Y2 = 5.0;
    mockNode1.expects(once()).method("setParent").with(eq(diagram));
    mockNode1.expects(atLeastOnce()).method("getAbsoluteX2").
      will(returnValue(node1X2));
    mockNode1.expects(atLeastOnce()).method("getAbsoluteY2").
      will(returnValue(node1Y2));
    diagram.addChild((DiagramElement) mockNode1.proxy());
    assertEquals(originalWidth, diagram.getSize().getWidth());
View Full Code Here

    Mock mockNode1 = mock(Node.class);
    double node1X2 = 10.0, node1Y2 = 5.0;
    mockNode1.expects(once()).method("setParent").with(eq(diagram));
    mockNode1.expects(atLeastOnce()).method("getAbsoluteX2").
      will(returnValue(node1X2));
    mockNode1.expects(atLeastOnce()).method("getAbsoluteY2").
      will(returnValue(node1Y2));
    diagram.addChild((DiagramElement) mockNode1.proxy());
    assertEquals(originalWidth, diagram.getSize().getWidth());
    assertEquals(originalHeight, diagram.getSize().getHeight());
View Full Code Here

    assertEquals(originalHeight, diagram.getSize().getHeight());

    // simulate a node that is moved outside the bounds, resize the diagram
    Mock mockNode2 = mock(Node.class);
    double node2X2 = 55.0, node2Y2 = 67.0;
    mockNode2.expects(once()).method("setParent").with(eq(diagram));
    mockNode2.expects(atLeastOnce()).method("getAbsoluteX2").
      will(returnValue(node2X2));
    mockNode2.expects(atLeastOnce()).method("getAbsoluteY2").
      will(returnValue(node2Y2));
    diagram.addChild((DiagramElement) mockNode2.proxy());
View Full Code Here

    // simulate a node that is moved outside the bounds, resize the diagram
    Mock mockNode2 = mock(Node.class);
    double node2X2 = 55.0, node2Y2 = 67.0;
    mockNode2.expects(once()).method("setParent").with(eq(diagram));
    mockNode2.expects(atLeastOnce()).method("getAbsoluteX2").
      will(returnValue(node2X2));
    mockNode2.expects(atLeastOnce()).method("getAbsoluteY2").
      will(returnValue(node2Y2));
    diagram.addChild((DiagramElement) mockNode2.proxy());
    assertTrue(diagram.getSize().getWidth() >= node2X2);
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.