Search in sources :

Example 1 with ControllerRepository

use of com.canoo.dp.impl.server.controller.ControllerRepository in project dolphin-platform by canoo.

the class ControllerRepositoryTest method testWrongControllersName.

@Test(expectedExceptions = IllegalArgumentException.class)
public void testWrongControllersName() throws Exception {
    ControllerRepository controllerRepository = new ControllerRepository(new DefaultClasspathScanner(ControllerRepositoryTest.class.getPackage().getName()));
    controllerRepository.getControllerClassForName("WrongControllerName");
}
Also used : DefaultClasspathScanner(com.canoo.dp.impl.server.scanner.DefaultClasspathScanner) ControllerRepository(com.canoo.dp.impl.server.controller.ControllerRepository) Test(org.testng.annotations.Test)

Example 2 with ControllerRepository

use of com.canoo.dp.impl.server.controller.ControllerRepository 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);
}
Also used : DefaultClasspathScanner(com.canoo.dp.impl.server.scanner.DefaultClasspathScanner) ControllerRepository(com.canoo.dp.impl.server.controller.ControllerRepository) Test(org.testng.annotations.Test)

Aggregations

ControllerRepository (com.canoo.dp.impl.server.controller.ControllerRepository)2 DefaultClasspathScanner (com.canoo.dp.impl.server.scanner.DefaultClasspathScanner)2 Test (org.testng.annotations.Test)2