Esempio n. 1
0
 @Override
 ProvisioningContext getFirstPassProvisioningContext() {
   ProvisioningContext pc = new ProvisioningContext(session.getProvisioningAgent());
   pc.setMetadataRepositories(new URI[0]);
   pc.setArtifactRepositories(new URI[0]);
   return pc;
 }
Esempio n. 2
0
  public void testGreedy() throws ProvisionException, OperationCanceledException {
    URI heliosRepo = getTestData("helios", "testData/bug306279/repo/helios").toURI();
    URI rienaRepo2 =
        getTestData("rienatoolbox-a", "testData/bug306279/repo/rienatoolbox-a").toURI();
    IMetadataRepository repo1 = getMetadataRepositoryManager().loadRepository(heliosRepo, null);
    assertFalse(
        repo1
            .query(
                QueryUtil.createIUQuery("org.eclipse.rap.jface.databinding"),
                new NullProgressMonitor())
            .isEmpty());
    IMetadataRepository repo2 = getMetadataRepositoryManager().loadRepository(rienaRepo2, null);

    IPlanner planner = getPlanner(getAgent());
    IProfile profile = createProfile(getName());
    IProfileChangeRequest request = new ProfileChangeRequest(profile);
    Set<IInstallableUnit> ius =
        repo2
            .query(
                QueryUtil.createIUQuery("org.eclipse.riena.toolbox.feature.feature.group"),
                new NullProgressMonitor())
            .toUnmodifiableSet();
    request.addAll(ius);
    ProvisioningContext ctx = new ProvisioningContext(getAgent());
    ctx.setMetadataRepositories(new URI[] {heliosRepo, rienaRepo2});
    IProvisioningPlan plan = planner.getProvisioningPlan(request, ctx, new NullProgressMonitor());

    assertOK("resolution failed", plan.getStatus());
    assertEquals(
        0,
        plan.getAdditions()
            .query(
                QueryUtil.createIUQuery("org.eclipse.rap.jface.databinding"),
                new NullProgressMonitor())
            .toUnmodifiableSet()
            .size());
    System.out.println(plan);
  }