Exemple #1
0
 private static ModuleImpl newModuleImpl(String name, String version, ModuleState state)
     throws CoreException {
   ModuleImpl module = null;
   String resource = "xml/" + name + ".xml";
   try {
     module = loadModule(resource);
   } catch (IOException e) {
     e.printStackTrace();
     Assert.fail(resource + ": " + e.getMessage());
   }
   module.setVersion(Version.parseVersion(version));
   module.setState(state);
   return module;
 }
 private RegionFilter createBundleFilter(String bundleSymbolicName, Version bundleVersion)
     throws InvalidSyntaxException {
   String bundleFilter =
       "(&("
           + RegionFilter.VISIBLE_BUNDLE_NAMESPACE
           + '='
           + bundleSymbolicName
           + ')'
           + '('
           + Constants.BUNDLE_VERSION_ATTRIBUTE
           + ">="
           + (bundleVersion == null ? "0" : bundleVersion.toString())
           + "))";
   RegionFilterBuilder builder = digraph.createRegionFilterBuilder();
   return builder.allow(RegionFilter.VISIBLE_BUNDLE_NAMESPACE, bundleFilter).build();
 }