Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additions to PR#927 #933

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build/org.eclipse.pde.build.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.apache.ant,
org.eclipse.debug.core,
org.eclipse.equinox.p2.publisher;bundle-version="1.1.0",
org.eclipse.equinox.p2.publisher.eclipse;bundle-version="1.0.0"
org.eclipse.equinox.p2.publisher.eclipse;bundle-version="1.0.0",
org.eclipse.equinox.p2.repository.tools
Bundle-RequiredExecutionEnvironment: JavaSE-17
Import-Package: org.eclipse.equinox.frameworkadmin;version="2.0.0",
org.eclipse.equinox.internal.p2.artifact.repository,
Expand Down
2 changes: 2 additions & 0 deletions build/org.eclipse.pde.build.tests/META-INF/p2.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
requires.0.namespace = org.eclipse.equinox.p2.iu
requires.0.name = org.eclipse.osgi.compatibility.state
1 change: 0 additions & 1 deletion build/org.eclipse.pde.build.tests/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ bin.includes = META-INF/,\
test.xml
src.includes = about.html
jars.compile.order = .
pom.model.property.skipTests = true
pom.model.property.code.ignoredWarnings = ${tests.ignoredWarnings}
89 changes: 89 additions & 0 deletions build/org.eclipse.pde.build.tests/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.pde</groupId>
<artifactId>eclipse.pde.build</artifactId>
<version>4.31.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.pde.build.tests</artifactId>
<version>1.4.300-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>

<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<dependency-resolution>
<extraRequirements>
<!-- The product -->
<requirement>
<type>p2-installable-unit</type>
<id>org.eclipse.sdk.ide</id>
<versionRange>0.0.0</versionRange>
</requirement>
<!-- The "deltapack" -->
<requirement>
<type>eclipse-feature</type>
<id>org.eclipse.equinox.executable</id>
<versionRange>0.0.0</versionRange>
</requirement>
</extraRequirements>
</dependency-resolution>
<environments>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<product>org.eclipse.sdk.ide</product>
<testRuntime>p2Installed</testRuntime>
<testClass>org.eclipse.pde.build.tests.PDEBuildTestSuite</testClass>
<systemProperties>
<pde.build.includeP2>false</pde.build.includeP2>
<pde.build.verification>true</pde.build.verification>
</systemProperties>
<installAllEnvironments>true</installAllEnvironments>
<work>${project.build.directory}/surefire.app</work>
</configuration>
<executions>
<execution>
<id>p2-tests</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<testClass>org.eclipse.pde.build.tests.P2TestSuite</testClass>
<systemProperties>
<pde.build.verification>true</pde.build.verification>
</systemProperties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeFalse;

import java.io.BufferedOutputStream;
import java.io.File;
Expand Down Expand Up @@ -56,22 +57,22 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.equinox.internal.p2.publisher.eclipse.Messages;

Check warning on line 60 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
import org.eclipse.equinox.p2.publisher.eclipse.FeatureEntry;

Check warning on line 61 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
import org.eclipse.osgi.service.resolver.VersionRange;
import org.eclipse.pde.build.internal.tests.ant.AntUtils;
import org.eclipse.pde.build.tests.BuildConfiguration;
import org.eclipse.pde.build.tests.PDETestCase;
import org.eclipse.pde.internal.build.AbstractScriptGenerator;

Check warning on line 66 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
import org.eclipse.pde.internal.build.BuildScriptGenerator;

Check warning on line 67 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
import org.eclipse.pde.internal.build.Config;

Check warning on line 68 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
import org.eclipse.pde.internal.build.IBuildPropertiesConstants;

Check warning on line 69 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
import org.eclipse.pde.internal.build.IPDEBuildConstants;

Check warning on line 70 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
import org.eclipse.pde.internal.build.builder.BuildDirector;

Check warning on line 71 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
import org.eclipse.pde.internal.build.site.BuildTimeFeature;

Check warning on line 72 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
import org.eclipse.pde.internal.build.site.BuildTimeFeatureFactory;

Check warning on line 73 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
import org.eclipse.pde.internal.build.site.BuildTimeSiteFactory;

Check warning on line 74 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
import org.eclipse.pde.internal.build.site.QualifierReplacer;

