use of org.eclipse.osgi.service.resolver.ExportPackageDescription in project rt.equinox.framework by eclipse.
the class TestDynamic_001 method testTest_001.
public void testTest_001() {
State state = buildEmptyState();
StateObjectFactory sof = StateObjectFactory.defaultFactory;
bundle_1 = create_bundle_1(sof);
bundle_2 = create_bundle_2(sof);
// ***************************************************
// stage a
// expect to pass =true
// ***************************************************
addBundlesToState_a(state);
// ***************************************************
try {
state.resolve();
} catch (Throwable t) {
fail("unexpected exception class=" + t.getClass().getName() + " message=" + t.getMessage());
return;
}
checkBundlesResolved_a();
checkWiring_a();
// Dynamics
ExportPackageDescription exp = state.linkDynamicImport(bundle_1, "p");
assertNotNull("Package [p] is not wired when it should be ", exp);
assertEquals("Package [p] is wired incorrectly ", exp.getExporter(), bundle_2);
}
use of org.eclipse.osgi.service.resolver.ExportPackageDescription in project rt.equinox.framework by eclipse.
the class TestDynamic_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);
} else if (exportPackageName.equals("q")) {
assertNotNull("Package [q] is not wired when it should be ", exp.getExporter());
assertEquals("Package [q] 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 TestGenerated_001 method checkWiringState_6.
// end method
public void checkWiringState_6() {
ExportPackageDescription[] exports = null;
exports = null;
exports = bundle_6.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("a2")) {
assertNotNull("Package [a2] is not wired when it should be ", exp.getExporter());
assertEquals("Package [a2] is wired incorrectly ", exp.getExporter(), bundle_8);
} else if (exportPackageName.equals("a1")) {
assertNotNull("Package [a1] is not wired when it should be ", exp.getExporter());
assertEquals("Package [a1] is wired incorrectly ", exp.getExporter(), bundle_3);
} else if (exportPackageName.equals("a3")) {
assertNotNull("Package [a3] is not wired when it should be ", exp.getExporter());
assertEquals("Package [a3] is wired incorrectly ", exp.getExporter(), bundle_6);
}
}
// end for
}
use of org.eclipse.osgi.service.resolver.ExportPackageDescription in project rt.equinox.framework by eclipse.
the class TestOptional_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("q")) {
assertNotNull("Package [q] is not wired when it should be ", exp.getExporter());
assertEquals("Package [q] is wired incorrectly ", exp.getExporter(), bundle_3);
} else if (exportPackageName.equals("r")) {
assertNotNull("Package [r] is not wired when it should be ", exp.getExporter());
assertEquals("Package [r] is wired incorrectly ", exp.getExporter(), bundle_3);
} else if (exportPackageName.equals("p")) {
assertNull("Package [p] is wired when it should not be ", exp);
}
}
// end for
}
use of org.eclipse.osgi.service.resolver.ExportPackageDescription in project rt.equinox.framework by eclipse.
the class TestDynamic_002 method testTest_002.
public void testTest_002() {
State state = buildEmptyState();
StateObjectFactory sof = StateObjectFactory.defaultFactory;
bundle_1 = create_bundle_1(sof);
bundle_2 = create_bundle_2(sof);
bundle_3 = create_bundle_3(sof);
// ***************************************************
// stage a
// expect to pass =true
// ***************************************************
addBundlesToState_a(state);
// ***************************************************
try {
state.resolve();
} catch (Throwable t) {
fail("unexpected exception class=" + t.getClass().getName() + " message=" + t.getMessage());
return;
}
checkBundlesResolved_a();
checkWiring_a();
// Dynamics
ExportPackageDescription exp = state.linkDynamicImport(bundle_1, "r");
assertNull("Package [r] is wired when it should not be ", exp);
}
Aggregations