Search in sources :

Example 16 with ExportPackageDescription

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

the class TestGenerated_001 method checkWiringState_8.

// end method
public void checkWiringState_8() {
    ExportPackageDescription[] exports = null;
    exports = null;
    exports = bundle_8.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
}
Also used : ExportPackageDescription(org.eclipse.osgi.service.resolver.ExportPackageDescription)

Example 17 with ExportPackageDescription

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

the class TestGenerated_001 method checkWiringState_7.

// end method
public void checkWiringState_7() {
    ExportPackageDescription[] exports = null;
    exports = null;
    exports = bundle_7.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
}
Also used : ExportPackageDescription(org.eclipse.osgi.service.resolver.ExportPackageDescription)

Example 18 with ExportPackageDescription

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

the class TestGenerated_001 method checkWiringState_3.

// end method
public void checkWiringState_3() {
    ExportPackageDescription[] exports = null;
    exports = null;
    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("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
}
Also used : ExportPackageDescription(org.eclipse.osgi.service.resolver.ExportPackageDescription)

Example 19 with ExportPackageDescription

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

the class TestDynamic_004 method testTest_003.

public void testTest_003() {
    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);
    bundle_4 = create_bundle_4(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, "q");
    assertNotNull("Package [q] is not wired when it should be ", exp);
    assertEquals("Package [q] is wired incorrectly ", exp.getExporter(), bundle_3);
}
Also used : State(org.eclipse.osgi.service.resolver.State) ExportPackageDescription(org.eclipse.osgi.service.resolver.ExportPackageDescription) StateObjectFactory(org.eclipse.osgi.service.resolver.StateObjectFactory)

Example 20 with ExportPackageDescription

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

the class TestDynamic_004 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_2);
        }
    }
// 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