use of com.canoo.dp.impl.server.scanner.DefaultClasspathScanner in project dolphin-platform by canoo.
the class ControllerRepositoryTest method testExistingControllers.
@Test
public void testExistingControllers() throws Exception {
ControllerRepository controllerRepository = new ControllerRepository(new DefaultClasspathScanner(ControllerRepositoryTest.class.getPackage().getName()));
Class<?> controllerClass = controllerRepository.getControllerClassForName(TestController.class.getName());
assertNotNull(controllerClass);
assertEquals(controllerClass, TestController.class);
}
use of com.canoo.dp.impl.server.scanner.DefaultClasspathScanner in project dolphin-platform by canoo.
the class ClasspathScannerTest method testInMultiplePackages.
@Test
public void testInMultiplePackages() {
// There can't be a class that is annotated with Inject
final DefaultClasspathScanner scanner = new DefaultClasspathScanner("com.canoo.impl.server.classpathscan.documented", "com.canoo.impl.server.classpathscan.resource");
assertForAnnotation(scanner);
}
use of com.canoo.dp.impl.server.scanner.DefaultClasspathScanner in project dolphin-platform by canoo.
the class ClasspathScannerTest method testScanOtherPackage.
@Test
public void testScanOtherPackage() {
// There can't be a class that is annotated with Inject
final DefaultClasspathScanner scanner = new DefaultClasspathScanner(CLASSPATH_SCAN);
Set<Class<?>> classes = scanner.getTypesAnnotatedWith(Resources.class);
assertNotNull(classes);
assertEquals(classes.size(), 0);
classes = scanner.getTypesAnnotatedWith(AnnotationForClasspathScanTest.class);
assertNotNull(classes);
assertEquals(classes.size(), 0);
classes = scanner.getTypesAnnotatedWith(Documented.class);
assertNotNull(classes);
assertEquals(classes.size(), 1);
assertTrue(classes.contains(DocumentAnnotatedClass.class));
}
use of com.canoo.dp.impl.server.scanner.DefaultClasspathScanner in project dolphin-platform by canoo.
the class ClasspathScannerTest method testNullArgument.
@Test(expectedExceptions = NullPointerException.class)
public void testNullArgument() {
final DefaultClasspathScanner scanner = new DefaultClasspathScanner(CLASSPATH_SCAN);
Set<Class<?>> classes = scanner.getTypesAnnotatedWith(null);
}
Aggregations