Package org.jmock

Examples of org.jmock.Mock.verify()


    // now we set date and type so this is expected to work fine.

    String expectedOut = dtConv.getAsString(facesContext, component, date);
    assertEquals(inputValue, expectedOut);

    mock.verify();
  }

  public void testLeniencyOnPrimaryPattern()
  {
    String primaryPattern = "MMM/d/yyyy";
View Full Code Here


      dtConv.setType("INVALID"); // make this type invalid

      Date convDate = (Date) dtConv.getAsObject(facesContext, component,
                                                validInputs[i]);
      assertEquals(convDate, dt);
      mock.verify();
    }
  }

  public void testCompareDateTimeConverter()
  {
View Full Code Here

        ServletActionContext.setRequest(request);

        CreateSessionInterceptor interceptor = new CreateSessionInterceptor();
        interceptor.intercept(new MockActionInvocation());

        httpServletRequestMock.verify();
    }
}
View Full Code Here

    public void testGet() {
        Mock mockRequest = mock(PortletRequest.class, "testGet");
        mockRequest.expects(once()).method("getAttribute").with(eq("testAttribute")).will(returnValue("testValue"));
        PortletRequestMap map = new PortletRequestMap((PortletRequest)mockRequest.proxy());
        String value = (String)map.get("testAttribute");
        mockRequest.verify();
        assertEquals("testValue", value);
    }

    public void testPut() {
        Mock mockRequest = mock(PortletRequest.class, "testPut");
View Full Code Here

        Constraint[] params = new Constraint[]{eq("testAttribute"), eq(value)};
        mockRequest.expects(once()).method("setAttribute").with(params);
        mockRequest.expects(once()).method("getAttribute").with(eq("testAttribute")).will(returnValue(value));
        PortletRequestMap map = new PortletRequestMap((PortletRequest)mockRequest.proxy());
        Object obj = map.put("testAttribute", value);
        mockRequest.verify();
        assertEquals(obj, value);
    }

    public void testClear() {
        Mock mockRequest = mock(PortletRequest.class, "testClear");
View Full Code Here

        mockRequest.expects(once()).method("getAttributeNames").will(returnValue(Collections.enumeration(dummy)));

        PortletRequestMap map = new PortletRequestMap((PortletRequest)mockRequest.proxy());
        map.clear();
        mockRequest.verify();
    }

    public void testRemove() {
        Mock mockRequest = mock(PortletRequest.class);
View Full Code Here

        ServletActionContext.setRequest(request);

        CreateSessionInterceptor interceptor = new CreateSessionInterceptor();
        interceptor.intercept(new MockActionInvocation());

        httpServletRequestMock.verify();
    }
}
View Full Code Here

      fail("Unable to access facet property \"" + facetName + "\"");
    }
    finally
    {
      mockFacetValue.verify();
      mockPropValue.verify();
    }
  }

  /**
   * Tests the apply-request-values lifecycle phase.
View Full Code Here

      setCurrentContext(null);
    }

    mockRenderKitFactory.verify();
    mockRenderkit.verify();
    mockRenderer.verify();
  }


  @SuppressWarnings("unchecked")
  protected void doTestApplyRequestValues(
View Full Code Here

    root.processDecodes(context);

    if (attributeChangeTester != null)
      attributeChangeTester.verify();

    mock.verify();
  }

  /**
   * Tests the process-validations lifecycle phase.
   */
 
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.