use of com.github.mvp4g.mvp4g2.core.eventbus.annotation.EventBus in project mvp4g2 by mvp4g.
the class EventbusTest method testEventBusNotExtendingAbstractEventHandlerd.
@Test
public void testEventBusNotExtendingAbstractEventHandlerd() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventbus/eventBusNotExtendingIsEventBus/EventBusNotExtendingIsEventBus.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("@Eventbus must extend IsEventBus.class!");
}
use of com.github.mvp4g.mvp4g2.core.eventbus.annotation.EventBus 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.eventbus.annotation.EventBus 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.eventbus.annotation.EventBus in project mvp4g2 by mvp4g.
the class FilterTest method testFiltersAnnotationOnAMethod.
@Test
public void testFiltersAnnotationOnAMethod() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventbus/filterAnnotationOnAMethod/FilterAnnotationOnAMethod.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("@Filter can only be used on a type (interface)");
}
use of com.github.mvp4g.mvp4g2.core.eventbus.annotation.EventBus in project mvp4g2 by mvp4g.
the class FilterTest method testFiltersAnnotationWithoutExtendsIsEventBus.
@Test
public void testFiltersAnnotationWithoutExtendsIsEventBus() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/eventbus/filterAnnotationWithoutExtendsIsEventBus/FilterAnnotationWithoutExtendsIsEventBus.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("@Filters can only be used with an interfaces annotated with @EventBus");
}
Aggregations