Search in sources :

Example 1 with IFeatureRootAdvice

use of org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice in project tycho by eclipse.

the class FeatureRootAdviceLinksTest method testWhitespaceAroundSeparatorsInLinks.

@Test
public void testWhitespaceAroundSeparatorsInLinks() throws Exception {
    Properties buildProperties = createBuildPropertiesWithDefaultRootFiles();
    buildProperties.put("root.link", " file1.txt , alias1.txt ,  dir/file3.txt,alias2.txt , \n\tfile2.txt , alias3.txt \n\t");
    IFeatureRootAdvice advice = createAdvice(buildProperties);
    String actualLinks = advice.getDescriptor(GLOBAL_SPEC).getLinks();
    assertEquals("file1.txt,alias1.txt,dir/file3.txt,alias2.txt,file2.txt,alias3.txt", actualLinks);
}
Also used : IFeatureRootAdvice(org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice) Properties(java.util.Properties) Test(org.junit.Test)

Example 2 with IFeatureRootAdvice

use of org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice in project tycho by eclipse.

the class FeatureRootAdviceLinksTest method testSpecificLinkButNoFiles.

@Test(expected = IllegalArgumentException.class)
public void testSpecificLinkButNoFiles() throws Exception {
    Properties buildProperties = createBuildPropertiesWithDefaultRootFiles();
    buildProperties.put("root." + WINDOWS_SPEC_FOR_PROPERTIES_KEY + ".link", "file1.txt,alias.txt");
    IFeatureRootAdvice advice = createAdvice(buildProperties);
    callGetDescriptorsForAllConfigurations(advice);
}
Also used : IFeatureRootAdvice(org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice) Properties(java.util.Properties) Test(org.junit.Test)

Example 3 with IFeatureRootAdvice

use of org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice in project tycho by eclipse.

the class FeatureRootAdviceLinksTest method testNoLinks.

@Test
public void testNoLinks() {
    Properties buildProperties = createBuildPropertiesWithDefaultRootFiles();
    IFeatureRootAdvice advice = createAdvice(buildProperties);
    String globalLinks = advice.getDescriptor(GLOBAL_SPEC).getLinks();
    assertEquals("", globalLinks);
}
Also used : IFeatureRootAdvice(org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice) Properties(java.util.Properties) Test(org.junit.Test)

Example 4 with IFeatureRootAdvice

use of org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice in project tycho by eclipse.

the class FeatureRootAdvicePermissionsTest method testSpecificPermissions.

@Test
public void testSpecificPermissions() {
    Properties buildProperties = createBuildPropertiesWithDefaultRootFiles();
    buildProperties.put("root.permissions.755", "file1.txt");
    buildProperties.put("root." + LINUX_SPEC_FOR_PROPERTIES_KEY, "file:rootfiles/file2.txt");
    buildProperties.put("root." + LINUX_SPEC_FOR_PROPERTIES_KEY + ".permissions.755", "file2.txt");
    IFeatureRootAdvice advice = createAdvice(buildProperties);
    List<String[]> globalPermissions = getSortedPermissions(advice, GLOBAL_SPEC);
    assertEquals(1, globalPermissions.size());
    List<String[]> specificPermissions = getSortedPermissions(advice, LINUX_SPEC_FOR_ADVICE);
    assertEquals(1, specificPermissions.size());
}
Also used : IFeatureRootAdvice(org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice) Properties(java.util.Properties) Test(org.junit.Test)

Example 5 with IFeatureRootAdvice

use of org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice in project tycho by eclipse.

the class FeatureRootAdvicePermissionsTest method testGlobalPermissionsButNoFiles.

@Test(expected = IllegalArgumentException.class)
public void testGlobalPermissionsButNoFiles() throws Exception {
    Properties buildProperties = createBuildPropertiesWithoutRootKeys();
    buildProperties.put("root.permissions.644", "file2.txt");
    IFeatureRootAdvice advice = createAdvice(buildProperties);
    callGetDescriptorsForAllConfigurations(advice);
}
Also used : IFeatureRootAdvice(org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice) Properties(java.util.Properties) Test(org.junit.Test)

Aggregations

IFeatureRootAdvice (org.eclipse.equinox.p2.publisher.actions.IFeatureRootAdvice)17 Test (org.junit.Test)15 Properties (java.util.Properties)14 File (java.io.File)1 ArrayList (java.util.ArrayList)1 IPath (org.eclipse.core.runtime.IPath)1 Path (org.eclipse.core.runtime.Path)1 IPublisherAdvice (org.eclipse.equinox.p2.publisher.IPublisherAdvice)1 BuildPropertiesParserForTesting (org.eclipse.tycho.test.util.BuildPropertiesParserForTesting)1