@@ -0,0 +1,2642 @@
+package forklift.replay;%0A%0Aimport forklift.decorators.ConsumerRole;%0Aimport forklift.source.SourceI;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Apublic class ReplaySourceTest %7B%0A    /*%0A     * Equality tests (really obvious stuff)%0A     */%0A    @Test%0A    public void testEqualsWorksNormally() %7B%0A        final String testRole = %22test-role%22;%0A%0A        Assert.assertEquals(new ReplaySource(testRole),%0A                            new ReplaySource(testRole));%0A    %7D%0A%0A    @Test%0A    public void testDifferentReplaySourcesAreNotEqual() %7B%0A        Assert.assertNotEquals(new ReplaySource(%22test-role%22),%0A                               new ReplaySource(%22other-role%22));%0A    %7D%0A%0A    @Test%0A    public void testUndefinedReplaySourcesAreEqual() %7B%0A        Assert.assertEquals(new ReplaySource(%22%22),%0A                            new ReplaySource((String) null));%0A    %7D%0A%0A    @Test%0A    public void testSourceWithNoRoleHasUndefinedRole() %7B%0A        Assert.assertFalse(new ReplaySource(%22%22).isRoleDefined());%0A        Assert.assertFalse(new ReplaySource((String) null).isRoleDefined());%0A    %7D%0A%0A    /*%0A     * Test inializing ReplaySource with context works as expected%0A     */%0A    @Test%0A    public void testClassWithNoRoleSetHasClassnameRole() %7B%0A        final ReplaySource source = (ReplaySource) SourceI.getSources(UnnamedConsumer.class).get(0);%0A%0A        Assert.assertTrue(source.isRoleDefined());%0A        Assert.assertEquals(%22UnnamedConsumer%22, source.getRole());%0A    %7D%0A%0A    @Test%0A    public void testClassWithReplayRoleHasGivenRole() %7B%0A        final ReplaySource source = (ReplaySource) SourceI.getSources(ReplayRoleConsumer.class).get(0);%0A%0A        Assert.assertTrue(source.isRoleDefined());%0A        Assert.assertEquals(%22test-role%22, source.getRole());%0A    %7D%0A%0A    @Test%0A    public void testClassWithConsumerRoleHasGivenRole() %7B%0A        final ReplaySource source = (ReplaySource) SourceI.getSources(ConsumerRoleConsumer.class).get(0);%0A%0A        Assert.assertTrue(source.isRoleDefined());%0A        Assert.assertEquals(%22test-consumer-role%22, source.getRole());%0A    %7D%0A%0A    @Test%0A    public void testClassWithMultipleRolesUsesReplayRole() %7B%0A        final ReplaySource source = (ReplaySource) SourceI.getSources(MultipleRoleConsumer.class).get(0);%0A%0A        Assert.assertTrue(source.isRoleDefined());%0A        Assert.assertEquals(%22replay-role%22, source.getRole());%0A    %7D%0A%0A    @Replay%0A    class UnnamedConsumer %7B%7D%0A%0A    @Replay(role = %22test-role%22)%0A    class ReplayRoleConsumer %7B%7D%0A%0A    @ConsumerRole(name = %22test-consumer-role%22)%0A    @Replay%0A    class ConsumerRoleConsumer %7B%7D%0A%0A    @ConsumerRole(name = %22consumer-role%22)%0A    @Replay(role = %22replay-role%22)%0A    class MultipleRoleConsumer %7B%7D%0A%7D%0A

Add tests for ReplaySource