use of org.eclipse.tycho.test.util.NoopFileLockService in project tycho by eclipse.
the class TestResolverFactory method createLocalRepoIndices.
private LocalRepositoryP2Indices createLocalRepoIndices(MavenContext mavenContext) {
LocalRepositoryP2IndicesImpl localRepoIndices = new LocalRepositoryP2IndicesImpl();
localRepoIndices.setMavenContext(mavenContext);
localRepoIndices.setFileLockService(new NoopFileLockService());
return localRepoIndices;
}
use of org.eclipse.tycho.test.util.NoopFileLockService in project tycho by eclipse.
the class FeatureXmlTransformerTest method testExpandReferences.
@SuppressWarnings("deprecation")
@Test
public void testExpandReferences() throws Exception {
subject = new FeatureXmlTransformer(new SilentLog(), new NoopFileLockService());
Feature feature = Feature.read(new File(TestUtil.getBasedir("projects/featureXmlVersionExpansion/"), "feature.xml"));
TargetPlatform tp = mock(TargetPlatform.class);
when(tp.resolveArtifact("eclipse-feature", "org.eclipse.rcp", "4.5.0.qualifier")).thenReturn(rcpFeatureInTP);
when(tp.resolveArtifact("eclipse-plugin", "org.junit4", "4.8.1.qualifier")).thenReturn(junit4InTP);
when(tp.getArtifactLocation(junit4InTP)).thenReturn(junit4JarLocation);
subject.expandReferences(feature, tp);
assertThat(feature.getIncludedFeatures(), hasItem(feature("org.eclipse.rcp", "4.5.0.v20140918")));
assertThat(feature.getPlugins(), hasItem(plugin("org.junit4", "4.8.1.v20100302")));
PluginRef plugin = feature.getPlugins().get(0);
assertThat(plugin.getId(), is("org.junit4"));
// 1720 bytes rounded to kiB
assertThat(plugin.getDownloadSize(), is(1L));
// 2419 bytes rounded to kiB // TODO shouldn't installSize=downloadSize for unpack=false?
assertThat(plugin.getInstallSize(), is(2L));
assertThat(plugin.isUnpack(), is(false));
}
Aggregations