Search in sources :

Example 1 with SimpleHistoryConverter01

use of com.mvp4g.rebind.test_tools.annotation.history_converters.SimpleHistoryConverter01 in project mvp4g by mvp4g.

the class Mvp4gConfigurationTest method testPresenterViewValidationFails.

@Test(expected = UnknownConfigurationElementException.class)
public void testPresenterViewValidationFails() throws UnknownConfigurationElementException, InvalidTypeException, InvalidClassException, NotFoundClassException {
    events.add(newEvent("badView"));
    services.add(newService("badView"));
    presenters.add(newPresenter(SimplePresenter01.class, "badView"));
    historyConverters.add(newHistoryConverter(SimpleHistoryConverter01.class, "badView"));
    PresenterElement presenter = newPresenter(SimplePresenter02.class, "testPresenter");
    presenter.setView("badView");
    presenters.add(presenter);
    configuration.validateViews();
}
Also used : SimpleHistoryConverter01(com.mvp4g.rebind.test_tools.annotation.history_converters.SimpleHistoryConverter01) PresenterElement(com.mvp4g.rebind.config.element.PresenterElement) SimplePresenter01(com.mvp4g.rebind.test_tools.annotation.presenters.SimplePresenter01) Test(org.junit.Test)

Example 2 with SimpleHistoryConverter01

use of com.mvp4g.rebind.test_tools.annotation.history_converters.SimpleHistoryConverter01 in project mvp4g by mvp4g.

the class Mvp4gConfigurationTest method testInjectedServiceValidationFailsForPresenter.

@Test(expected = UnknownConfigurationElementException.class)
public void testInjectedServiceValidationFailsForPresenter() throws UnknownConfigurationElementException, InvalidTypeException, InvalidClassException, NotFoundClassException {
    events.add(newEvent("badService"));
    views.add(newView(SimpleView02.class, "badService"));
    presenters.add(newPresenter(SimplePresenter01.class, "badService"));
    historyConverters.add(newHistoryConverter(SimpleHistoryConverter01.class, "badService"));
    PresenterElement presenter = newPresenter(SimplePresenter02.class, "testPresenter");
    presenter.getInjectedServices().add(new InjectedElement("badService", "setBadService"));
    presenters.add(presenter);
    configuration.validateServices();
}
Also used : SimpleView02(com.mvp4g.rebind.test_tools.annotation.views.SimpleView02) InjectedElement(com.mvp4g.rebind.config.element.InjectedElement) SimpleHistoryConverter01(com.mvp4g.rebind.test_tools.annotation.history_converters.SimpleHistoryConverter01) PresenterElement(com.mvp4g.rebind.config.element.PresenterElement) SimplePresenter01(com.mvp4g.rebind.test_tools.annotation.presenters.SimplePresenter01) Test(org.junit.Test)

Example 3 with SimpleHistoryConverter01

use of com.mvp4g.rebind.test_tools.annotation.history_converters.SimpleHistoryConverter01 in project mvp4g by mvp4g.

the class Mvp4gConfigurationTest method testEventHandlerValidationFails.

@Test(expected = UnknownConfigurationElementException.class)
public void testEventHandlerValidationFails() throws InvalidMvp4gConfigurationException {
    views.add(newView(SimpleView02.class, "badHandler"));
    services.add(newService("badHandler"));
    events.add(newEvent("badHanlder"));
    historyConverters.add(newHistoryConverter(SimpleHistoryConverter01.class, "badHanlder"));
    EventElement event = newEvent("testEvent");
    event.setHandlers(new String[] { "badHandler" });
    events.add(event);
    setEventBus();
    configuration.validateEventHandlers();
}
Also used : SimpleView02(com.mvp4g.rebind.test_tools.annotation.views.SimpleView02) EventElement(com.mvp4g.rebind.config.element.EventElement) SimpleHistoryConverter01(com.mvp4g.rebind.test_tools.annotation.history_converters.SimpleHistoryConverter01) Test(org.junit.Test)

Example 4 with SimpleHistoryConverter01

use of com.mvp4g.rebind.test_tools.annotation.history_converters.SimpleHistoryConverter01 in project mvp4g by mvp4g.

the class Mvp4gConfigurationTest method testInjectedServiceValidationFailsForHistoryConverter.

@Test(expected = UnknownConfigurationElementException.class)
public void testInjectedServiceValidationFailsForHistoryConverter() throws UnknownConfigurationElementException, InvalidTypeException, InvalidClassException, NotFoundClassException {
    events.add(newEvent("badService"));
    views.add(newView(SimpleView02.class, "badService"));
    presenters.add(newPresenter(SimplePresenter01.class, "badService"));
    historyConverters.add(newHistoryConverter(SimpleHistoryConverter01.class, "badService"));
    HistoryConverterElement historyConverter = newHistoryConverter(SimpleHistoryConverter02.class, "testHistoryConverter");
    historyConverter.getInjectedServices().add(new InjectedElement("badService", "setBadService"));
    historyConverters.add(historyConverter);
    configuration.validateServices();
}
Also used : SimpleView02(com.mvp4g.rebind.test_tools.annotation.views.SimpleView02) HistoryConverterElement(com.mvp4g.rebind.config.element.HistoryConverterElement) InjectedElement(com.mvp4g.rebind.config.element.InjectedElement) SimpleHistoryConverter01(com.mvp4g.rebind.test_tools.annotation.history_converters.SimpleHistoryConverter01) SimplePresenter01(com.mvp4g.rebind.test_tools.annotation.presenters.SimplePresenter01) Test(org.junit.Test)

Example 5 with SimpleHistoryConverter01

use of com.mvp4g.rebind.test_tools.annotation.history_converters.SimpleHistoryConverter01 in project mvp4g by mvp4g.

the class Mvp4gConfigurationTest method testEventHistoryConverterSucceeds.

@Test
public void testEventHistoryConverterSucceeds() throws InvalidMvp4gConfigurationException {
    historyConverters.add(newHistoryConverter(SimpleHistoryConverter01.class, "testHistoryConverter"));
    EventElement event = newEvent("testEvent");
    event.setHistory("testHistoryConverter");
    events.add(event);
    setEventBus();
    configuration.validateHistoryConverters();
}
Also used : EventElement(com.mvp4g.rebind.config.element.EventElement) SimpleHistoryConverter01(com.mvp4g.rebind.test_tools.annotation.history_converters.SimpleHistoryConverter01) Test(org.junit.Test)

Aggregations

SimpleHistoryConverter01 (com.mvp4g.rebind.test_tools.annotation.history_converters.SimpleHistoryConverter01)5 Test (org.junit.Test)5 SimplePresenter01 (com.mvp4g.rebind.test_tools.annotation.presenters.SimplePresenter01)3 SimpleView02 (com.mvp4g.rebind.test_tools.annotation.views.SimpleView02)3 EventElement (com.mvp4g.rebind.config.element.EventElement)2 InjectedElement (com.mvp4g.rebind.config.element.InjectedElement)2 PresenterElement (com.mvp4g.rebind.config.element.PresenterElement)2 HistoryConverterElement (com.mvp4g.rebind.config.element.HistoryConverterElement)1