/** * Check whether the container should delete the test directories or not. * * @return boolean */ private boolean shouldDeleteRuntime() { boolean deleteRuntime = true; KeepDirectoryOption keepDirectoryOption = system.getSingleOption(KeepDirectoryOption.class); if (keepDirectoryOption != null) { deleteRuntime = false; } return deleteRuntime; }
@Override public <T extends Option> T getSingleOption(final Class<T> optionType) { return delegate.getSingleOption(optionType); }
/** * Check whether the container should delete the test directories or not. * * @return boolean */ private boolean shouldDeleteRuntime() { boolean deleteRuntime = true; KeepDirectoryOption keepDirectoryOption = system.getSingleOption(KeepDirectoryOption.class); if (keepDirectoryOption != null) { deleteRuntime = false; } return deleteRuntime; }
private void setProbeClassLoader() { JarProbeOption probeOption = system.getSingleOption(JarProbeOption.class); if (probeOption == null) { return; } probeDir = new File(system.getTempFolder(), UUID.randomUUID().toString()); probeDir.mkdir(); JarBuilder builder = new JarBuilder(probeDir, probeOption); URI jar = builder.buildJar(); try { URLClassLoader classLoader = new URLClassLoader(new URL[]{jar.toURL()}); contextClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(classLoader); } catch (MalformedURLException exc) { throw new TestContainerException(exc); } }
private void setProbeClassLoader() { JarProbeOption probeOption = system.getSingleOption(JarProbeOption.class); if (probeOption == null) { return; } probeDir = new File(system.getTempFolder(), UUID.randomUUID().toString()); probeDir.mkdir(); JarBuilder builder = new JarBuilder(probeDir, probeOption); URI jar = builder.buildJar(); try { URLClassLoader classLoader = new URLClassLoader(new URL[] { jar.toURL() }); contextClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(classLoader); } catch (MalformedURLException exc) { throw new TestContainerException(exc); } }
private Map<String, String> createFrameworkProperties() throws IOException { final Map<String, String> p = new HashMap<String, String>(); CleanCachesOption cleanCaches = system.getSingleOption(CleanCachesOption.class); if (cleanCaches != null && cleanCaches.getValue() != null && cleanCaches.getValue()) { p.put(FRAMEWORK_STORAGE_CLEAN, FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT); } p.put(FRAMEWORK_STORAGE, system.getTempFolder().getAbsolutePath()); p.put(FRAMEWORK_SYSTEMPACKAGES_EXTRA, buildString(system.getOptions(SystemPackageOption.class))); p.put(FRAMEWORK_BOOTDELEGATION, buildString(system.getOptions(BootDelegationOption.class))); for (FrameworkPropertyOption option : system.getOptions(FrameworkPropertyOption.class)) { p.put(option.getKey(), (String) option.getValue()); } for (SystemPropertyOption option : system.getOptions(SystemPropertyOption.class)) { System.setProperty(option.getKey(), option.getValue()); } String repositories = buildString(system.getOptions(RepositoryOption.class)); if (!repositories.isEmpty()) { System.setProperty("org.ops4j.pax.url.mvn.repositories", repositories); } return p; }
private void setFrameworkStartLevel(BundleContext context, final FrameworkStartLevel sl) { FrameworkStartLevelOption startLevelOption = system .getSingleOption(FrameworkStartLevelOption.class); final int startLevel = startLevelOption == null ? START_LEVEL_TEST_BUNDLE : startLevelOption.getStartLevel();
DebugOption debugOption = system.getSingleOption(DebugOption.class); if (debugOption != null) { options.add(debugOption.getDebugConfiguration());
DebugOption debugOption = system.getSingleOption(DebugOption.class); if (debugOption != null) { options.add(debugOption.getDebugConfiguration());
ExamBundlesStartLevel examBundlesStartLevel = system.getSingleOption(ExamBundlesStartLevel.class); if (examBundlesStartLevel != null) { startLevel = examBundlesStartLevel.getStartLevel();