Check warning on line 75 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
import org.junit.Ignore;
import org.junit.Test;
import org.osgi.framework.Version;
Expand Down Expand Up @@ -102,37 +103,37 @@
public void testBug148288() throws Exception {
IProject buildProject = newTest();

class MyBuildScriptGenerator extends BuildScriptGenerator {

Check warning on line 106 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
@Override
public HashMap<Config, String> getArchivesFormat() {

Check warning on line 108 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
return super.getArchivesFormat();

Check warning on line 109 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
}
}
;

String location = buildProject.getLocation().toOSString();
MyBuildScriptGenerator generator = new MyBuildScriptGenerator();
generator.setElements(new String[] {});

Check warning on line 116 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
generator.setWorkingDirectory(location);

Check warning on line 117 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
BuildTimeSiteFactory.setInstalledBaseSite(location);

Check warning on line 118 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
AbstractScriptGenerator.setConfigInfo("win32, win32, x86");

Check warning on line 119 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
generator.setArchivesFormat("win32, win32, x86 - antZip");

Check warning on line 120 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
generator.generate();

Check warning on line 121 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:

HashMap<Config, String> map = generator.getArchivesFormat();

Check warning on line 123 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertEquals(map.size(), 1);
Config config = map.keySet().iterator().next();

Check warning on line 125 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertEquals(map.get(config), "antZip");

clearStatics();

generator = new MyBuildScriptGenerator();
generator.setElements(new String[] {});

Check warning on line 131 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
generator.setWorkingDirectory(location);

Check warning on line 132 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
BuildTimeSiteFactory.setInstalledBaseSite(location);

Check warning on line 133 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
generator.setArchivesFormat("win32, win32, x86 - folder");

Check warning on line 134 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
AbstractScriptGenerator.setConfigInfo("win32, win32, x86");

Check warning on line 135 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
generator.generate();

Check warning on line 136 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:

map = generator.getArchivesFormat();
assertEquals(map.size(), 1);
Expand Down Expand Up @@ -288,14 +289,14 @@

assertResourceFile(buildFolder, "features/sdk/feature.xml");
IFile feature = buildFolder.getFile("features/sdk/feature.xml");
BuildTimeFeatureFactory factory = new BuildTimeFeatureFactory();

Check warning on line 292 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
BuildTimeFeature model = factory.parseBuildFeature(feature.getLocationURI().toURL());

Check warning on line 293 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:

FeatureEntry[] included = model.getIncludedFeatureReferences();

Check warning on line 295 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertEquals(included.length, 3);
assertEquals(included[0].getId(), "foo");

Check warning on line 297 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertEquals(included[1].getId(), "bar");

Check warning on line 298 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertEquals(included[2].getId(), "disco");

Check warning on line 299 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
}

@Test
Expand Down Expand Up @@ -483,15 +484,15 @@
runAntScript(buildXML.getLocation().toOSString(), new String[] { "default" },
buildFolder.getLocation().toOSString(), null);

BuildTimeFeatureFactory factory = new BuildTimeFeatureFactory();

Check warning on line 487 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
BuildTimeFeature feature = factory.parseBuildFeature(featureXML.getLocationURI().toURL());

Check warning on line 488 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
FeatureEntry[] pluginEntryModels = feature.getPluginEntries();

Check warning on line 489 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertEquals(pluginEntryModels[0].getId(), "foo");

Check warning on line 490 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertEquals(pluginEntryModels[0].getVersion(), "1.0.0.vA");

Check warning on line 491 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertEquals(pluginEntryModels[1].getId(), "bar");

Check warning on line 492 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertEquals(pluginEntryModels[1].getVersion(), "1.0.0.id_v");

Check warning on line 493 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertEquals(pluginEntryModels[2].getId(), "foo.version");

Check warning on line 494 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertEquals(pluginEntryModels[2].getVersion(), "2.1.2");

Check warning on line 495 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
}

@Test
Expand Down Expand Up @@ -529,11 +530,11 @@
IFile featureXML = buildFolder.getFile("feature.xml");
Utils.writeBuffer(featureXML, buffer);

BuildTimeFeatureFactory factory = new BuildTimeFeatureFactory();

Check warning on line 533 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
try {
factory.parseBuildFeature(featureXML.getLocationURI().toURL());

Check warning on line 535 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
} catch (CoreException e) {
assertTrue(e.getStatus().toString().indexOf(Messages.feature_parse_emptyRequires) > 0);

Check warning on line 537 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
return;
}
assertTrue(false);
Expand Down Expand Up @@ -702,43 +703,43 @@

