Search in sources :

Example 51 with State

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

the class TestCycle_006 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);
    // ***************************************************
    // 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();
}
Also used : State(org.eclipse.osgi.service.resolver.State) StateObjectFactory(org.eclipse.osgi.service.resolver.StateObjectFactory)

Example 52 with State

use of org.eclipse.osgi.service.resolver.State 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 53 with State

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

the class TestPropagation_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);
    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();
}
Also used : State(org.eclipse.osgi.service.resolver.State) StateObjectFactory(org.eclipse.osgi.service.resolver.StateObjectFactory)

Example 54 with State

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

the class TestVersion_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();
}
Also used : State(org.eclipse.osgi.service.resolver.State) StateObjectFactory(org.eclipse.osgi.service.resolver.StateObjectFactory)

Example 55 with State

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

the class TestGrouping_008 method testTest_008.

public void testTest_008() {
    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();
}
Also used : State(org.eclipse.osgi.service.resolver.State) StateObjectFactory(org.eclipse.osgi.service.resolver.StateObjectFactory)

Aggregations

State (org.eclipse.osgi.service.resolver.State)119 BundleDescription (org.eclipse.osgi.service.resolver.BundleDescription)87 Hashtable (java.util.Hashtable)70 Dictionary (java.util.Dictionary)28 StateObjectFactory (org.eclipse.osgi.service.resolver.StateObjectFactory)27 ExportPackageDescription (org.eclipse.osgi.service.resolver.ExportPackageDescription)22 StateDelta (org.eclipse.osgi.service.resolver.StateDelta)11 BundleDelta (org.eclipse.osgi.service.resolver.BundleDelta)10 ArrayList (java.util.ArrayList)7 List (java.util.List)7 File (java.io.File)6 HashMap (java.util.HashMap)6 Map (java.util.Map)5 CaseInsensitiveDictionaryMap (org.eclipse.osgi.framework.util.CaseInsensitiveDictionaryMap)5 Version (org.osgi.framework.Version)5 BundleWiring (org.osgi.framework.wiring.BundleWiring)4 PerformanceTestRunner (org.eclipse.core.tests.harness.PerformanceTestRunner)3 BundleException (org.osgi.framework.BundleException)3 BundleContext (org.osgi.framework.BundleContext)2 Collection (java.util.Collection)1