use of com.github.mvp4g.mvp4g2.core.ui.annotation.EventHandler in project mvp4g2 by mvp4g.
the class PresenterTest method testPresenterAnnotationAnnotatedOnAInterface.
@Test
public void testPresenterAnnotationAnnotatedOnAInterface() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/presenterAnnotationAnnotatedOnAInterface/PresenterAnnotationAnnotatedOnAInterface.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("@Presenter can only be used with a class");
}
use of com.github.mvp4g.mvp4g2.core.ui.annotation.EventHandler in project mvp4g2 by mvp4g.
the class PresenterTest method testPresenterAnnotationUsingViewClassAsInterface.
@Test
public void testPresenterAnnotationUsingViewClassAsInterface() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/presenterAnnotationUsingViewClassAsInterface/PresenterAnnotationUsingViewClassAsInterface.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("the viewInterface-attribute of a @Presenter must be a interface!");
}
use of com.github.mvp4g.mvp4g2.core.ui.annotation.EventHandler in project mvp4g2 by mvp4g.
the class PresenterTest 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/presenterWithNotImplementedEvent/EventBusEventHandlerWithNotImplementedEvent.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/presenterWithNotImplementedEvent/MockShellPresenter01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/presenterWithNotImplementedEvent/IMockShellView01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/presenterWithNotImplementedEvent/MockShellView01.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("event >>doSomething()<< is never handled by a presenter or handler");
}
use of com.github.mvp4g.mvp4g2.core.ui.annotation.EventHandler in project mvp4g2 by mvp4g.
the class PresenterTest method testHandlerWithWrongImplementation04.
@Test
public void testHandlerWithWrongImplementation04() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/presenterWithWrongImplementation04/EventBusHandlerWithNotImplementedEvent.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/presenterWithWrongImplementation04/MockShellPresenter01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/presenterWithWrongImplementation04/IMockShellView01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/presenterWithWrongImplementation04/MockShellView01.java"));
}
});
CompilationSubject.assertThat(compilation).succeeded();
}
use of com.github.mvp4g.mvp4g2.core.ui.annotation.EventHandler in project mvp4g2 by mvp4g.
the class PresenterTest method testHandlerWithWrongImplementation03.
@Test
public void testHandlerWithWrongImplementation03() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/presenterWithWrongImplementation03/EventBusHandlerWithNotImplementedEvent.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/presenterWithWrongImplementation03/MockShellPresenter01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/presenterWithWrongImplementation03/IMockShellView01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventhandler/presenterWithWrongImplementation03/MockShellView01.java"));
}
});
CompilationSubject.assertThat(compilation).succeeded();
}
Aggregations