Search in sources :

Example 26 with InvalidMvp4gConfigurationException

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

the class Mvp4gConfigurationTest method testForwardEventWithParameter.

@Test
public void testForwardEventWithParameter() throws InvalidMvp4gConfigurationException {
    configuration.setModule(oracle.addClass(Modules.Module01.class));
    EventElement e = newEvent("forward");
    e.setEventObjectClass(new String[] { Object.class.getCanonicalName() });
    events.add(e);
    StartElement start = configuration.getStart();
    start.setForwardEventType("forward");
    try {
        setEventBus();
        JClassType parentEventBus = oracle.addClass(EventBus.class);
        configuration.setParentEventBus(parentEventBus);
        configuration.validateEvents();
        fail();
    } catch (InvalidMvp4gConfigurationException ex) {
        assertEquals("Forward: Forward event forward can't have any object associated with it.", ex.getMessage());
    }
}
Also used : StartElement(com.mvp4g.rebind.config.element.StartElement) JClassType(com.google.gwt.core.ext.typeinfo.JClassType) EventElement(com.mvp4g.rebind.config.element.EventElement) InvalidMvp4gConfigurationException(com.mvp4g.rebind.exception.InvalidMvp4gConfigurationException) OneObject(com.mvp4g.rebind.test_tools.OneObject) Test(org.junit.Test)

Example 27 with InvalidMvp4gConfigurationException

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

the class Mvp4gConfigurationTest method testEmptyHistoryNameForRoot.

@Test
public void testEmptyHistoryNameForRoot() {
    EventElement e = newEvent("start");
    e.setEventObjectClass(new String[] { Object.class.getCanonicalName() });
    e.setHistory("history");
    e.setName("");
    events.add(e);
    try {
        configuration.validateHistoryConverters();
        fail();
    } catch (InvalidMvp4gConfigurationException ex) {
        assertEquals("Event start: An event of the Mvp4g Root module can't have an history name equal to empty string.", ex.getMessage());
    }
}
Also used : EventElement(com.mvp4g.rebind.config.element.EventElement) InvalidMvp4gConfigurationException(com.mvp4g.rebind.exception.InvalidMvp4gConfigurationException) OneObject(com.mvp4g.rebind.test_tools.OneObject) Test(org.junit.Test)

Aggregations

InvalidMvp4gConfigurationException (com.mvp4g.rebind.exception.InvalidMvp4gConfigurationException)27 Test (org.junit.Test)26 EventElement (com.mvp4g.rebind.config.element.EventElement)18 OneObject (com.mvp4g.rebind.test_tools.OneObject)11 Modules (com.mvp4g.rebind.test_tools.Modules)9 ChildModuleElement (com.mvp4g.rebind.config.element.ChildModuleElement)5 JClassType (com.google.gwt.core.ext.typeinfo.JClassType)3 GinModule (com.google.gwt.inject.client.GinModule)3 DefaultMvp4gGinModule (com.mvp4g.client.DefaultMvp4gGinModule)3 BaseEventBus (com.mvp4g.client.event.BaseEventBus)3 EventBusElement (com.mvp4g.rebind.config.element.EventBusElement)3 GinModuleElement (com.mvp4g.rebind.config.element.GinModuleElement)3 PresenterElement (com.mvp4g.rebind.config.element.PresenterElement)3 StartElement (com.mvp4g.rebind.config.element.StartElement)3 InvalidTypeException (com.mvp4g.rebind.exception.InvalidTypeException)3 EventBusOk (com.mvp4g.rebind.test_tools.annotation.events.EventBusOk)3 OneGinModule (com.mvp4g.rebind.test_tools.annotation.gin.OneGinModule)3 EventBusWithLookup (com.mvp4g.client.event.EventBusWithLookup)2 HistoryConverterElement (com.mvp4g.rebind.config.element.HistoryConverterElement)2 ViewElement (com.mvp4g.rebind.config.element.ViewElement)2