Search in sources :

Example 11 with InvalidTypeException

use of com.mvp4g.rebind.exception.InvalidTypeException in project mvp4g by mvp4g.

the class Mvp4gConfigurationTest method testSplitterLoadersIncompatibleType.

@Test
public void testSplitterLoadersIncompatibleType() throws InvalidMvp4gConfigurationException {
    EventBusElement eventBus = new EventBusElement(EventBus.class.getName(), BaseEventBus.class.getName(), false);
    configuration.setEventBus(eventBus);
    oracle.addClass(Loaders.Loader1.class);
    oracle.addClass(Splitters.SplitterWithLoader.class);
    PresenterElement presenter1 = newPresenter(SimplePresenter01.class, "presenter1");
    presenter1.setAsync(Splitters.SplitterWithLoader.class.getCanonicalName());
    presenters.add(presenter1);
    EventElement event = new EventElement();
    event.setHandlers(new String[] { "presenter1" });
    configuration.getEvents().add(event);
    try {
        configuration.validateSplitters();
        fail();
    } catch (InvalidTypeException e) {
        assertTrue(e.getMessage().contains("Can not convert " + EventBus.class.getCanonicalName()));
    }
}
Also used : EventElement(com.mvp4g.rebind.config.element.EventElement) Splitters(com.mvp4g.rebind.test_tools.Splitters) EventBusElement(com.mvp4g.rebind.config.element.EventBusElement) BaseEventBus(com.mvp4g.client.event.BaseEventBus) Loaders(com.mvp4g.rebind.test_tools.Loaders) EventBus(com.mvp4g.client.event.EventBus) BaseEventBus(com.mvp4g.client.event.BaseEventBus) PresenterElement(com.mvp4g.rebind.config.element.PresenterElement) InvalidTypeException(com.mvp4g.rebind.exception.InvalidTypeException) Test(org.junit.Test)

Aggregations

InvalidTypeException (com.mvp4g.rebind.exception.InvalidTypeException)11 Test (org.junit.Test)11 BaseEventBus (com.mvp4g.client.event.BaseEventBus)5 EventBus (com.mvp4g.client.event.EventBus)5 EventBusElement (com.mvp4g.rebind.config.element.EventBusElement)5 EventElement (com.mvp4g.rebind.config.element.EventElement)5 PresenterElement (com.mvp4g.rebind.config.element.PresenterElement)4 GinModule (com.google.gwt.inject.client.GinModule)3 DefaultMvp4gGinModule (com.mvp4g.client.DefaultMvp4gGinModule)3 GinModuleElement (com.mvp4g.rebind.config.element.GinModuleElement)3 ViewElement (com.mvp4g.rebind.config.element.ViewElement)3 InvalidMvp4gConfigurationException (com.mvp4g.rebind.exception.InvalidMvp4gConfigurationException)3 OneObject (com.mvp4g.rebind.test_tools.OneObject)3 OneGinModule (com.mvp4g.rebind.test_tools.annotation.gin.OneGinModule)3 Loaders (com.mvp4g.rebind.test_tools.Loaders)2 DefaultMvp4gLogger (com.mvp4g.client.event.DefaultMvp4gLogger)1 Mvp4gLogger (com.mvp4g.client.event.Mvp4gLogger)1 ChildModuleElement (com.mvp4g.rebind.config.element.ChildModuleElement)1 DebugElement (com.mvp4g.rebind.config.element.DebugElement)1 EventFilterElement (com.mvp4g.rebind.config.element.EventFilterElement)1