Package org.jmock

Examples of org.jmock.Mock.stubs()


  protected Mock createMockUIComponent()
  {
    Mock mock = mock(UIComponent.class);
   
    mock.stubs().method("getParent").will(returnValue(null));
    mock.stubs().method("setParent");
    mock.expects(never()).method("processRestoreState");
    mock.expects(never()).method("processDecodes");
    mock.expects(never()).method("processValidators");
    mock.expects(never()).method("processUpdates");
    mock.expects(never()).method("processSaveState");
View Full Code Here


    return myTransport;
  }

  private Mock createJabberUIMock() {
    Mock mockUI = mock(JabberUI.class);
    mockUI.stubs().method("connectAndLogin").will(new ReturnStub(Boolean.TRUE){
      @Override
      public Object invoke(Invocation invocation) throws Throwable {
        myFacade.connect();
        return super.invoke(invocation);
      }
View Full Code Here

    myUserModel = new UserModelImpl(getBroadcaster());
    disposeOnTearDown(myUserModel);

    Mock dispatcherMock = mock(AsyncMessageDispatcher.class);
    myIDEFacade = new MockIDEFacade();
    dispatcherMock.stubs().method("getIdeFacade").will(returnValue(myIDEFacade));
    myTransport = new JabberTransport((JabberUI) myUIMock.proxy(), myFacade, myUserModel,
        (AsyncMessageDispatcher) dispatcherMock.proxy(), null);
    disposeOnTearDown(myTransport);

    myProjectContainer = Pico.getInstance().makeChildContainer();
View Full Code Here

    super.setUp();

    myUserMock = mock(User.class);
    myUser = (User) myUserMock.proxy();
    final Mock consoleStub = mock(ConsoleView.class);
    consoleStub.stubs().method(ANYTHING);
    consoleStub.stubs().method("getComponent").will(returnValue(new JLabel()));
    LocalMessageDispatcherImpl localMessageDispatcher = new LocalMessageDispatcherImpl(getBroadcaster(), new MockIDEFacade(getClass()), null);
    disposeOnTearDown(localMessageDispatcher);

    myMessagesTab = new MessagesTab(null, myUser,
View Full Code Here

    myUserMock = mock(User.class);
    myUser = (User) myUserMock.proxy();
    final Mock consoleStub = mock(ConsoleView.class);
    consoleStub.stubs().method(ANYTHING);
    consoleStub.stubs().method("getComponent").will(returnValue(new JLabel()));
    LocalMessageDispatcherImpl localMessageDispatcher = new LocalMessageDispatcherImpl(getBroadcaster(), new MockIDEFacade(getClass()), null);
    disposeOnTearDown(localMessageDispatcher);

    myMessagesTab = new MessagesTab(null, myUser,
        localMessageDispatcher, true) {
View Full Code Here

    UIComponent component,
    String      facetName)
  {
    Mock mockFacetValue = mock(UIComponent.class);
    UIComponent facetValue = (UIComponent) mockFacetValue.proxy();
    mockFacetValue.stubs().method("getParent").will(returnValue(null));
    mockFacetValue.stubs().method("setParent");

    Mock mockPropValue = mock(UIComponent.class);
    UIComponent propValue = (UIComponent) mockPropValue.proxy();
    mockPropValue.stubs().method("getParent").will(returnValue(null));
View Full Code Here

    String      facetName)
  {
    Mock mockFacetValue = mock(UIComponent.class);
    UIComponent facetValue = (UIComponent) mockFacetValue.proxy();
    mockFacetValue.stubs().method("getParent").will(returnValue(null));
    mockFacetValue.stubs().method("setParent");

    Mock mockPropValue = mock(UIComponent.class);
    UIComponent propValue = (UIComponent) mockPropValue.proxy();
    mockPropValue.stubs().method("getParent").will(returnValue(null));
    mockPropValue.stubs().method("setParent");
View Full Code Here

    mockFacetValue.stubs().method("getParent").will(returnValue(null));
    mockFacetValue.stubs().method("setParent");

    Mock mockPropValue = mock(UIComponent.class);
    UIComponent propValue = (UIComponent) mockPropValue.proxy();
    mockPropValue.stubs().method("getParent").will(returnValue(null));
    mockPropValue.stubs().method("setParent");

    Map<String, UIComponent> facetMap = component.getFacets();
    try
    {
View Full Code Here

    mockFacetValue.stubs().method("setParent");

    Mock mockPropValue = mock(UIComponent.class);
    UIComponent propValue = (UIComponent) mockPropValue.proxy();
    mockPropValue.stubs().method("getParent").will(returnValue(null));
    mockPropValue.stubs().method("setParent");

    Map<String, UIComponent> facetMap = component.getFacets();
    try
    {
      // bean info is cached
View Full Code Here

   */
  protected Mock createMockUIComponent()
  {
    Mock mock = mock(UIComponent.class);

    mock.stubs().method("getParent").will(returnValue(null));
    mock.stubs().method("setParent");
    mock.stubs().method("getFacetsAndChildren").will(returnIterator(Collections.emptyList()));

    mock.expects(never()).method("processRestoreState");
    mock.expects(never()).method("processDecodes");
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.