### Question:
OsgiConfigurationUtil { public static void createBundle(IndexingConfig config){ Builder builder = new Builder(); builder.setProperty("Install-Path", FilenameUtils.separatorsToUnix(CONFIG_PATH) + config.getName().toLowerCase()); builder.setProperty(Builder.EXPORT_PACKAGE,CONFIG_PACKAGE+config.getName().toLowerCase()); builder.setProperty(Builder.BUNDLE_CATEGORY, "Stanbol Data"); builder.setProperty(Builder.BUNDLE_NAME, "Apache Stanbol Data: "+config.getName()); builder.setProperty(Builder.CREATED_BY, "Apache Stanbol Entityhub Indexing Utils"); builder.setProperty(Builder.BUNDLE_VENDOR, "Apache Stanbol (Incubating)"); builder.setProperty(Builder.BUNDLE_VERSION, "1.0.0"); builder.setProperty(Builder.BUNDLE_DESCRIPTION, "Bundle created for import of the referenced site " + config.getName() +" into the Apache Stanbol Entityhub"); builder.setProperty(Builder.BUNDLE_SYMBOLICNAME, CONFIG_PACKAGE+config.getName().toLowerCase()); try { builder.addClasspath(new File(config.getDestinationFolder(),CONFIG_ROOT)); } catch (IOException e) { log.warn("(builder.addClasspath) Unable to build OSGI Bundle for Indexed Referenced Site "+config.getName(),e); builder.close(); return; } try { Jar jar = builder.build(); jar.write(new File(config.getDistributionFolder(), CONFIG_PACKAGE+config.getName()+"-1.0.0.jar")); } catch (Exception e) { log.warn("(builder.build) Unable to build OSGI Bundle for Indexed Referenced Site "+config.getName(),e); return; } finally { builder.close(); } } private  OsgiConfigurationUtil(); static void writeOsgiConfig(IndexingConfig indexingConfig,String name, Dictionary<String,Object> config); static Dictionary<String,Object> createYardConfig(IndexingConfig indexingConfig); static void writeSiteConfiguration(IndexingConfig indexingConfig); static void writeCacheConfiguration(IndexingConfig indexingConfig); static String getYardID(IndexingConfig config); static File getConfigDirectory(IndexingConfig config); static void createBundle(IndexingConfig config); static final String DEFAULT_MAPPING_STATE; static final String DEFAULT_IMPORTED_ENTTIY_STATE; static final Object DEFAULT_EXPIRE_DURATION; static final String REFERENCED_SITE_COMPONENT_ID; static final String CACHE_COMPONENT_ID; }### Answer:
@Test public void testOsgiConfigurationGeneration() throws URISyntaxException, IOException{ String name = CONFIG_ROOT+"bundlebuild"; String destConfFolder = name + "/indexing/destination/" + "config"; File destConfSource = new File( this.getClass().getResource("/" + destConfFolder).toURI()); File destConfTarget = new File(testRoot + "/" + destConfFolder); FileUtils.copyDirectory( destConfSource, destConfTarget); File distFolder = new File(testRoot+'/'+name+"/indexing/dist"); File bundle = new File(distFolder,"org.apache.stanbol.data.site.simple-1.0.0.jar"); IndexingConfig config = new IndexingConfig(name,name){}; OsgiConfigurationUtil.createBundle(config); assertTrue("Configuration bundle '"+bundle+"' was not created!", bundle.isFile()); }