コード例 #1
0
 private IInstallableUnit createIUUpdate() {
   return createIU(
       "A",
       Version.create("2.1.0"),
       null,
       NO_REQUIRES,
       NO_PROVIDES,
       NO_PROPERTIES,
       ITouchpointType.NONE,
       NO_TP_DATA,
       false,
       MetadataFactory.createUpdateDescriptor(
           "A", new VersionRange("[2.0.0, 2.1.0]"), 0, "update description"),
       null);
 }
コード例 #2
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    a1 = createIU("A", Version.create("2.0.0"));
    IUpdateDescriptor update =
        MetadataFactory.createUpdateDescriptor(
            "A", new VersionRange("[2.0.0, 2.0.0]"), 0, "update description");
    updateOfA =
        createIU(
            "UpdateA",
            Version.createOSGi(1, 0, 0),
            null,
            NO_REQUIRES,
            NO_PROVIDES,
            NO_PROPERTIES,
            null,
            NO_TP_DATA,
            false,
            update,
            NO_REQUIRES);
    a11 = createIUUpdate();
  }
コード例 #3
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    InstallableUnitDescription iud = new MetadataFactory.InstallableUnitDescription();
    iud.setId("A");
    iud.setVersion(Version.create("1.0.0"));

    String orExpression =
        "providedCapabilities.exists(pc | pc.namespace == 'org.eclipse.equinox.p2.iu' && (pc.name == 'B' || pc.name == 'C'))";
    IExpression expr = ExpressionUtil.parse(orExpression);
    IMatchExpression matchExpression = ExpressionUtil.getFactory().matchExpression(expr);

    Collection<IMatchExpression<IInstallableUnit>> updateExpression =
        new ArrayList<IMatchExpression<IInstallableUnit>>();
    updateExpression.add(matchExpression);
    iud.setUpdateDescriptor(
        MetadataFactory.createUpdateDescriptor(
            updateExpression, IUpdateDescriptor.HIGH, (String) null, (URI) null));
    iua = MetadataFactory.createInstallableUnit(iud);

    Collection<IInstallableUnit> ius = new ArrayList<IInstallableUnit>();
    ius.add(iua);
    URI repoURI = getTempFolder().toURI();
    createMetadataRepository(repoURI, null).addInstallableUnits(ius);
    getMetadataRepositoryManager().removeRepository(repoURI);

    x =
        getMetadataRepositoryManager()
            .loadRepository(repoURI, null)
            .query(QueryUtil.ALL_UNITS, null)
            .iterator()
            .next()
            .getUpdateDescriptor()
            .getIUsBeingUpdated();
    assertEquals(matchExpression, x.iterator().next());
  }
コード例 #4
0
  protected void setUp() throws Exception {
    super.setUp();
    a1 = createIU("A", Version.create("1.0.0"), true);

    createIU(
        "A",
        Version.create("2.0.0"),
        null,
        NO_REQUIRES,
        NO_PROVIDES,
        NO_PROPERTIES,
        ITouchpointType.NONE,
        NO_TP_DATA,
        true,
        MetadataFactory.createUpdateDescriptor("A", VersionRange.emptyRange, 0, "foo bar"),
        null);
    a2 = createIU("A", Version.create("2.0.0"), true);

    createTestMetdataRepository(new IInstallableUnit[] {a1, a2});

    profile = createProfile("TestProfile." + getName());
    planner = createPlanner();
    engine = createEngine();
  }