// Path: src/test/java/com/viadeo/axonframework/eventhandling/cluster/fixture/groupb/GroupB.java
// public interface GroupB {
// 
//     class EventListenerA extends EventListenerWrapper {
//         public EventListenerA() {
//             this(null);
//         }
// 
//         public EventListenerA(final EventListener delegate) {
//             super(delegate);
//         }
//     }
// 
//     class EventListenerB extends EventListenerWrapper {
//         public EventListenerB() {
//             this(null);
//         }
// 
//         public EventListenerB(final EventListener delegate) {
//             super(delegate);
//         }
//     }
// }
// 
// Path: src/test/java/com/viadeo/axonframework/eventhandling/cluster/fixture/groupa/GroupA.java
// public interface GroupA {
// 
//     class EventListenerA extends EventListenerWrapper {
//         public EventListenerA() {
//             this(null);
//         }
// 
//         public EventListenerA(final EventListener delegate) {
//             super(delegate);
//         }
//     }
// 
//     class EventListenerB extends EventListenerWrapper {
//         public EventListenerB() {
//             this(null);
//         }
// 
//         public EventListenerB(final EventListener delegate) {
//             super(delegate);
//         }
//     }
// }


import com.viadeo.axonframework.eventhandling.cluster.fixture.groupb.GroupB;
import com.viadeo.axonframework.eventhandling.cluster.fixture.groupa.GroupA;
import org.axonframework.eventhandling.Cluster;
import org.axonframework.eventhandling.SimpleCluster;
import org.junit.Test;
import static org.junit.Assert.*;
    public void selectCluster_withNullAsGivenEventListener_throwException() throws Exception {
        // Given
        final ClassnameDynamicClusterSelector clusterSelector = initClusterSelector();

        // When
        clusterSelector.selectCluster(null);

        // Then throws an exception
    }

    @Test
    public void selectCluster_withEventListenerB_returnClusterNamedAfterPackageOfListener() throws Exception {
        // Given
        final ClassnameDynamicClusterSelector clusterSelector = initClusterSelector();

        final GroupB.EventListenerB eventListenerB = new GroupB.EventListenerB();

        // When
        final Cluster cluster = clusterSelector.selectCluster(eventListenerB);

        // Then
        assertNotNull(cluster);
        assertEquals("groupb", cluster.getName());
    }

    @Test
    public void selectCluster_withEventListenerA_returnClusterNamedAfterPackageOfListener() throws Exception {
        // Given
        final ClassnameDynamicClusterSelector clusterSelector = initClusterSelector();

// Path: src/test/java/com/viadeo/axonframework/eventhandling/cluster/fixture/groupb/GroupB.java
// public interface GroupB {
// 
//     class EventListenerA extends EventListenerWrapper {
//         public EventListenerA() {
//             this(null);
//         }
// 
//         public EventListenerA(final EventListener delegate) {
//             super(delegate);
//         }
//     }
// 
//     class EventListenerB extends EventListenerWrapper {
//         public EventListenerB() {
//             this(null);
//         }
// 
//         public EventListenerB(final EventListener delegate) {
//             super(delegate);
//         }
//     }
// }
// 
// Path: src/test/java/com/viadeo/axonframework/eventhandling/cluster/fixture/groupa/GroupA.java
// public interface GroupA {
// 
//     class EventListenerA extends EventListenerWrapper {
//         public EventListenerA() {
//             this(null);
//         }
// 
//         public EventListenerA(final EventListener delegate) {
//             super(delegate);
//         }
//     }
// 
//     class EventListenerB extends EventListenerWrapper {
//         public EventListenerB() {
//             this(null);
//         }
// 
//         public EventListenerB(final EventListener delegate) {
//             super(delegate);
//         }
//     }
// }


// Path: src/test/java/com/viadeo/axonframework/eventhandling/cluster/ClassnameDynamicClusterSelectorUTest.java
import com.viadeo.axonframework.eventhandling.cluster.fixture.groupb.GroupB;
import com.viadeo.axonframework.eventhandling.cluster.fixture.groupa.GroupA;
import org.axonframework.eventhandling.Cluster;
import org.axonframework.eventhandling.SimpleCluster;
import org.junit.Test;
import static org.junit.Assert.*;

    public void selectCluster_withNullAsGivenEventListener_throwException() throws Exception {
        // Given
        final ClassnameDynamicClusterSelector clusterSelector = initClusterSelector();

        // When
        clusterSelector.selectCluster(null);

        // Then throws an exception
    }

    @Test
    public void selectCluster_withEventListenerB_returnClusterNamedAfterPackageOfListener() throws Exception {
        // Given
        final ClassnameDynamicClusterSelector clusterSelector = initClusterSelector();

        final GroupB.EventListenerB eventListenerB = new GroupB.EventListenerB();

        // When
        final Cluster cluster = clusterSelector.selectCluster(eventListenerB);

        // Then
        assertNotNull(cluster);
        assertEquals("groupb", cluster.getName());
    }

    @Test
    public void selectCluster_withEventListenerA_returnClusterNamedAfterPackageOfListener() throws Exception {
        // Given
        final ClassnameDynamicClusterSelector clusterSelector = initClusterSelector();

        final GroupA.EventListenerA eventListenerA = new GroupA.EventListenerA();