use of com.mvp4g.rebind.exception.loader.Mvp4gAnnotationException in project mvp4g by mvp4g.
the class AbstractMvp4gAnnotationsWithServiceLoaderTest method testNotPublicMethod.
@Test(expected = Mvp4gAnnotationException.class)
public void testNotPublicMethod() throws Mvp4gAnnotationException {
try {
List<JClassType> annotedClasses = new ArrayList<JClassType>();
JClassType type = oracle.addClass(getClassNotPublic());
annotedClasses.add(type);
loader.load(annotedClasses, configuration);
} catch (Mvp4gAnnotationException e) {
assertTrue(e.getMessage().contains("Only public setter method can be used to inject a service."));
throw e;
}
}
use of com.mvp4g.rebind.exception.loader.Mvp4gAnnotationException in project mvp4g by mvp4g.
the class EventHandlerAnnotationsLoaderTest method testPresenterAndEventHandler.
@Test
public void testPresenterAndEventHandler() {
List<JClassType> annotedClasses = new ArrayList<JClassType>();
JClassType type = oracle.addClass(EventHandlers.PresenterAndEventHandler.class);
annotedClasses.add(type);
try {
loader.load(annotedClasses, configuration);
fail();
} catch (Mvp4gAnnotationException e) {
assertEquals(EventHandlers.PresenterAndEventHandler.class.getCanonicalName() + ": You can't annotate a class with @Presenter and @EventHandler.", e.getMessage());
}
}
use of com.mvp4g.rebind.exception.loader.Mvp4gAnnotationException in project mvp4g by mvp4g.
the class EventsAnnotationsLoaderTest method testNoInstanceOfHistory.
@Test(expected = Mvp4gAnnotationException.class)
public void testNoInstanceOfHistory() throws Mvp4gAnnotationException {
try {
List<JClassType> annotedClasses = new ArrayList<JClassType>();
annotedClasses.add(oracle.addClass(PresenterWithName.class));
new PresenterAnnotationsLoader().load(annotedClasses, configuration);
annotedClasses.clear();
annotedClasses = new ArrayList<JClassType>();
JClassType type = oracle.addClass(EventBusOk.class);
annotedClasses.add(type);
loader.load(annotedClasses, configuration);
} catch (Mvp4gAnnotationException e) {
assertTrue(e.getMessage().contains("No instance of"));
throw e;
}
}
use of com.mvp4g.rebind.exception.loader.Mvp4gAnnotationException in project mvp4g by mvp4g.
the class EventsAnnotationsLoaderTest method testDoubleInitHistory.
@Test(expected = Mvp4gAnnotationException.class)
public void testDoubleInitHistory() throws Mvp4gAnnotationException {
try {
List<JClassType> annotedClasses = new ArrayList<JClassType>();
annotedClasses.add(oracle.addClass(PresenterWithName.class));
new PresenterAnnotationsLoader().load(annotedClasses, configuration);
annotedClasses.clear();
JClassType type = oracle.addClass(Events.EventBusDoubleInitHistory.class);
annotedClasses.add(type);
loader.load(annotedClasses, configuration);
} catch (Mvp4gAnnotationException e) {
assertTrue(e.getMessage().contains("Duplicate value for Init History event. It is already defined by another method or in your configuration file."));
throw e;
}
}
use of com.mvp4g.rebind.exception.loader.Mvp4gAnnotationException in project mvp4g by mvp4g.
the class EventsAnnotationsLoaderTest method testStartNoViewName.
@Test(expected = Mvp4gAnnotationException.class)
public void testStartNoViewName() throws Mvp4gAnnotationException {
try {
List<JClassType> annotedClasses = new ArrayList<JClassType>();
JClassType type = oracle.addClass(Events.EventBusWithStartName.class);
annotedClasses.add(type);
loader.load(annotedClasses, configuration);
} catch (Mvp4gAnnotationException e) {
assertTrue(e.getMessage().contains("There is no presenter named"));
throw e;
}
}
Aggregations