Examples of expects()


Examples of org.jbehave.core.mock.Mock.expects()

        scenario.specify();
       
        // expect
        given1.expects("setUp").with(world);
        given2.expects("setUp").with(world).after(given1, "setUp");
        outcome.expects("setExpectationsIn").with(world).after(given2, "setUp");
        event.expects("occurIn").with(world).after(outcome, "setExpectationsIn");
        outcome.expects("verify").with(world).after(event, "occurIn");
       
        // when
        scenario.run(world);
View Full Code Here

Examples of org.jmock.Mock.expects()

        action.setUrlValidator( new ContinuumUrlValidator() );
        Mock projectBuilder = mock( ContinuumProjectBuilder.class );

        projectBuilderManagerMock.expects( once() ).method( "getProjectBuilder" ).will(
            returnValue( projectBuilder.proxy() ) );
        projectBuilder.expects( once() ).method( "buildProjectsFromMetadata" ).will(
            returnValue( new ContinuumProjectBuildingResult() ) );

        projectBuilder.expects( once() ).method( "getDefaultBuildDefinitionTemplate" ).will(
            returnValue( getDefaultBuildDefinitionTemplate() ) );
View Full Code Here

Examples of org.jmock.Mock.expects()

        projectBuilderManagerMock.expects( once() ).method( "getProjectBuilder" ).will(
            returnValue( projectBuilder.proxy() ) );
        projectBuilder.expects( once() ).method( "buildProjectsFromMetadata" ).will(
            returnValue( new ContinuumProjectBuildingResult() ) );

        projectBuilder.expects( once() ).method( "getDefaultBuildDefinitionTemplate" ).will(
            returnValue( getDefaultBuildDefinitionTemplate() ) );

        mavenSettingsBuilderMock.expects( once() ).method( "buildSettings" ).will( returnValue( new Settings() ) );

    }
View Full Code Here

Examples of org.jmock.Mock.expects()

*/
public class CreateSessionInterceptorTest extends StrutsInternalTestCase {

    public void testCreateSession() throws Exception {
        Mock httpServletRequestMock = new Mock(HttpServletRequest.class);
        httpServletRequestMock.expects(new InvokeOnceMatcher()).method("getSession").with(new IsEqual(Boolean.FALSE));
        httpServletRequestMock.expects(new InvokeOnceMatcher()).method("getSession").with(new IsEqual(Boolean.TRUE));
        httpServletRequestMock.expects(new InvokeOnceMatcher()).method("getSession").with(new IsEqual(Boolean.FALSE));
        HttpServletRequest request = (HttpServletRequest) httpServletRequestMock.proxy();

        ServletActionContext.setRequest(request);
View Full Code Here

Examples of org.jmock.Mock.expects()

public class CreateSessionInterceptorTest extends StrutsInternalTestCase {

    public void testCreateSession() throws Exception {
        Mock httpServletRequestMock = new Mock(HttpServletRequest.class);
        httpServletRequestMock.expects(new InvokeOnceMatcher()).method("getSession").with(new IsEqual(Boolean.FALSE));
        httpServletRequestMock.expects(new InvokeOnceMatcher()).method("getSession").with(new IsEqual(Boolean.TRUE));
        httpServletRequestMock.expects(new InvokeOnceMatcher()).method("getSession").with(new IsEqual(Boolean.FALSE));
        HttpServletRequest request = (HttpServletRequest) httpServletRequestMock.proxy();

        ServletActionContext.setRequest(request);
View Full Code Here

Examples of org.jmock.Mock.expects()

    public void testCreateSession() throws Exception {
        Mock httpServletRequestMock = new Mock(HttpServletRequest.class);
        httpServletRequestMock.expects(new InvokeOnceMatcher()).method("getSession").with(new IsEqual(Boolean.FALSE));
        httpServletRequestMock.expects(new InvokeOnceMatcher()).method("getSession").with(new IsEqual(Boolean.TRUE));
        httpServletRequestMock.expects(new InvokeOnceMatcher()).method("getSession").with(new IsEqual(Boolean.FALSE));
        HttpServletRequest request = (HttpServletRequest) httpServletRequestMock.proxy();

        ServletActionContext.setRequest(request);

        CreateSessionInterceptor interceptor = new CreateSessionInterceptor();
View Full Code Here

Examples of org.jmock.Mock.expects()

  public void testOperation(){
   
    Mock daoMock = mock(Dao.class);
   
    daoMock.expects(once())
      .method("find")
      .with(isA(String.class))
      .will(returnValue("String"));
   
    serviceImplTest.setDao((Dao)daoMock.proxy());
View Full Code Here

Examples of org.jmock.Mock.expects()

        Constraint c = new CollectionConstraint(c1);
       
        mockVisior.expects(once()).method("visitParameter")
            .with(same(c)).id("v");
        mockC1.expects(once()).method("accept")
            .with(same(visitor)).after(mockVisior, "v");
       
        c.accept(visitor);
    }
}
View Full Code Here

Examples of org.jmock.Mock.expects()

        DefaultPicoContainer pico = new DefaultPicoContainer();
        Object foo = new Object();
        ComponentAdapter componentAdapter = pico.registerComponentInstance(foo);

        Mock fooVisitor = new Mock(PicoVisitor.class);
        fooVisitor.expects(once()).method("visitContainer").with(eq(pico));
        fooVisitor.expects(once()).method("visitComponentAdapter").with(eq(componentAdapter));

        ImmutablePicoContainer ipc = new ImmutablePicoContainer(pico);

        ipc.accept((PicoVisitor) fooVisitor.proxy());
View Full Code Here

Examples of org.jmock.Mock.expects()

        Object foo = new Object();
        ComponentAdapter componentAdapter = pico.registerComponentInstance(foo);

        Mock fooVisitor = new Mock(PicoVisitor.class);
        fooVisitor.expects(once()).method("visitContainer").with(eq(pico));
        fooVisitor.expects(once()).method("visitComponentAdapter").with(eq(componentAdapter));

        ImmutablePicoContainer ipc = new ImmutablePicoContainer(pico);

        ipc.accept((PicoVisitor) fooVisitor.proxy());
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.