use of org.eclipse.tycho.p2.tools.mirroring.facade.MirrorOptions in project tycho by eclipse.
the class MirrorStandaloneTest method testIgnoreErrorShouldNotThrowException.
@Test
public void testIgnoreErrorShouldNotThrowException() throws FacadeException {
MirrorOptions mirrorOptions = new MirrorOptions();
mirrorOptions.setIgnoreErrors(true);
subject.mirrorStandalone(sourceRepos("invalid/wrong_checksum"), destinationRepo, Collections.singletonList(new IUDescription("jarsigning", "0.0.1.201109191414")), mirrorOptions, targetFolder);
}
use of org.eclipse.tycho.p2.tools.mirroring.facade.MirrorOptions in project tycho by eclipse.
the class MirrorApplicationServiceImpl method mirrorStandalone.
@Override
public void mirrorStandalone(RepositoryReferences sources, DestinationRepositoryDescriptor destination, Collection<IUDescription> seedIUs, MirrorOptions mirrorOptions, BuildOutputDirectory tempDirectory) throws FacadeException {
IProvisioningAgent agent = Activator.createProvisioningAgent(tempDirectory);
try {
final MirrorApplication mirrorApp = createMirrorApplication(sources, destination, agent, mirrorOptions.isIncludePacked());
mirrorApp.setSlicingOptions(createSlicingOptions(mirrorOptions));
mirrorApp.setIgnoreErrors(mirrorOptions.isIgnoreErrors());
try {
// we want to see mirror progress as this is a possibly long-running operation
mirrorApp.setVerbose(true);
mirrorApp.setLog(new LogListener(mavenContext.getLogger()));
mirrorApp.setSourceIUs(querySourceIus(seedIUs, mirrorApp.getCompositeMetadataRepository(), sources));
IStatus returnStatus = mirrorApp.run(null);
checkStatus(returnStatus, mirrorOptions.isIgnoreErrors());
} catch (ProvisionException e) {
throw new FacadeException(MIRROR_FAILURE_MESSAGE + ": " + StatusTool.collectProblems(e.getStatus()), e);
}
} finally {
agent.stop();
}
}
use of org.eclipse.tycho.p2.tools.mirroring.facade.MirrorOptions in project tycho by eclipse.
the class MirrorStandaloneTest method testMirrorLatestOnly.
@Test
public void testMirrorLatestOnly() throws Exception {
MirrorOptions mirrorOptions = new MirrorOptions();
mirrorOptions.setLatestVersionOnly(true);
subject.mirrorStandalone(sourceRepos("e342", "e352"), destinationRepo, null, mirrorOptions, targetFolder);
File[] runtimeBundles = new File(destinationRepo.getLocation(), "plugins").listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
return file.getName().startsWith("org.eclipse.core.runtime");
}
});
assertEquals(1, runtimeBundles.length);
}
use of org.eclipse.tycho.p2.tools.mirroring.facade.MirrorOptions in project tycho by eclipse.
the class MirrorStandaloneTest method testMirrorAllUnits.
@Test
public void testMirrorAllUnits() throws Exception {
subject.mirrorStandalone(e342PlusFragmentsRepo(), destinationRepo, null, new MirrorOptions(), targetFolder);
assertEquals(3, getMirroredBundleFiles().length);
assertTrue(repoFile(destinationRepo, "plugins/org.eclipse.core.runtime_3.4.0.v20080512.jar").exists());
assertTrue(repoFile(destinationRepo, "plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.0.101.R34x_v20080731.jar").exists());
assertTrue(repoFile(destinationRepo, "plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731.jar").exists());
}
use of org.eclipse.tycho.p2.tools.mirroring.facade.MirrorOptions in project tycho by eclipse.
the class MirrorStandaloneTest method testMirrorMatchExpression.
@Test
public void testMirrorMatchExpression() throws Exception {
subject.mirrorStandalone(e342PlusFragmentsRepo(), destinationRepo, Collections.singletonList(new IUDescription(null, null, "id == $0 && version == $1", new String[] { "org.eclipse.core.runtime", "3.4.0.v20080512" })), new MirrorOptions(), targetFolder);
assertEquals(1, getMirroredBundleFiles().length);
assertTrue(repoFile(destinationRepo, "plugins/org.eclipse.core.runtime_3.4.0.v20080512.jar").exists());
}
Aggregations