Search in sources :

Example 1 with DebugElement

use of com.mvp4g.rebind.config.element.DebugElement in project mvp4g by mvp4g.

the class Mvp4gConfigurationTest method testDebug.

@Test
public void testDebug() throws NotFoundClassException, InvalidTypeException {
    DebugElement debug = new DebugElement();
    oracle.addClass(OneObject.class);
    debug.setLogger(OneObject.class.getCanonicalName());
    configuration.setDebug(debug);
    try {
        configuration.validateDebug();
        fail();
    } catch (InvalidTypeException e) {
        assertTrue(e.getMessage().contains(Mvp4gLogger.class.getCanonicalName()));
    }
    debug = new DebugElement();
    oracle.addClass(DefaultMvp4gLogger.class);
    debug.setLogger(DefaultMvp4gLogger.class.getCanonicalName());
    configuration.setDebug(debug);
    configuration.validateDebug();
    configuration.setDebug(null);
    configuration.validateDebug();
}
Also used : DefaultMvp4gLogger(com.mvp4g.client.event.DefaultMvp4gLogger) DebugElement(com.mvp4g.rebind.config.element.DebugElement) Mvp4gLogger(com.mvp4g.client.event.Mvp4gLogger) DefaultMvp4gLogger(com.mvp4g.client.event.DefaultMvp4gLogger) OneObject(com.mvp4g.rebind.test_tools.OneObject) InvalidTypeException(com.mvp4g.rebind.exception.InvalidTypeException) Test(org.junit.Test)

Example 2 with DebugElement

use of com.mvp4g.rebind.config.element.DebugElement in project mvp4g by mvp4g.

the class Mvp4gConfigurationTest method testSetterGetter.

@Test
public void testSetterGetter() {
    StartElement start = new StartElement();
    configuration.setStart(start);
    assertSame(start, configuration.getStart());
    HistoryElement history = new HistoryElement();
    configuration.setHistory(history);
    assertSame(history, configuration.getHistory());
    EventBusElement eventBus = new EventBusElement("", "", false);
    configuration.setEventBus(eventBus);
    assertSame(eventBus, configuration.getEventBus());
    JClassType module = oracle.findType(Mvp4gModule.class.getCanonicalName());
    configuration.setModule(module);
    assertSame(module, configuration.getModule());
    JClassType parentEventBus = oracle.addClass(EventBus.class);
    configuration.setParentEventBus(parentEventBus);
    assertSame(parentEventBus, configuration.getParentEventBus());
    String historyName = "historyName";
    configuration.setHistoryName("historyName");
    assertSame(historyName, configuration.getHistoryName());
    ChildModulesElement childConfig = new ChildModulesElement();
    configuration.setLoadChildConfig(childConfig);
    assertSame(childConfig, configuration.getLoadChildConfig());
    DebugElement debug = new DebugElement();
    configuration.setDebug(debug);
    assertSame(debug, configuration.getDebug());
    GinModuleElement gin = new GinModuleElement();
    configuration.setGinModule(gin);
    assertSame(gin, configuration.getGinModule());
    EventFiltersElement filters = new EventFiltersElement();
    configuration.setEventFilterConfiguration(filters);
    assertSame(filters, configuration.getEventFilterConfiguration());
}
Also used : StartElement(com.mvp4g.rebind.config.element.StartElement) HistoryElement(com.mvp4g.rebind.config.element.HistoryElement) JClassType(com.google.gwt.core.ext.typeinfo.JClassType) GinModuleElement(com.mvp4g.rebind.config.element.GinModuleElement) Mvp4gModule(com.mvp4g.client.Mvp4gModule) ChildModulesElement(com.mvp4g.rebind.config.element.ChildModulesElement) EventBusElement(com.mvp4g.rebind.config.element.EventBusElement) DebugElement(com.mvp4g.rebind.config.element.DebugElement) EventFiltersElement(com.mvp4g.rebind.config.element.EventFiltersElement) Test(org.junit.Test)

Aggregations

DebugElement (com.mvp4g.rebind.config.element.DebugElement)2 Test (org.junit.Test)2 JClassType (com.google.gwt.core.ext.typeinfo.JClassType)1 Mvp4gModule (com.mvp4g.client.Mvp4gModule)1 DefaultMvp4gLogger (com.mvp4g.client.event.DefaultMvp4gLogger)1 Mvp4gLogger (com.mvp4g.client.event.Mvp4gLogger)1 ChildModulesElement (com.mvp4g.rebind.config.element.ChildModulesElement)1 EventBusElement (com.mvp4g.rebind.config.element.EventBusElement)1 EventFiltersElement (com.mvp4g.rebind.config.element.EventFiltersElement)1 GinModuleElement (com.mvp4g.rebind.config.element.GinModuleElement)1 HistoryElement (com.mvp4g.rebind.config.element.HistoryElement)1 StartElement (com.mvp4g.rebind.config.element.StartElement)1 InvalidTypeException (com.mvp4g.rebind.exception.InvalidTypeException)1 OneObject (com.mvp4g.rebind.test_tools.OneObject)1