use of com.github.mvp4g.mvp4g2.processor.Mvp4g2Processor in project mvp4g2 by mvp4g.
the class ApplicationTest method testApplicationAnnotationOnAClass.
@Test
public void testApplicationAnnotationOnAClass() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOnClass/ApplicationAnnotationInterfaceOnAClass.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("@Application annotated must be used with an interface");
}
use of com.github.mvp4g.mvp4g2.processor.Mvp4g2Processor in project mvp4g2 by mvp4g.
the class ApplicationTest method testApplicationAnnotationOkWithoutLoader.
@Test
public void testApplicationAnnotationOkWithoutLoader() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithoutLoader/ApplicationAnnotationOkWithoutLoader.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithoutLoader/MockEventBus.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithoutLoader/MockOneEventHandler.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithoutLoader/MockShellPresenter.java"));
}
});
CompilationSubject.assertThat(compilation).succeeded();
JavaFileObjectSubject.assertThat(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithoutLoader/ApplicationAnnotationOkWithoutLoaderImpl.java")).hasSourceEquivalentTo(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithoutLoader/ApplicationAnnotationOkWithoutLoaderImpl.java"));
}
use of com.github.mvp4g.mvp4g2.processor.Mvp4g2Processor in project mvp4g2 by mvp4g.
the class ApplicationTest method testApplicationInterfaceWithoutExtendsIsApplication.
@Test
public void testApplicationInterfaceWithoutExtendsIsApplication() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationInterfaceWithoutExtendsIsApplication/ApplicationInterfaceWithoutExtendsIsApplication.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("@Application must implement IsApplication interface");
}
use of com.github.mvp4g.mvp4g2.processor.Mvp4g2Processor in project mvp4g2 by mvp4g.
the class ApplicationTest method testApplicationAnnotationOkWithLoader.
@Test
public void testApplicationAnnotationOkWithLoader() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithLoader/ApplicationAnnotationOkWithLoader.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithLoader/MockApplicationLoader.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithLoader/MockEventBus.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithLoader/MockOneEventHandler.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithLoader/MockShellPresenter.java"));
}
});
CompilationSubject.assertThat(compilation).succeeded();
JavaFileObjectSubject.assertThat(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithLoader/ApplicationAnnotationOkWithLoaderImpl.java")).hasSourceEquivalentTo(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/application/applicationAnnotationOkWithLoader/ApplicationAnnotationOkWithLoaderImpl.java"));
}
use of com.github.mvp4g.mvp4g2.processor.Mvp4g2Processor in project mvp4g2 by mvp4g.
the class EventTest method testEventDoesNotReturnVoid.
@Test
public void testEventDoesNotReturnVoid() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventDoesNotReturnVoid/EventBusEventDoesNotReturnVoid.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventDoesNotReturnVoid/MockShellPresenter01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventDoesNotReturnVoid/IMockShellView01.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventDoesNotReturnVoid/MockShellView01.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("Mvp4g2Processor: EventElement: >>doSomething<< must return 'void'");
}
Aggregations