Package org.tomighty.bus.messages.timer

Examples of org.tomighty.bus.messages.timer.TimerStarted


    @Override
    public void start(Time time, Phase phase) {
        interrupt();
        state = new TimerState(time, phase);
        scheduleTimer();
        bus.publish(new TimerStarted(time, phase));
    }
View Full Code Here


        assertEquals("Second message", TimerTick.class, messages.get(1).getClass());
        assertEquals("Third message", TimerTick.class, messages.get(2).getClass());
        assertEquals("Fourth message", TimerTick.class, messages.get(3).getClass());
        assertEquals("Fifth message", TimerFinished.class, messages.get(4).getClass());

        TimerStarted timerStarted = (TimerStarted) messages.get(0);
        assertEquals("Initial time", Time.seconds(3), timerStarted.getTime());
        assertEquals("Phase when timer started", Phase.POMODORO, timerStarted.getPhase());

        TimerTick firstTick = (TimerTick) messages.get(1);
        assertEquals("First tick's time", Time.seconds(2), firstTick.getTime());
        assertEquals("First tick's phase", Phase.POMODORO, firstTick.getPhase());
View Full Code Here

        assertEquals("Amount of published messages", 3, messages.size());
        assertEquals("First message", TimerStarted.class, messages.get(0).getClass());
        assertEquals("Second message", TimerTick.class, messages.get(1).getClass());
        assertEquals("Third message", TimerInterrupted.class, messages.get(2).getClass());

        TimerStarted timerStarted = (TimerStarted) messages.get(0);
        assertEquals("Initial time", Time.seconds(3), timerStarted.getTime());
        assertEquals("Phase when timer started", Phase.BREAK, timerStarted.getPhase());

        TimerTick tick = (TimerTick) messages.get(1);
        assertEquals("Tick's time", Time.seconds(2), tick.getTime());
        assertEquals("Tick's phase", Phase.BREAK, tick.getPhase());
View Full Code Here

TOP

Related Classes of org.tomighty.bus.messages.timer.TimerStarted

Copyright © 2018 www.massapicom. 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.