use of org.eclipse.osgi.service.resolver.ExportPackageDescription in project rt.equinox.framework by eclipse.
the class TestVersion_001 method checkWiringState_1.
// end of method
public void checkWiringState_1() {
ExportPackageDescription[] exports = bundle_1.getResolvedImports();
assertNotNull("export array is unexpectedly null", exports);
assertTrue("export array is unexpectedly empty", exports.length > 0);
for (int i = 0; i < exports.length; i++) {
ExportPackageDescription exp = exports[i];
String exportPackageName = exp.getName();
assertNotNull("package name is null", exportPackageName);
if (exportPackageName.equals("p")) {
assertNotNull("Package [p] is not wired when it should be ", exp.getExporter());
assertEquals("Package [p] is wired incorrectly ", exp.getExporter(), bundle_3);
}
}
// end for
}
use of org.eclipse.osgi.service.resolver.ExportPackageDescription in project rt.equinox.framework by eclipse.
the class TestVersion_001 method checkWiringState_2.
// end method
public void checkWiringState_2() {
ExportPackageDescription[] exports = bundle_2.getResolvedImports();
assertNotNull("export array is unexpectedly null", exports);
assertTrue("export array is unexpectedly empty", exports.length > 0);
for (int i = 0; i < exports.length; i++) {
ExportPackageDescription exp = exports[i];
String exportPackageName = exp.getName();
assertNotNull("package name is null", exportPackageName);
if (exportPackageName.equals("p")) {
assertNotNull("Package [p] is not wired when it should be ", exp.getExporter());
assertEquals("Package [p] is wired incorrectly ", exp.getExporter(), bundle_3);
}
}
// end for
}
use of org.eclipse.osgi.service.resolver.ExportPackageDescription in project rt.equinox.framework by eclipse.
the class TestVersion_001 method checkWiringState_3.
// end method
public void checkWiringState_3() {
ExportPackageDescription[] exports = bundle_3.getResolvedImports();
assertNotNull("export array is unexpectedly null", exports);
assertTrue("export array is unexpectedly empty", exports.length > 0);
for (int i = 0; i < exports.length; i++) {
ExportPackageDescription exp = exports[i];
String exportPackageName = exp.getName();
assertNotNull("package name is null", exportPackageName);
if (exportPackageName.equals("p")) {
assertNotNull("Package [p] is not wired when it should be ", exp.getExporter());
assertEquals("Package [p] is wired incorrectly ", exp.getExporter(), bundle_3);
}
}
// end for
}
use of org.eclipse.osgi.service.resolver.ExportPackageDescription in project rt.equinox.framework by eclipse.
the class TestVersion_003 method checkWiringState_1.
// end of method
public void checkWiringState_1() {
ExportPackageDescription[] exports = bundle_1.getResolvedImports();
assertNotNull("export array is unexpectedly null", exports);
assertTrue("export array is unexpectedly empty", exports.length > 0);
for (int i = 0; i < exports.length; i++) {
ExportPackageDescription exp = exports[i];
String exportPackageName = exp.getName();
assertNotNull("package name is null", exportPackageName);
if (exportPackageName.equals("p")) {
assertNotNull("Package [p] is not wired when it should be ", exp.getExporter());
assertEquals("Package [p] is wired incorrectly ", exp.getExporter(), bundle_3);
}
}
// end for
}
use of org.eclipse.osgi.service.resolver.ExportPackageDescription in project rt.equinox.framework by eclipse.
the class DevModeTest method testDevModeFragment01.
public void testDevModeFragment01() throws BundleException {
State state = buildDevModeState();
int bundleID = 0;
Hashtable manifest = new Hashtable();
manifest.clear();
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A");
manifest.put(Constants.BUNDLE_VERSION, "1.0");
manifest.put(Constants.EXPORT_PACKAGE, "a");
manifest.put(Constants.IMPORT_PACKAGE, "c");
BundleDescription a = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + (String) manifest.get(Constants.BUNDLE_VERSION), bundleID++);
manifest.clear();
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "AFrag");
manifest.put(Constants.BUNDLE_VERSION, "1.0");
manifest.put(Constants.FRAGMENT_HOST, "A");
manifest.put(Constants.EXPORT_PACKAGE, "a.frag");
BundleDescription aFrag = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + (String) manifest.get(Constants.BUNDLE_VERSION), bundleID++);
manifest.clear();
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B");
manifest.put(Constants.BUNDLE_VERSION, "1.0");
manifest.put(Constants.IMPORT_PACKAGE, "a, a.frag");
BundleDescription b = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + (String) manifest.get(Constants.BUNDLE_VERSION), bundleID++);
manifest.clear();
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C");
manifest.put(Constants.BUNDLE_VERSION, "1.0");
manifest.put(Constants.EXPORT_PACKAGE, "c");
BundleDescription c = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME) + "_" + (String) manifest.get(Constants.BUNDLE_VERSION), bundleID++);
state.addBundle(a);
state.addBundle(aFrag);
state.addBundle(b);
state.resolve();
// only A should not be resolved, do not want the domino effect.
assertFalse("0.1", a.isResolved());
assertTrue("0.2", aFrag.isResolved());
assertTrue("0.3", b.isResolved());
ExportPackageDescription[] aExports = a.getSelectedExports();
ExportPackageDescription[] bImports = b.getResolvedImports();
assertTrue("1.1", aExports.length == 2);
assertTrue("1.2", bImports.length == 2);
assertTrue("1.3", aExports[0] == bImports[0]);
assertTrue("1.4", aExports[1] == bImports[1]);
assertTrue("1.5", aFrag.getHost().getSupplier() == a);
state.addBundle(c);
state.resolve();
assertTrue("2.1", a.isResolved());
assertTrue("2.2", aFrag.isResolved());
assertTrue("2.3", b.isResolved());
assertTrue("2.4", c.isResolved());
aExports = a.getSelectedExports();
bImports = b.getResolvedImports();
assertTrue("3.1", aExports.length == 2);
assertTrue("3.2", bImports.length == 2);
assertTrue("3.3", aExports[0] == bImports[0]);
assertTrue("3.4", aExports[1] == bImports[1]);
assertTrue("3.5", aFrag.getHost().getSupplier() == a);
}
Aggregations