/** * Register all Blueprint in package. * * @param _package String package to scan * @throws RegisterBlueprintException failed to register blueprint */ public void setRegisterBlueprintsByPackage(String _package) throws RegisterBlueprintException { Set<Class<?>> annotated = null; try { annotated = new ClassesInPackageScanner().findAnnotatedClasses(_package, Blueprint.class); } catch (IOException e) { throw new RegisterBlueprintException(e); } logger.info("Scanned {} and found {}", _package, annotated); this.setRegisterBlueprints(annotated); }
@Test(expected = RegisterBlueprintException.class) public void testSetRegisterBlueprintsWithException() throws RegisterBlueprintException { List blueprints = new ArrayList(); blueprints.add(carBlueprint); blueprints.add(8); modelFactory.setRegisterBlueprints(blueprints); }