Search in sources :

Example 41 with ExportPackageDescription

use of org.eclipse.osgi.service.resolver.ExportPackageDescription in project rt.equinox.framework by eclipse.

the class TestVersion_002 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
}
Also used : ExportPackageDescription(org.eclipse.osgi.service.resolver.ExportPackageDescription)

Example 42 with ExportPackageDescription

use of org.eclipse.osgi.service.resolver.ExportPackageDescription in project rt.equinox.framework by eclipse.

the class TestVersion_002 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("r")) {
            assertNotNull("Package [r] is not wired when it should be ", exp.getExporter());
            assertEquals("Package [r] is wired incorrectly ", exp.getExporter(), bundle_3);
        }
    }
// end for
}
Also used : ExportPackageDescription(org.eclipse.osgi.service.resolver.ExportPackageDescription)

Example 43 with ExportPackageDescription

use of org.eclipse.osgi.service.resolver.ExportPackageDescription in project rt.equinox.framework by eclipse.

the class TestGrouping_008 method checkWiringState_1.

// end of method
public void checkWiringState_1() {
    BundleDescription[] requires = bundle_1.getResolvedRequires();
    assertNotNull("requires array is unexpectedly null", requires);
    assertTrue("requires array is unexpectedly empty", requires.length > 0);
    for (int i = 0; i < requires.length; i++) {
        BundleDescription bd = requires[i];
        String requiresName = bd.getName();
        assertNotNull("bundle name is null", requiresName);
        if (requiresName.equals("B")) {
            assertNotNull("Require [B] is not wired when it should be ", bd);
            assertEquals("Require [B] is wired incorrectly ", bundle_2, bd);
        }
    }
    // end for
    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 ", bundle_3, exp.getExporter());
        }
    }
// end for
}
Also used : BundleDescription(org.eclipse.osgi.service.resolver.BundleDescription) ExportPackageDescription(org.eclipse.osgi.service.resolver.ExportPackageDescription)

Example 44 with ExportPackageDescription

use of org.eclipse.osgi.service.resolver.ExportPackageDescription in project rt.equinox.framework by eclipse.

the class TestOptional_002 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 [r] is not wired when it should be ", exp.getExporter());
            assertEquals("Package [r] is wired incorrectly ", exp.getExporter(), bundle_2);
        } else 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_2);
        } else if (exportPackageName.equals("q")) {
            assertNull("Package [q] is wired when it should not be ", exp);
        }
    }
// end for
}
Also used : ExportPackageDescription(org.eclipse.osgi.service.resolver.ExportPackageDescription)

Example 45 with ExportPackageDescription

use of org.eclipse.osgi.service.resolver.ExportPackageDescription in project rt.equinox.framework by eclipse.

the class TestPropagation_003 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_4);
        }
    }
// end for
}
Also used : ExportPackageDescription(org.eclipse.osgi.service.resolver.ExportPackageDescription)

Aggregations

ExportPackageDescription (org.eclipse.osgi.service.resolver.ExportPackageDescription)61 State (org.eclipse.osgi.service.resolver.State)22 BundleDescription (org.eclipse.osgi.service.resolver.BundleDescription)21 Hashtable (java.util.Hashtable)15 ArrayList (java.util.ArrayList)6 StateObjectFactory (org.eclipse.osgi.service.resolver.StateObjectFactory)6 VersionConstraint (org.eclipse.osgi.service.resolver.VersionConstraint)5 BundleSpecification (org.eclipse.osgi.service.resolver.BundleSpecification)4 ImportPackageSpecification (org.eclipse.osgi.service.resolver.ImportPackageSpecification)4 GenericDescription (org.eclipse.osgi.service.resolver.GenericDescription)3 ExportPackageDescriptionImpl (org.eclipse.osgi.internal.resolver.ExportPackageDescriptionImpl)2 BaseDescription (org.eclipse.osgi.service.resolver.BaseDescription)2 GenericSpecification (org.eclipse.osgi.service.resolver.GenericSpecification)2 StateWire (org.eclipse.osgi.service.resolver.StateWire)2 AccessRule (org.eclipse.tycho.classpath.ClasspathEntry.AccessRule)2 DefaultAccessRule (org.eclipse.tycho.core.osgitools.DefaultClasspathEntry.DefaultAccessRule)2 Dictionary (java.util.Dictionary)1 HashMap (java.util.HashMap)1 List (java.util.List)1 GenericDescriptionImpl (org.eclipse.osgi.internal.resolver.GenericDescriptionImpl)1