@Test
public void testBug247091_2() throws Exception {
VersionRange range = org.eclipse.pde.internal.build.Utils.createVersionRange("1.0.0");

Check warning on line 706 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertTrue(range.getIncludeMinimum());
assertTrue(range.getIncludeMaximum());
assertEquals(range.getMinimum(), new Version("1.0.0"));
assertEquals(range.getRight(), new Version("1.0.0"));

range = org.eclipse.pde.internal.build.Utils.createVersionRange("1.0.0.qualifier");

Check warning on line 712 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertTrue(range.getIncludeMinimum());
assertFalse(range.getIncludeMaximum());
assertEquals(range.getMinimum(), new Version("1.0.0"));
assertEquals(range.getRight(), new Version("1.0.1"));

range = org.eclipse.pde.internal.build.Utils.createVersionRange("1.0.0.zqualifier");

Check warning on line 718 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertTrue(range.getIncludeMinimum());
assertFalse(range.getIncludeMaximum());
assertEquals(range.getMinimum(), new Version("1.0.0.z"));
assertEquals(range.getRight(), new Version("1.0.1"));

range = org.eclipse.pde.internal.build.Utils.createVersionRange("1.0.0.abcqualifier");

Check warning on line 724 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertTrue(range.getIncludeMinimum());
assertFalse(range.getIncludeMaximum());
assertEquals(range.getMinimum(), new Version("1.0.0.abc"));
assertEquals(range.getRight(), new Version("1.0.0.abd"));

range = org.eclipse.pde.internal.build.Utils.createVersionRange("1.0.0.abzqualifier");

Check warning on line 730 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertTrue(range.getIncludeMinimum());
assertFalse(range.getIncludeMaximum());
assertEquals(range.getMinimum(), new Version("1.0.0.abz"));
assertEquals(range.getRight(), new Version("1.0.0.ac"));

range = org.eclipse.pde.internal.build.Utils.createVersionRange("1.0.0.abzzqualifier");

Check warning on line 736 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertTrue(range.getIncludeMinimum());
assertFalse(range.getIncludeMaximum());
assertEquals(range.getMinimum(), new Version("1.0.0.abzz"));
assertEquals(range.getRight(), new Version("1.0.0.ac"));

range = org.eclipse.pde.internal.build.Utils.createVersionRange("1.0.0.abzz_qualifier");

Check warning on line 742 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
assertTrue(range.getIncludeMinimum());
assertFalse(range.getIncludeMaximum());
assertEquals(range.getMinimum(), new Version("1.0.0.abzz_"));
Expand Down Expand Up @@ -828,6 +829,7 @@

@Test
public void testBug238177() throws Exception {
assumeFalse(Boolean.getBoolean("pde.build.verification"));
IFolder buildFolder = newTest("238177");
IFolder a = Utils.createFolder(buildFolder, "plugins/A");
IFolder b = Utils.createFolder(buildFolder, "plugins/B");
Expand Down Expand Up @@ -903,33 +905,33 @@
assertEquals("plugins/F", tasks[0].getRuntimeConfigurableWrapper().getAttributeMap().get("dir"));
}

public static class TestQualifierDirector extends BuildDirector {

Check warning on line 908 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
public TestQualifierDirector() {
super();

Check warning on line 910 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
setGenerateVersionSuffix(true);

Check warning on line 911 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
setWorkingDirectory("foo");

Check warning on line 912 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
}

public String getQualifierSuffix(BuildTimeFeature feature) throws CoreException {

Check warning on line 915 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
return super.generateFeatureVersionSuffix(feature);

Check warning on line 916 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
}
}

@Test
public void testQualifierSuffixes() throws Exception {
BuildTimeFeature f1 = new BuildTimeFeature("foo", "1.0.0.v1");

Check warning on line 922 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
f1.addEntry(new FeatureEntry("a", "1.2.3.aaa-0z-aaa", true));

Check warning on line 923 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
f1.setContextQualifierLength(2);

Check warning on line 924 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:

BuildTimeFeature f2 = new BuildTimeFeature("foo", "1.0.0.v1");

Check warning on line 926 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
f2.addEntry(new FeatureEntry("a", "1.2.3.aaa-10-aaa", true));

Check warning on line 927 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
f2.setContextQualifierLength(2);

Check warning on line 928 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:

TestQualifierDirector director = new TestQualifierDirector();
assertTrue(director.getQualifierSuffix(f1).compareTo(director.getQualifierSuffix(f2)) < 0);

f1 = new BuildTimeFeature("foo", "1.0.0.v1");

Check warning on line 933 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
f1.addEntry(new FeatureEntry("a", "1.2.3.abcd", true));

Check warning on line 934 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ScriptGenerationTests.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
f1.setContextQualifierLength(2);

f2 = new BuildTimeFeature("foo", "1.0.0.v1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*******************************************************************************/
package org.eclipse.pde.build.internal.tests;

import static org.junit.Assume.assumeTrue;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
Expand Down Expand Up @@ -51,10 +53,10 @@
import org.eclipse.equinox.frameworkadmin.BundleInfo;
import org.eclipse.equinox.simpleconfigurator.manipulator.SimpleConfiguratorManipulator;
import org.eclipse.pde.build.tests.Activator;
import org.eclipse.pde.internal.build.AbstractScriptGenerator;

Check warning on line 56 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
import org.eclipse.pde.internal.build.BundleHelper;

Check warning on line 57 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
import org.eclipse.pde.internal.build.FeatureGenerator;

Check warning on line 58 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
import org.eclipse.pde.internal.build.site.BuildTimeSiteFactory;

Check warning on line 59 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:

public class Utils {
private static final String ID = "id";
Expand Down Expand Up @@ -189,24 +191,24 @@
static public void generateFeature(IFolder workingDirectory, String id, String[] featureList, String[] pluginList,
String product, boolean includeLaunchers, boolean verify, String version)
throws CoreException, IOException {
FeatureGenerator generator = new FeatureGenerator();

Check warning on line 194 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
if (verify) {
AbstractScriptGenerator.setConfigInfo("*,*,*");

Check warning on line 196 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
String baseLocation = Platform.getInstallLocation().getURL().getPath();
BuildTimeSiteFactory.setInstalledBaseSite(baseLocation);

Check warning on line 198 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
File executable = findExecutable();
if (executable != null && !executable.equals(new File(baseLocation)))
generator.setPluginPath(new String[] { executable.getAbsolutePath() });

Check warning on line 201 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
}
generator.setIncludeLaunchers(includeLaunchers);

Check warning on line 203 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
generator.setVerify(verify);

Check warning on line 204 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
generator.setFeatureId(id);

Check warning on line 205 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
generator.setVersion(version);

Check warning on line 206 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
generator.setProductFile(product);

Check warning on line 207 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
generator.setFeatureList(featureList);

Check warning on line 208 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
generator.setPluginList(pluginList);

Check warning on line 209 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
generator.setWorkingDirectory(workingDirectory.getLocation().toOSString());

Check warning on line 210 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
generator.generate();

Check warning on line 211 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
}

static public void generateProduct(IFile productFile, String id, String version, String[] entryList,
Expand Down Expand Up @@ -265,7 +267,7 @@
if (features) {
buffer.append(" <features>\n");
for (String element : entryList) {
Map<String, Object> items = org.eclipse.pde.internal.build.Utils.parseExtraBundlesString(element,

Check warning on line 270 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
false);
buffer.append(" <feature id=\"");
buffer.append(items.get(ID));
Expand All @@ -281,7 +283,7 @@
} else {
buffer.append(" <plugins>\n");
for (String element : entryList) {
Map<String, Object> items = org.eclipse.pde.internal.build.Utils.parseExtraBundlesString(element,

Check warning on line 286 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
false);
buffer.append(" <plugin id=\"");
buffer.append(items.get(ID));
Expand Down Expand Up @@ -352,11 +354,11 @@
if (executableLocation != null)
return executableLocation;

SimpleConfiguratorManipulator manipulator = BundleHelper.getDefault()

Check warning on line 357 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
.acquireService(SimpleConfiguratorManipulator.class);

Check warning on line 358 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
if (manipulator != null) {
BundleInfo[] bundles = manipulator
.loadConfiguration(BundleHelper.getDefault().getBundle().getBundleContext(), null);

Check warning on line 361 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
// find a fragment for a platform we aren't
String id = "org.eclipse.equinox.launcher.win32.win32.x86_64";
for (BundleInfo bundle : bundles) {
Expand All @@ -377,7 +379,10 @@
// Eclipse.app/Contents/Eclipse).
baseLocation = baseLocation.getParentFile().getParentFile();
}
executableLocation = findExecutable(new File(baseLocation.getParent(), "deltapack/eclipse"));
File fallback = new File(baseLocation.getParent(), "deltapack/eclipse");
executableLocation = findExecutable(fallback);
assumeTrue("All attempts to find the executable failed including fallback to " + fallback.getAbsolutePath(),
executableLocation != null);
return executableLocation;
}

Expand Down Expand Up @@ -490,14 +495,14 @@
jar = new JarFile(location.toFile());
return jar.getManifest();
} finally {
org.eclipse.pde.internal.build.Utils.close(jar);

Check warning on line 498 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
}
} else if (location.lastSegment().equalsIgnoreCase("MANIFEST.MF")) {
InputStream stream = new FileInputStream(location.toFile());
try {
return new Manifest(stream);
} finally {
org.eclipse.pde.internal.build.Utils.close(stream);

Check warning on line 505 in build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

View check run for this annotation

Jenkins - eclipse-pde / Java Compiler

tycho-compiler:compile

NORMAL:
}
}
return null;
Expand Down
Loading