Search in sources :

Example 1 with TestResolverFactory

use of org.eclipse.tycho.p2.target.TestResolverFactory in project tycho by eclipse.

the class TargetPlatformFactoryTest method setUpSubjectAndContext.

@Before
public void setUpSubjectAndContext() throws Exception {
    subject = new TestResolverFactory(logVerifier.getLogger()).getTargetPlatformFactoryImpl();
    tpConfig = new TargetPlatformConfigurationStub();
    // dummy value for target file resolution
    tpConfig.setEnvironments(Collections.singletonList(new TargetEnvironment(null, null, null)));
}
Also used : TargetPlatformConfigurationStub(org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub) TargetEnvironment(org.eclipse.tycho.core.shared.TargetEnvironment) Before(org.junit.Before)

Example 2 with TestResolverFactory

use of org.eclipse.tycho.p2.target.TestResolverFactory in project tycho by eclipse.

the class TargetPlatformFactoryTest method testIncludeLocalMavenRepo.

@Test
public void testIncludeLocalMavenRepo() throws Exception {
    TestResolverFactory factory = new TestResolverFactory(logVerifier.getLogger());
    LocalMetadataRepository localMetadataRepo = factory.getLocalMetadataRepository();
    // add one IU to local repo
    localMetadataRepo.addInstallableUnit(InstallableUnitUtil.createIU("locallyInstalledIU", "1.0.0"), new GAV("test", "foo", "1.0.0"));
    subject = factory.getTargetPlatformFactoryImpl();
    Collection<IInstallableUnit> iusIncludingLocalRepo = subject.createTargetPlatform(tpConfig, NOOP_EE_RESOLUTION_HANDLER, null, null).getInstallableUnits();
    tpConfig.setForceIgnoreLocalArtifacts(true);
    Collection<IInstallableUnit> iusWithoutLocalRepo = subject.createTargetPlatform(tpConfig, NOOP_EE_RESOLUTION_HANDLER, null, null).getInstallableUnits();
    Set<IInstallableUnit> retainedIUs = new HashSet<>(iusIncludingLocalRepo);
    retainedIUs.removeAll(iusWithoutLocalRepo);
    assertEquals(1, retainedIUs.size());
    assertEquals("locallyInstalledIU", retainedIUs.iterator().next().getId());
}
Also used : IInstallableUnit(org.eclipse.equinox.p2.metadata.IInstallableUnit) LocalMetadataRepository(org.eclipse.tycho.repository.local.LocalMetadataRepository) GAV(org.eclipse.tycho.p2.repository.GAV) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 3 with TestResolverFactory

use of org.eclipse.tycho.p2.target.TestResolverFactory in project tycho by eclipse.

the class CustomEEResolutionHandlerTest method setUpContext.

@Before
public void setUpContext() throws Exception {
    tpFactory = new TestResolverFactory(logVerifier.getLogger()).getTargetPlatformFactory();
    tpConfig = new TargetPlatformConfigurationStub();
}
Also used : TargetPlatformConfigurationStub(org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub) TestResolverFactory(org.eclipse.tycho.p2.target.TestResolverFactory) Before(org.junit.Before)

Example 4 with TestResolverFactory

use of org.eclipse.tycho.p2.target.TestResolverFactory in project tycho by eclipse.

the class PomDependencyCollectorTest method getTargetPlatformUnits.

private Collection<IInstallableUnit> getTargetPlatformUnits() {
    TestResolverFactory resolverFactory = new TestResolverFactory(logVerifier.getLogger());
    P2TargetPlatform platform = resolverFactory.getTargetPlatformFactoryImpl().createTargetPlatform(new TargetPlatformConfigurationStub(), NOOP_EE_RESOLUTION_HANDLER, null, subject);
    return platform.getInstallableUnits();
}
Also used : TargetPlatformConfigurationStub(org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub)

Aggregations

TargetPlatformConfigurationStub (org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub)3 Before (org.junit.Before)2 HashSet (java.util.HashSet)1 IInstallableUnit (org.eclipse.equinox.p2.metadata.IInstallableUnit)1 TargetEnvironment (org.eclipse.tycho.core.shared.TargetEnvironment)1 GAV (org.eclipse.tycho.p2.repository.GAV)1 TestResolverFactory (org.eclipse.tycho.p2.target.TestResolverFactory)1 LocalMetadataRepository (org.eclipse.tycho.repository.local.LocalMetadataRepository)1 Test (org.junit.Test)1