Examples of createMock()


Examples of org.jboss.test.faces.mock.MockFacesEnvironment.createMock()

     * Test method for {@link ScriptUtils#writeToStream(javax.faces.context.ResponseWriter, Object)}
     */
    public void testWriteToStream() throws Exception {
        MockFacesEnvironment environment = MockFacesEnvironment.createEnvironment();

        ResponseWriter mockWriter = environment.createMock(ResponseWriter.class);
        Capture<? extends Object> capture = new Capture<Object>(CaptureType.ALL) {
            /**
             *
             */
            private static final long serialVersionUID = -4915440411892856583L;
View Full Code Here

Examples of spock.lang.Specification.createMock()

  private Object createDummy(IMockInvocation invocation) {
    Class<?> type = invocation.getMethod().getReturnType();
    Type genericType = invocation.getMethod().getExactReturnType();
    Specification spec = invocation.getMockObject().getSpecification();
    return spec.createMock("dummy", genericType, MockNature.STUB, GroovyObject.class.isAssignableFrom(type) ?
        MockImplementation.GROOVY : MockImplementation.JAVA, Collections.<String, Object>emptyMap(), null);
  }
}
View Full Code Here

Examples of utils.EasyMockHelper.createMock()

      ApplicationArguments.initialize(new String[] {});
     
      EasyMockHelper mockHelper = new EasyMockHelper();
     
      // mocks
      IApplication mockApplication = mockHelper.createMock(IApplication.class);
      SquirrelPreferences mockPreferences = mockHelper.createMock(SquirrelPreferences.class);
      IUpdateSettings mockUpdateSettings = mockHelper.createMock(IUpdateSettings.class);
     
      expect(mockApplication.getSquirrelPreferences()).andStubReturn(mockPreferences);
      expect(mockPreferences.getUpdateSettings()).andStubReturn(mockUpdateSettings);
View Full Code Here

Examples of utils.EasyMockHelper.createMock()

     
      EasyMockHelper mockHelper = new EasyMockHelper();
     
      // mocks
      IApplication mockApplication = mockHelper.createMock(IApplication.class);
      SquirrelPreferences mockPreferences = mockHelper.createMock(SquirrelPreferences.class);
      IUpdateSettings mockUpdateSettings = mockHelper.createMock(IUpdateSettings.class);
     
      expect(mockApplication.getSquirrelPreferences()).andStubReturn(mockPreferences);
      expect(mockPreferences.getUpdateSettings()).andStubReturn(mockUpdateSettings);
      expect(mockUpdateSettings.getUpdateServer()).andStubReturn("aTestServer");
View Full Code Here

Examples of utils.EasyMockHelper.createMock()

      EasyMockHelper mockHelper = new EasyMockHelper();
     
      // mocks
      IApplication mockApplication = mockHelper.createMock(IApplication.class);
      SquirrelPreferences mockPreferences = mockHelper.createMock(SquirrelPreferences.class);
      IUpdateSettings mockUpdateSettings = mockHelper.createMock(IUpdateSettings.class);
     
      expect(mockApplication.getSquirrelPreferences()).andStubReturn(mockPreferences);
      expect(mockPreferences.getUpdateSettings()).andStubReturn(mockUpdateSettings);
      expect(mockUpdateSettings.getUpdateServer()).andStubReturn("aTestServer");
      expect(mockUpdateSettings.getUpdateServerPort()).andStubReturn("aTestServerPort");
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.