@@ -0,0 +1,1453 @@
+package com.lmax.disruptor;%0A%0Aimport static org.hamcrest.Matchers.greaterThanOrEqualTo;%0Aimport static org.junit.Assert.*;%0A%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport org.jmock.Expectations;%0Aimport org.jmock.Mockery;%0Aimport org.jmock.integration.junit4.JMock;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0A%0A@RunWith(JMock.class)%0Apublic class LiteTimeoutBlockingWaitStrategyTest%0A%7B%0A    private final Mockery mockery = new Mockery();%0A%0A    @Test%0A    public void shouldTimeoutWaitFor() throws Exception%0A    %7B%0A        final SequenceBarrier sequenceBarrier = mockery.mock(SequenceBarrier.class);%0A%0A        long theTimeout = 500;%0A        LiteTimeoutBlockingWaitStrategy waitStrategy = new LiteTimeoutBlockingWaitStrategy(theTimeout, TimeUnit.MILLISECONDS);%0A        Sequence cursor = new Sequence(5);%0A        Sequence dependent = cursor;%0A%0A        mockery.checking(%0A            new Expectations()%0A            %7B%0A                %7B%0A                    allowing(sequenceBarrier).checkAlert();%0A                %7D%0A            %7D);%0A%0A        long t0 = System.currentTimeMillis();%0A%0A        try%0A        %7B%0A            waitStrategy.waitFor(6, cursor, dependent, sequenceBarrier);%0A            fail(%22TimeoutException should have been thrown%22);%0A        %7D%0A        catch (TimeoutException e)%0A        %7B%0A        %7D%0A%0A        long t1 = System.currentTimeMillis();%0A%0A        long timeWaiting = t1 - t0;%0A%0A        assertThat(timeWaiting, greaterThanOrEqualTo(theTimeout));%0A    %7D%0A%7D%0A

Test for the timeout behaviour of the LiteTimeoutBlockingWaitStrategy.