use of com.github.mvp4g.mvp4g2.processor.Mvp4g2Processor in project mvp4g2 by mvp4g.
the class ApplicationTest method testApplictionAnnotationOnAMethod.
@Test
public void testApplictionAnnotationOnAMethod() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOnAMethod/ApplicationAnnotationOnAMethod.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("@Application can only be used on a type (interface)");
}
use of com.github.mvp4g.mvp4g2.processor.Mvp4g2Processor in project mvp4g2 by mvp4g.
the class ApplicationTest method testApplicationAnnotationOkWithLoaderAsInnerInterface.
@Test
public void testApplicationAnnotationOkWithLoaderAsInnerInterface() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithLoaderAsInnerInterface/ApplicationAnnotationOkWithLoaderAsInnerInterface.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithLoaderAsInnerInterface/MockEventBus.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithLoaderAsInnerInterface/MockOneEventHandler.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithLoaderAsInnerInterface/MockShellPresenter.java"));
}
});
CompilationSubject.assertThat(compilation).succeeded();
JavaFileObjectSubject.assertThat(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithLoaderAsInnerInterface/ApplicationAnnotationOkWithLoaderAsInnerInterfaceImpl.java")).hasSourceEquivalentTo(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithLoaderAsInnerInterface/ApplicationAnnotationOkWithLoaderAsInnerInterfaceImpl.java"));
}
use of com.github.mvp4g.mvp4g2.processor.Mvp4g2Processor in project mvp4g2 by mvp4g.
the class EventTest method testEventTestHistoryNamesNotUnique.
@Test
public void testEventTestHistoryNamesNotUnique() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventTestHistoryNamesNotUnique/EventTestHistoryNamesNotUnique.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("using a already used historyName");
}
use of com.github.mvp4g.mvp4g2.processor.Mvp4g2Processor in project mvp4g2 by mvp4g.
the class EventTest method testEventAnnotationInsideAOtherClassThenEventBus.
@Test
public void testEventAnnotationInsideAOtherClassThenEventBus() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventAnnotationInsideAOtherClassThenEventBus/EventAnnotationInsideAOtherClassThenEventBus.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventAnnotationInsideAOtherClassThenEventBus/MockShellPresenter.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventAnnotationInsideAOtherClassThenEventBus/IMockShellView.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventAnnotationInsideAOtherClassThenEventBus/MockShellView.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("Mvp4g2Processor: @Event can only be used inside a event bus! >>com.github.mvp4g.mvp4g2.processor.event.eventAnnotationInsideAOtherClassThenEventBus.MockShellPresenter<< does no implement IsEventBus");
}
use of com.github.mvp4g.mvp4g2.processor.Mvp4g2Processor in project mvp4g2 by mvp4g.
the class EventTest method testEventTestHandlerInBindAndHandlersAttribute01.
@Test
public void testEventTestHandlerInBindAndHandlersAttribute01() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventTestHandlerInBindAndHandlersAttribute01/EventTestHandlerInBindAndHandlersAttribute.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("can not be set in bind- and handlers-attribute");
}
Aggregations