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)));
}
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());
}
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();
}
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();
}
Aggregations