Examples of expects()


Examples of org.apache.camel.component.mock.MockEndpoint.expects()

                    for (int i = 0; i < expectedBody.length; i++) {
                        assertEquals(expectedBody[i], actualBodyTyped[i]);
                    }
                }
            };
            endpoint.expects(runnable);
            sendBody("direct:a", new String[] {"1234", "", ""});
            endpoint.assertIsSatisfied();
        }
    }
View Full Code Here

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

public class ThreadedEngineQueueBehaviour extends ThreadedQueueBehaviour {
   
    public void shouldPassAlongGameRequests() throws Exception {
       
        Mock listener = mock(GameRequestListener.class);
        listener.expects("requestGlyphMovement").with(GlyphMovement.DROP);
       
        final ThreadedEngineQueue queue = new ThreadedEngineQueue();
        queue.setGameRequestDelegate((GameRequestListener) listener);
        queue.requestStartGame();
        queue.requestGlyphMovement(GlyphMovement.DROP);
View Full Code Here

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

public class AcceleratingHeartbeatBehaviour extends UsingMiniMock {

 
  public void shouldBeatAfterElapsedTime() throws Exception {
    Mock heartbeatListener = mock(HeartbeatListener.class);
    heartbeatListener.expects("beat").atLeastOnce();
   
    AcceleratingHeartbeat heartbeat = new AcceleratingHeartbeat();
    heartbeat.addListener((HeartbeatListener)heartbeatListener);
    heartbeat.start(3);
 
View Full Code Here

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

        // Nor this.
    }
 
  public void shouldNotBeatAfterBeingStopped() throws Exception {
    Mock heartbeatListener = mock(HeartbeatListener.class);
    heartbeatListener.expects("beat").never();
   
    AcceleratingHeartbeat heartbeat = new AcceleratingHeartbeat();
    heartbeat.start(3);
 
    heartbeat.stop();
View Full Code Here

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

        game.addGlyphListener((GlyphListener) glyphListener);
       
        Segments initialSegments = GlyphType.T.getSegments(0).movedRight(3);
       
        glyphListener.stubs("reportGlyphMovement").with(eq(GlyphType.JUNK), anything(), anything());
        glyphListener.expects("reportGlyphMovement").with(eq(GlyphType.T), anything(), eq(initialSegments));
        glyphListener.expects("reportGlyphMovement").with(eq(GlyphType.T), eq(initialSegments), eq(initialSegments.movedDown()));
        game.requestStartGame();
        heartbeat.beat();
       
        verifyMocks();
View Full Code Here

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

       
        Segments initialSegments = GlyphType.T.getSegments(0).movedRight(3);
       
        glyphListener.stubs("reportGlyphMovement").with(eq(GlyphType.JUNK), anything(), anything());
        glyphListener.expects("reportGlyphMovement").with(eq(GlyphType.T), anything(), eq(initialSegments));
        glyphListener.expects("reportGlyphMovement").with(eq(GlyphType.T), eq(initialSegments), eq(initialSegments.movedDown()));
        game.requestStartGame();
        heartbeat.beat();
       
        verifyMocks();
    }
View Full Code Here

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

  public void shouldRunOnRequestStartAndStartHeartbeatAndInformListeners() throws Exception {
   
      StubHeartbeat heartbeat = new StubHeartbeat();

        Mock gameListener = mock(GameListener.class);
    gameListener.expects("reportGameStateChanged").once().with(GameState.READY);
    gameListener.expects("reportGameStateChanged").once().with(GameState.RUNNING);
   
        Game game = new Game(new PseudoRandomGlyphFactory(7, 13), heartbeat, 7, 13);
   
    game.addGameListener((GameListener)gameListener);
View Full Code Here

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

   
      StubHeartbeat heartbeat = new StubHeartbeat();

        Mock gameListener = mock(GameListener.class);
    gameListener.expects("reportGameStateChanged").once().with(GameState.READY);
    gameListener.expects("reportGameStateChanged").once().with(GameState.RUNNING);
   
        Game game = new Game(new PseudoRandomGlyphFactory(7, 13), heartbeat, 7, 13);
   
    game.addGameListener((GameListener)gameListener);
    game.requestStartGame();
View Full Code Here

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

       
        LivingGlyph firstGlyph = new LivingGlyph(GlyphType.T, new StubCollisionDetector(13), 3);
        LivingGlyph secondGlyph = new LivingGlyph(GlyphType.S, CollisionDetector.NULL, 3);
        Junk junk = new Junk(7, 13);
       
        glyphFactoryMock.expects("nextGlyph").inOrder()
            .with(new Matcher[] {isA(CollisionDetector.class), isA(ListenerSet.class)})
            .will(returnValue(firstGlyph), returnValue(secondGlyph));
        glyphFactoryMock.expects("createJunk").with(isA(ListenerSet.class)).will(returnValue(junk));

        Segments segmentsForTShapeOnFloor = droppedToFloor(GlyphType.T.getSegments(0).movedRight(3), 13);
View Full Code Here

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

        Junk junk = new Junk(7, 13);
       
        glyphFactoryMock.expects("nextGlyph").inOrder()
            .with(new Matcher[] {isA(CollisionDetector.class), isA(ListenerSet.class)})
            .will(returnValue(firstGlyph), returnValue(secondGlyph));
        glyphFactoryMock.expects("createJunk").with(isA(ListenerSet.class)).will(returnValue(junk));

        Segments segmentsForTShapeOnFloor = droppedToFloor(GlyphType.T.getSegments(0).movedRight(3), 13);
       
        Game game = new Game((GlyphFactory) glyphFactoryMock, heartbeat, 7, 13);
        game.requestStartGame();
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.