Search in sources :

Example 1 with ResourceUtil.resourceFile

use of org.eclipse.tycho.p2.tools.test.util.ResourceUtil.resourceFile in project tycho by eclipse.

the class ReactorRepositoryManagerTest method testTargetPlatformComputationInIntegration.

@Test
public void testTargetPlatformComputationInIntegration() throws Exception {
    subject = getService(ReactorRepositoryManagerFacade.class);
    ReactorProject currentProject = new ReactorProjectStub("reactor-artifact");
    TargetPlatformConfigurationStub tpConfig = new TargetPlatformConfigurationStub();
    tpConfig.addP2Repository(new MavenRepositoryLocation(null, ResourceUtil.resourceFile("repositories/launchers").toURI()));
    subject.computePreliminaryTargetPlatform(currentProject, tpConfig, new ExecutionEnvironmentConfigurationStub("JavaSE-1.7"), null, null);
    ReactorProjectIdentities upstreamProject = new ReactorProjectIdentitiesStub(ResourceUtil.resourceFile("projectresult"));
    subject.computeFinalTargetPlatform(currentProject, Arrays.asList(upstreamProject));
    P2TargetPlatform finalTP = (P2TargetPlatform) currentProject.getContextValue("org.eclipse.tycho.core.TychoConstants/targetPlatform");
    Collection<IInstallableUnit> units = finalTP.getInstallableUnits();
    // units from the p2 repository
    assertThat(units, hasItem(unitWithId("org.eclipse.equinox.launcher")));
    // units from the upstream project
    assertThat(units, hasItem(unitWithId("bundle")));
    assertThat(units, hasItem(unitWithId("bundle.source")));
// TODO get artifact
}
Also used : ReactorRepositoryManagerFacade(org.eclipse.tycho.repository.registry.facade.ReactorRepositoryManagerFacade) TargetPlatformConfigurationStub(org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub) ExecutionEnvironmentConfigurationStub(org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfigurationStub) MavenRepositoryLocation(org.eclipse.tycho.core.resolver.shared.MavenRepositoryLocation) ReactorProjectIdentitiesStub(org.eclipse.tycho.test.util.ReactorProjectIdentitiesStub) ReactorProject(org.eclipse.tycho.ReactorProject) ReactorProjectStub(org.eclipse.tycho.p2.impl.test.ReactorProjectStub) P2TargetPlatform(org.eclipse.tycho.p2.target.P2TargetPlatform) ReactorProjectIdentities(org.eclipse.tycho.ReactorProjectIdentities) IInstallableUnit(org.eclipse.equinox.p2.metadata.IInstallableUnit) Test(org.junit.Test)

Example 2 with ResourceUtil.resourceFile

use of org.eclipse.tycho.p2.tools.test.util.ResourceUtil.resourceFile in project tycho by eclipse.

the class MirrorApplicationServiceTest method sourceRepos.

public static RepositoryReferences sourceRepos(String... repoIds) {
    RepositoryReferences result = new RepositoryReferences();
    for (String repoId : repoIds) {
        result.addMetadataRepository(ResourceUtil.resourceFile("repositories/" + repoId));
        result.addArtifactRepository(ResourceUtil.resourceFile("repositories/" + repoId));
    }
    return result;
}
Also used : RepositoryReferences(org.eclipse.tycho.p2.tools.RepositoryReferences)

Aggregations

IInstallableUnit (org.eclipse.equinox.p2.metadata.IInstallableUnit)1 ReactorProject (org.eclipse.tycho.ReactorProject)1 ReactorProjectIdentities (org.eclipse.tycho.ReactorProjectIdentities)1 ExecutionEnvironmentConfigurationStub (org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfigurationStub)1 MavenRepositoryLocation (org.eclipse.tycho.core.resolver.shared.MavenRepositoryLocation)1 ReactorProjectStub (org.eclipse.tycho.p2.impl.test.ReactorProjectStub)1 P2TargetPlatform (org.eclipse.tycho.p2.target.P2TargetPlatform)1 TargetPlatformConfigurationStub (org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub)1 RepositoryReferences (org.eclipse.tycho.p2.tools.RepositoryReferences)1 ReactorRepositoryManagerFacade (org.eclipse.tycho.repository.registry.facade.ReactorRepositoryManagerFacade)1 ReactorProjectIdentitiesStub (org.eclipse.tycho.test.util.ReactorProjectIdentitiesStub)1 Test (org.junit.Test)1