use of com.github.mvp4g.mvp4g2.core.ui.annotation.Presenter in project mvp4g2 by mvp4g.
the class ShellTest method eventBusWithTwoShells.
@Test
public void eventBusWithTwoShells() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/shell/eventBusWithTwoShells/EventBusWithTwoShells.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/shell/eventBusWithTwoShells/IMockShellView01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/shell/eventBusWithTwoShells/MockShellView01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/shell/eventBusWithTwoShells/MockShellPresenter01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/shell/eventBusWithTwoShells/IMockShellView02.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/shell/eventBusWithTwoShells/MockShellView02.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/shell/eventBusWithTwoShells/MockShellPresenter02.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("Mvp4g2Processor: there can be only one presenter implementing IsShell");
}
use of com.github.mvp4g.mvp4g2.core.ui.annotation.Presenter in project mvp4g2 by mvp4g.
the class EventbusTest method testEventWithHandlerAttributeNotImplemented02.
@Test
public void testEventWithHandlerAttributeNotImplemented02() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventbus/eventWithHandlerAttributeNotImplemented02/EventBusEventWithHandlerAttributeNotImplemented.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventbus/eventWithHandlerAttributeNotImplemented02/MockShellPresenter01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventbus/eventWithHandlerAttributeNotImplemented02/IMockShellView01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventbus/eventWithHandlerAttributeNotImplemented02/MockShellView01.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("com.github.mvp4g.mvp4g2.processor.eventbus.eventWithHandlerAttributeNotImplemented02.MockShellPresenter01<< -> event >>onDoSomething(java.lang.String)<< is not handled by presenter/handler");
}
use of com.github.mvp4g.mvp4g2.core.ui.annotation.Presenter in project mvp4g2 by mvp4g.
the class EventbusTest method testEventWithHandlerAttributeNotImplemented01.
@Test
public void testEventWithHandlerAttributeNotImplemented01() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventbus/eventWithHandlerAttributeNotImplemented01/EventBusEventWithHandlerAttributeNotImplemented.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventbus/eventWithHandlerAttributeNotImplemented01/MockShellPresenter01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventbus/eventWithHandlerAttributeNotImplemented01/IMockShellView01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventbus/eventWithHandlerAttributeNotImplemented01/MockShellView01.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("Mvp4g2Processor: presenter >>com.github.mvp4g.mvp4g2.processor.eventbus.eventWithHandlerAttributeNotImplemented01.MockShellPresenter01<< -> event >>onDoSomething()<< is not handled by presenter/handler");
}
use of com.github.mvp4g.mvp4g2.core.ui.annotation.Presenter in project mvp4g2 by mvp4g.
the class HandlerTest method testEventHandlerWithNotImplementedEvent.
@Test
public void testEventHandlerWithNotImplementedEvent() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/handlerWithNotImplementedEvent/EventBusHandlerWithNotImplementedEvent.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/handlerWithNotImplementedEvent/MockOneEventHandler.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/handlerWithNotImplementedEvent/MockShellPresenter01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/handlerWithNotImplementedEvent/IMockShellView01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/handlerWithNotImplementedEvent/MockShellView01.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("event >>doSomethingInHandler()<< is never handled by a presenter or handler");
}
use of com.github.mvp4g.mvp4g2.core.ui.annotation.Presenter in project mvp4g2 by mvp4g.
the class HandlerTest method testHandlerWithWrongImplementation01.
@Test
public void testHandlerWithWrongImplementation01() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/handlerWithWrongImplementation01/EventBusHandlerWithNotImplementedEvent.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/handlerWithWrongImplementation01/MockOneEventHandler.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/handlerWithWrongImplementation01/MockShellPresenter01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/handlerWithWrongImplementation01/IMockShellView01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/handlerWithWrongImplementation01/MockShellView01.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("event >>doSomethingInHandler(java.lang.String)<< is never handled by a presenter or handler");
}
Aggregations