Source:
protected void deploy(FeaturesRunner runner, RuntimeHarness harness) { AssertionError errors = new AssertionError("deployment errors"); OSGiRuntimeService runtime = (OSGiRuntimeService) harness.getContext().getRuntime(); for (String name : bundles) { Bundle bundle = harness.getOSGiAdapter().getBundle(name); if (bundle == null) { try { harness.deployBundle(name); bundle = harness.getOSGiAdapter().getBundle(name); if (bundle == null) { throw new UnsupportedOperationException("Should not occur"); } } catch (Exception error) { errors.addSuppressed(error); continue; } contexts.add(runtime.getContext(bundle)); } try { for (String resource : mainIndex.removeAll(name)) { try { harness.deployContrib(name, resource); } catch (Exception error) { errors.addSuppressed(error); } } for (String resource : localIndex.removeAll(name)) { URL url = runner.getTargetTestResource(resource); if (url == null) { url = bundle.getEntry(resource); } if (url == null) { url = runner.getTargetTestClass().getClassLoader().getResource(resource); } if (url == null) { throw new AssertionError("Cannot find " + resource + " in " + name); } contexts.add(harness.deployTestContrib(name, url)); } } catch (Exception error) { errors.addSuppressed(error); } } for (Map.Entry<String, String> resource : mainIndex.entries()) { try { harness.deployContrib(resource.getKey(), resource.getValue()); } catch (Exception error) { errors.addSuppressed(error); } } for (Map.Entry<String, String> resource : localIndex.entries()) { try { contexts.add(harness.deployTestContrib(resource.getKey(), resource.getValue())); } catch (Exception error) { errors.addSuppressed(error); } } for (String name : partialBundles.keySet()) { try { harness.deployPartial(name, partialBundles.get(name)); } catch (Exception e) { errors.addSuppressed(e); } } if (errors.getSuppressed().length > 0) { throw errors; } }

Target:
protected void deploy(FeaturesRunner runner, RuntimeHarness harness) { AssertionError errors = new AssertionError("deployment errors"); OSGiRuntimeService runtime = (OSGiRuntimeService) harness.getContext().getRuntime(); for (String name : bundles) { Bundle bundle = harness.getOSGiAdapter().getBundle(name); if (bundle == null) { try { harness.deployBundle(name); bundle = harness.getOSGiAdapter().getBundle(name); if (bundle == null) { throw new UnsupportedOperationException("Should not occur"); } } catch (Exception error) { errors.addSuppressed(error); continue; } contexts.add(runtime.getContext(bundle)); } try { for (String resource : mainIndex.removeAll(name)) { try { harness.deployContrib(name, resource); } catch (Exception error) { errors.addSuppressed(error); } } for (String resource : localIndex.removeAll(name)) { URL url = runner.getTargetTestResource(resource); if (url == null) { url = bundle.getEntry(resource); } if (url == null) { url = runner.getTargetTestClass().getClassLoader().getResource(resource); } if (url == null) { throw new AssertionError("Cannot find " + resource + " in " + name); } contexts.add(harness.deployTestContrib(name, url)); } } catch (Exception error) { errors.addSuppressed(error); } } for (Map.Entry<String, String> resource : mainIndex.entries()) { try { harness.deployContrib(resource.getKey(), resource.getValue()); } catch (Exception error) { errors.addSuppressed(error); } } for (Map.Entry<String, String> resource : localIndex.entries()) { try { contexts.add(harness.deployTestContrib(resource.getKey(), resource.getValue())); } catch (Exception error) { errors.addSuppressed(error); } } for (Map.Entry<String, Set<TargetExtensions>> resource : partialBundles.entrySet()) { try { harness.deployPartial(resource.getKey(), resource.getValue()); } catch (Exception e) { errors.addSuppressed(e); } } if (errors.getSuppressed().length > 0) { throw errors; } }