Search in sources :

Example 6 with EventBus

use of com.mvp4g.client.event.EventBus 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)

Example 7 with EventBus

use of com.mvp4g.client.event.EventBus in project mvp4g by mvp4g.

the class Mvp4gConfigurationTest method testRemoveClearHistory.

@Test
public void testRemoveClearHistory() throws InvalidMvp4gConfigurationException {
    HistoryConverterElement e = new HistoryConverterElement();
    e.setClassName(ClearHistory.class.getCanonicalName());
    historyConverters.add(e);
    EventBusElement eventBus = new EventBusElement(EventBus.class.getName(), BaseEventBus.class.getName(), false);
    configuration.setEventBus(eventBus);
    configuration.validateHistoryConverters();
}
Also used : HistoryConverterElement(com.mvp4g.rebind.config.element.HistoryConverterElement) ClearHistory(com.mvp4g.client.history.ClearHistory) EventBusElement(com.mvp4g.rebind.config.element.EventBusElement) BaseEventBus(com.mvp4g.client.event.BaseEventBus) EventBus(com.mvp4g.client.event.EventBus) BaseEventBus(com.mvp4g.client.event.BaseEventBus) Test(org.junit.Test)

Aggregations

BaseEventBus (com.mvp4g.client.event.BaseEventBus)7 EventBus (com.mvp4g.client.event.EventBus)7 EventBusElement (com.mvp4g.rebind.config.element.EventBusElement)7 Test (org.junit.Test)7 InvalidTypeException (com.mvp4g.rebind.exception.InvalidTypeException)5 EventElement (com.mvp4g.rebind.config.element.EventElement)3 HistoryConverterElement (com.mvp4g.rebind.config.element.HistoryConverterElement)2 PresenterElement (com.mvp4g.rebind.config.element.PresenterElement)2 Loaders (com.mvp4g.rebind.test_tools.Loaders)2 Modules (com.mvp4g.rebind.test_tools.Modules)2 JClassType (com.google.gwt.core.ext.typeinfo.JClassType)1 ClearHistory (com.mvp4g.client.history.ClearHistory)1 ChildModuleElement (com.mvp4g.rebind.config.element.ChildModuleElement)1 EventFilterElement (com.mvp4g.rebind.config.element.EventFilterElement)1 EventHandlerElement (com.mvp4g.rebind.config.element.EventHandlerElement)1 ViewElement (com.mvp4g.rebind.config.element.ViewElement)1 Splitters (com.mvp4g.rebind.test_tools.Splitters)1 EventFilters (com.mvp4g.rebind.test_tools.annotation.EventFilters)1 EventBusOk (com.mvp4g.rebind.test_tools.annotation.events.EventBusOk)1