use of org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice in project tycho by eclipse.
the class FeatureRootAdviceFilesTest method testParseBuildPropertiesRelativeFileWithAndWithoutConfigs.
@Test
public void testParseBuildPropertiesRelativeFileWithAndWithoutConfigs() {
Properties buildProperties = createBuildPropertiesWithoutRootKeys();
buildProperties.put("root." + WINDOWS_SPEC_FOR_PROPERTIES_KEY, "file:rootfiles/file1.txt");
buildProperties.put("root." + LINUX_SPEC_FOR_PROPERTIES_KEY, "file:rootfiles/file2.txt");
buildProperties.put("root", "rootfiles/dir");
IFeatureRootAdvice advice = createAdvice(buildProperties);
FileToPathMap winFilesMap = getSourceToDestinationMap(advice, WINDOWS_SPEC_FOR_ADVICE);
assertEquals(1, winFilesMap.size());
assertRootFileEntry(winFilesMap, "rootfiles/file1.txt", "file1.txt");
FileToPathMap linuxFilesMap = getSourceToDestinationMap(advice, LINUX_SPEC_FOR_ADVICE);
assertEquals(1, linuxFilesMap.size());
assertRootFileEntry(linuxFilesMap, "rootfiles/file2.txt", "file2.txt");
FileToPathMap globalFilesMap = getSourceToDestinationMap(advice, GLOBAL_SPEC);
assertEquals(1, globalFilesMap.size());
assertRootFileEntry(globalFilesMap, "rootfiles/dir/file3.txt", "file3.txt");
}
use of org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice in project tycho by eclipse.
the class FeatureRootAdviceLinksTest method testGlobalLinks.
@Test
public void testGlobalLinks() {
Properties buildProperties = createBuildPropertiesWithDefaultRootFiles();
buildProperties.put("root.link", "dir/file3.txt,alias1.txt,file1.txt,alias2.txt");
IFeatureRootAdvice advice = createAdvice(buildProperties);
String actualLink = advice.getDescriptor(GLOBAL_SPEC).getLinks();
assertEquals("dir/file3.txt,alias1.txt,file1.txt,alias2.txt", actualLink);
}
use of org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice in project tycho by eclipse.
the class FeatureRootAdviceLinksTest method testLinkValueNotInPairs.
@Test(expected = IllegalArgumentException.class)
public void testLinkValueNotInPairs() throws Exception {
Properties buildProperties = createBuildPropertiesWithDefaultRootFiles();
buildProperties.put("root.link", "file1.txt,alias1.txt,file2.txt");
IFeatureRootAdvice advice = createAdvice(buildProperties);
callGetDescriptorsForAllConfigurations(advice);
}
use of org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice in project tycho by eclipse.
the class FeatureRootAdviceLinksTest method testSpecificLinks.
@Test
public void testSpecificLinks() {
Properties buildProperties = createBuildPropertiesWithDefaultRootFiles();
buildProperties.put("root." + LINUX_SPEC_FOR_PROPERTIES_KEY, "file:rootfiles/dir/file3.txt");
buildProperties.put("root." + LINUX_SPEC_FOR_PROPERTIES_KEY + ".link", "file3.txt,alias.txt");
IFeatureRootAdvice advice = createAdvice(buildProperties);
String globalLink = advice.getDescriptor(GLOBAL_SPEC).getLinks();
assertEquals("", globalLink);
String specificLink = advice.getDescriptor(LINUX_SPEC_FOR_ADVICE).getLinks();
assertEquals("file3.txt,alias.txt", specificLink);
}
use of org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice in project tycho by eclipse.
the class FeatureRootAdviceLinksTest method testGlobalLinkButNoFiles.
@Test(expected = IllegalArgumentException.class)
public void testGlobalLinkButNoFiles() throws Exception {
Properties buildProperties = createBuildPropertiesWithoutRootKeys();
buildProperties.put("root.link", "file1.txt,alias.txt");
IFeatureRootAdvice advice = createAdvice(buildProperties);
callGetDescriptorsForAllConfigurations(advice);
}
Aggregations