aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-12-28 06:08:16 -0500
committerAlexander Kurtakov2017-12-28 06:08:16 -0500
commit81e2a2a42c0b9e107dc7d4c16c57f528f18ea520 (patch)
tree5f31228f0a0f88602e485cf263c694c43a3e55a7
parentfe66d24b3775198fe09118ca6ac5d89d2d5a638f (diff)
downloadeclipse.pde.build-81e2a2a42c0b9e107dc7d4c16c57f528f18ea520.zip
eclipse.pde.build-81e2a2a42c0b9e107dc7d4c16c57f528f18ea520.tar.gz
eclipse.pde.build-81e2a2a42c0b9e107dc7d4c16c57f528f18ea520.tar.xz
Bug 528899 - testDirectorLogging fails on all platforms
Rename methods and variables to state executable and not delta or deltaPack as support for these is long gone. Also removed wrong comments stating that delta pack has to be installed for some tests to be run. Change-Id: I07af683b1a902d0606254c4accfcd35902e1a6f9 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/AssembleTests.java165
-rw-r--r--org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ProductTests.java249
-rw-r--r--org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java41
-rw-r--r--org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java409
-rw-r--r--org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java600
5 files changed, 770 insertions, 694 deletions
diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/AssembleTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/AssembleTests.java
index 95c91e6..0b34c7a 100644
--- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/AssembleTests.java
+++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/AssembleTests.java
@@ -18,36 +18,33 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.pde.build.tests.BuildConfiguration;
import org.eclipse.pde.build.tests.PDETestCase;
-/**
- * NOTE: To run some of these tests, you must have the delta pack installed in your target. Any
- * test that calls {@link Utils#findDeltaPack()} will fail without the delta pack being available
- */
public class AssembleTests extends PDETestCase {
public static Test suite() {
TestSuite suite = new TestSuite(AssembleTests.class.getName());
- //add all the normal tests
+ // add all the normal tests
suite.addTestSuite(AssembleTests.class);
- //If running the intermittent tests:
- // if (System.getProperties().get("pde.build.intermittent") != null) {
- // }
+ // If running the intermittent tests:
+ // if (System.getProperties().get("pde.build.intermittent") != null) {
+ // }
return suite;
}
public void testCustomAssembly() throws Exception {
IFolder buildFolder = newTest("customAssembly");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
- Utils.generateFeature(buildFolder, "sdk", null, new String[] {"org.eclipse.swt;unpack=\"false\"", "org.eclipse.swt.win32.win32.x86;unpack=\"false\";os=\"win32\";ws=\"win32\";arch=\"x86\""});
+ Utils.generateFeature(buildFolder, "sdk", null, new String[] { "org.eclipse.swt;unpack=\"false\"",
+ "org.eclipse.swt.win32.win32.x86;unpack=\"false\";os=\"win32\";ws=\"win32\";arch=\"x86\"" });
Properties buildProperties = BuildConfiguration.getBuilderProperties(buildFolder);
buildProperties.put("topLevelElementId", "sdk");
- if (!delta.equals(new File((String) buildProperties.get("baseLocation"))))
- buildProperties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) buildProperties.get("baseLocation"))))
+ buildProperties.put("pluginPath", executable.getAbsolutePath());
buildProperties.put("configs", "win32, win32, x86");
Utils.storeBuildProperties(buildFolder, buildProperties);
@@ -55,22 +52,29 @@ public class AssembleTests extends PDETestCase {
runBuild(buildFolder);
String buildLocation = buildFolder.getLocation().toOSString();
- String[] log = new String[] {"post.gather.bin.parts", "eclipse.base: " + buildLocation + "/tmp/eclipse", "post.jarUp", "plugins: " + buildLocation + "/tmp/eclipse/plugins", "features: " + buildLocation + "/tmp/eclipse/features", "pre.archive", "rootFolder: " + buildLocation + "/tmp/eclipse/win32.win32.x86/eclipse", "archiveFullPath: " + buildLocation + "/I.TestBuild/eclipse-win32.win32.x86.zip"};
+ String[] log = new String[] { "post.gather.bin.parts", "eclipse.base: " + buildLocation + "/tmp/eclipse",
+ "post.jarUp", "plugins: " + buildLocation + "/tmp/eclipse/plugins",
+ "features: " + buildLocation + "/tmp/eclipse/features", "pre.archive",
+ "rootFolder: " + buildLocation + "/tmp/eclipse/win32.win32.x86/eclipse",
+ "archiveFullPath: " + buildLocation + "/I.TestBuild/eclipse-win32.win32.x86.zip" };
assertLogContainsLines(buildFolder.getFile("log.log"), log);
}
public void testBug179612_default() throws Exception {
IFolder buildFolder = newTest("179612");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
- Utils.generateFeature(buildFolder, "sdk", null, new String[] {"org.eclipse.swt;unpack=\"false\"", "org.eclipse.swt.win32.win32.x86;unpack=\"false\";os=\"win32\";ws=\"win32\";arch=\"x86\"", "org.eclipse.swt.gtk.linux.x86;unpack=\"false\";os=\"linux\";ws=\"gtk\";arch=\"x86\""});
+ Utils.generateFeature(buildFolder, "sdk", null,
+ new String[] { "org.eclipse.swt;unpack=\"false\"",
+ "org.eclipse.swt.win32.win32.x86;unpack=\"false\";os=\"win32\";ws=\"win32\";arch=\"x86\"",
+ "org.eclipse.swt.gtk.linux.x86;unpack=\"false\";os=\"linux\";ws=\"gtk\";arch=\"x86\"" });
Properties buildProperties = BuildConfiguration.getBuilderProperties(buildFolder);
buildProperties.put("topLevelElementId", "sdk");
- if (!delta.equals(new File((String) buildProperties.get("baseLocation"))))
- buildProperties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) buildProperties.get("baseLocation"))))
+ buildProperties.put("pluginPath", executable.getAbsolutePath());
buildProperties.put("configs", "*,*,* & win32, win32, x86 & linux, gtk, x86");
Utils.storeBuildProperties(buildFolder, buildProperties);
@@ -83,25 +87,30 @@ public class AssembleTests extends PDETestCase {
}
public void testBug179612_custom() throws Exception {
- //we have a custom allElements.xml coming from the resources folder
+ // we have a custom allElements.xml coming from the resources folder
IFolder buildFolder = newTest("179612_custom");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
- Utils.generateFeature(buildFolder, "sdk", null, new String[] {"org.eclipse.swt;unpack=\"false\"", "org.eclipse.swt.win32.win32.x86;unpack=\"false\";os=\"win32\";ws=\"win32\";arch=\"x86\"", "org.eclipse.swt.gtk.linux.x86;unpack=\"false\";os=\"linux\";ws=\"gtk\";arch=\"x86\""});
+ Utils.generateFeature(buildFolder, "sdk", null,
+ new String[] { "org.eclipse.swt;unpack=\"false\"",
+ "org.eclipse.swt.win32.win32.x86;unpack=\"false\";os=\"win32\";ws=\"win32\";arch=\"x86\"",
+ "org.eclipse.swt.gtk.linux.x86;unpack=\"false\";os=\"linux\";ws=\"gtk\";arch=\"x86\"" });
Properties buildProperties = BuildConfiguration.getBuilderProperties(buildFolder);
buildProperties.put("topLevelElementId", "sdk");
- if (!delta.equals(new File((String) buildProperties.get("baseLocation"))))
- buildProperties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) buildProperties.get("baseLocation"))))
+ buildProperties.put("pluginPath", executable.getAbsolutePath());
buildProperties.put("configs", "*,*,* & win32, win32, x86 & linux, gtk, x86");
Utils.storeBuildProperties(buildFolder, buildProperties);
runBuild(buildFolder);
- String[] log = new String[] {"preAssemble", "defaultAssemble", "assemble.sdk.win32.win32.x86", "defaultAssemble", "postAssemble", "prePackage", "defaultAssemble", "assemble.sdk.win32.win32.x86", "defaultAssemble", "postPackage"};
+ String[] log = new String[] { "preAssemble", "defaultAssemble", "assemble.sdk.win32.win32.x86",
+ "defaultAssemble", "postAssemble", "prePackage", "defaultAssemble", "assemble.sdk.win32.win32.x86",
+ "defaultAssemble", "postPackage" };
assertLogContainsLines(buildFolder.getFile("log.log"), log);
assertResourceFile(buildFolder, "I.TestBuild/sdk-TestBuild.zip");
@@ -112,17 +121,19 @@ public class AssembleTests extends PDETestCase {
public void testBug196754() throws Exception {
IFolder buildFolder = newTest("196754");
- // pde.build and equinox.launcher.win32.win32.x86 exist as signed folders in the base location,
+ // pde.build and equinox.launcher.win32.win32.x86 exist as signed folders in the
+ // base location,
// jar them up in the build and assert they still verify
- Utils.generateFeature(buildFolder, "sdk", null, new String[] {"org.eclipse.pde.build;unpack=\"false\"", "org.eclipse.equinox.launcher.win32.win32.x86;unpack=\"false\""});
+ Utils.generateFeature(buildFolder, "sdk", null, new String[] { "org.eclipse.pde.build;unpack=\"false\"",
+ "org.eclipse.equinox.launcher.win32.win32.x86;unpack=\"false\"" });
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
Properties buildProperties = BuildConfiguration.getBuilderProperties(buildFolder);
buildProperties.put("archivesFormat", "*, *, * - folder");
- if (!delta.equals(new File((String) buildProperties.get("baseLocation"))))
- buildProperties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) buildProperties.get("baseLocation"))))
+ buildProperties.put("pluginPath", executable.getAbsolutePath());
Utils.storeBuildProperties(buildFolder, buildProperties);
Utils.generateAllElements(buildFolder, "sdk");
@@ -138,15 +149,18 @@ public class AssembleTests extends PDETestCase {
public void testBug211605() throws Exception {
IFolder buildFolder = newTest("211605");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
- Utils.generateFeature(buildFolder, "sdk", null, new String[] {"org.eclipse.swt;unpack=\"false\"", "org.eclipse.swt.win32.win32.x86;unpack=\"false\";os=\"win32\";ws=\"win32\";arch=\"x86\"", "org.eclipse.swt.gtk.linux.x86;unpack=\"false\";os=\"linux\";ws=\"gtk\";arch=\"x86\""});
+ Utils.generateFeature(buildFolder, "sdk", null,
+ new String[] { "org.eclipse.swt;unpack=\"false\"",
+ "org.eclipse.swt.win32.win32.x86;unpack=\"false\";os=\"win32\";ws=\"win32\";arch=\"x86\"",
+ "org.eclipse.swt.gtk.linux.x86;unpack=\"false\";os=\"linux\";ws=\"gtk\";arch=\"x86\"" });
Properties buildProperties = BuildConfiguration.getBuilderProperties(buildFolder);
buildProperties.put("topLevelElementId", "sdk");
- if (!delta.equals(new File((String) buildProperties.get("baseLocation"))))
- buildProperties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) buildProperties.get("baseLocation"))))
+ buildProperties.put("pluginPath", executable.getAbsolutePath());
buildProperties.put("configs", "win32, win32, x86 & linux, gtk, x86");
buildProperties.put("archivesFormat", "group,group,group-folder");
buildProperties.put("groupConfigurations", "true");
@@ -170,7 +184,7 @@ public class AssembleTests extends PDETestCase {
Utils.generateBundle(b, "B");
b.getFile("build.properties").delete(true, null);
- Utils.generateFeature(buildFolder, "F", null, new String[] {"A;unpack=false", "B"});
+ Utils.generateFeature(buildFolder, "F", null, new String[] { "A;unpack=false", "B" });
Properties buildProperties = BuildConfiguration.getBuilderProperties(buildFolder);
buildProperties.put("topLevelElementId", "F");
@@ -193,79 +207,4 @@ public class AssembleTests extends PDETestCase {
assertResourceFile(buildFolder, "tmp/e4/plugins/A_1.0.0.jar");
assertResourceFile(buildFolder, "tmp/e4/plugins/B_1.0.0/META-INF/MANIFEST.MF");
}
-
- // Test disabled 23 July 2013 as changes to the Equinox framework break the feature dependencies in this test (Bug 411907)
- // public void testPackager_bug315710() throws Exception {
- // IFolder buildFolder = newTest("315710");
- //
- // Utils.generateFeature(buildFolder, "F1", null, new String[] {"org.eclipse.swt;unpack=\"false\""});
- // Utils.generateFeature(buildFolder, "F2", null, new String[] {"org.eclipse.pde;unpack=\"false\""});
- // Utils.writeBuffer(buildFolder.getFile("features/F1/notice.html"), new StringBuffer("be nice to clowns\n"));
- // Utils.writeBuffer(buildFolder.getFile("features/F1/build.properties"), new StringBuffer("bin.includes=feature.xml\nroot=file:notice.html\n"));
- // Utils.writeBuffer(buildFolder.getFile("features/F2/build.properties"), new StringBuffer("bin.includes=feature.xml\n"));
- //
- // StringBuffer customBuffer = new StringBuffer();
- // customBuffer.append("<project name=\"custom\" default=\"noDefault\"> \n");
- // customBuffer.append(" <import file=\"${eclipse.pdebuild.templates}/headless-build/allElements.xml\"/> \n");
- // customBuffer.append(" <target name=\"allElementsDelegator\"> \n");
- // customBuffer.append(" <ant antfile=\"${genericTargets}\" target=\"${target}\"> \n");
- // customBuffer.append(" <property name=\"type\" value=\"feature\" /> \n");
- // customBuffer.append(" <property name=\"id\" value=\"F1\" /> \n");
- // customBuffer.append(" </ant> \n");
- // customBuffer.append(" <ant antfile=\"${genericTargets}\" target=\"${target}\"> \n");
- // customBuffer.append(" <property name=\"type\" value=\"feature\" /> \n");
- // customBuffer.append(" <property name=\"id\" value=\"F2\" /> \n");
- // customBuffer.append(" </ant> \n");
- // customBuffer.append(" </target> \n");
- // customBuffer.append("</project> \n");
- // Utils.writeBuffer(buildFolder.getFile("allElements.xml"), customBuffer);
- //
- // Utils.storeBuildProperties(buildFolder, BuildConfiguration.getBuilderProperties(buildFolder));
- // runBuild(buildFolder);
- //
- // IFile f1zip = buildFolder.getFile("I.TestBuild/F1-TestBuild.zip");
- // IFile f2zip = buildFolder.getFile("I.TestBuild/F2-TestBuild.zip");
- //
- // assertResourceFile(f1zip);
- // assertResourceFile(f2zip);
- //
- // IFolder packageFolder = Utils.createFolder(buildFolder, "packager");
- //
- // Properties properties = new Properties();
- // properties.put("F1-TestBuild.zip", URIUtil.toUnencodedString(buildFolder.getFolder("I.TestBuild").getLocationURI()) + "/|||stuff|components");
- // properties.put("F2-TestBuild.zip", URIUtil.toUnencodedString(buildFolder.getFolder("I.TestBuild").getLocationURI()) + "/|||stuff|other");
- // Utils.storeProperties(packageFolder.getFile("packager.map"), properties);
- //
- // URL templates = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/templates/packager"), null);
- // Utils.copy(new File(FileLocator.toFileURL(templates).getPath()), new File(packageFolder.getLocationURI()));
- // packageFolder.refreshLocal(IResource.DEPTH_INFINITE, null);
- //
- // properties = Utils.loadProperties(packageFolder.getFile("packager.properties"));
- // properties.put("baseDirectory", packageFolder.getLocation().toOSString());
- // properties.put("featureList", "F1, F2");
- // properties.put("componentFilter", "*");
- // properties.put("contentFilter", "");
- // properties.put("packagerMapURL", URIUtil.toUnencodedString(packageFolder.getFile("packager.map").getLocationURI()));
- // properties.put("config", "win32,win32,x86");
- // properties.remove("prefilledTarget");
- // Utils.storeProperties(packageFolder.getFile("packager.properties"), properties);
- //
- // Utils.writeBuffer(packageFolder.getFile("packaging.properties"), new StringBuffer("root=notice.html\n"));
- //
- // URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/scripts/package.xml"), null);
- // String buildXMLPath = FileLocator.toFileURL(resource).getPath();
- // properties.clear();
- // properties.put("packagingInfo", packageFolder.getLocation().toOSString());
- // runAntScript(buildXMLPath, new String[] {"main"}, packageFolder.getLocation().toOSString(), properties);
- //
- // properties = Utils.loadProperties(buildFolder.getFile("finalPluginsVersions.properties"));
- //
- // Set set = new HashSet();
- // set.add("eclipse/notice.html");
- // set.add("eclipse/features/F1_1.0.0/feature.xml");
- // set.add("eclipse/features/F2_1.0.0/feature.xml");
- // set.add("eclipse/plugins/org.eclipse.pde_" + properties.get("org.eclipse.pde") + ".jar");
- // set.add("eclipse/plugins/org.eclipse.swt_" + properties.get("org.eclipse.swt") + ".jar");
- // assertZipContents(packageFolder, "workingPlace/I.MyProduct/MyProduct-win32.win32.win32.zip", set);
- // }
}
diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ProductTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ProductTests.java
index ed40ffd..b354d25 100644
--- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ProductTests.java
+++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/ProductTests.java
@@ -29,21 +29,19 @@ import org.eclipse.pde.internal.build.*;
import org.eclipse.pde.internal.swt.tools.IconExe;
import org.osgi.framework.Version;
-/**
- * NOTE: To run some of these tests, you must have the delta pack installed in your target. Any
- * test that calls {@link Utils#findDeltaPack()} will fail without the delta pack being available
- */
public class ProductTests extends PDETestCase {
public void offBug192127() throws Exception {
IFolder buildFolder = newTest("192127");
IFolder containerFeature = Utils.createFolder(buildFolder, "features/org.eclipse.pde.build.container.feature");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
- // Exporting from the UI gives the container feature some /Eclipse.App root files
- Utils.generateFeature(buildFolder, "org.eclipse.pde.build.container.feature", null, null, "/rcp/rcp.product", true, true, null);
+ // Exporting from the UI gives the container feature some /Eclipse.App root
+ // files
+ Utils.generateFeature(buildFolder, "org.eclipse.pde.build.container.feature", null, null, "/rcp/rcp.product",
+ true, true, null);
Properties featureProperties = new Properties();
featureProperties.put("root", "/temp/");
Utils.storeBuildProperties(containerFeature, featureProperties);
@@ -51,9 +49,10 @@ public class ProductTests extends PDETestCase {
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", "/rcp/rcp.product");
properties.put("configs", "macosx,cocoa,x86_64");
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
- URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/scripts/productBuild/allElements.xml"), null);
+ if (!executable.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executable.getAbsolutePath());
+ URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"),
+ new Path("/scripts/productBuild/allElements.xml"), null);
properties.put("allElementsFile", FileLocator.toFileURL(resource).getPath());
Utils.storeBuildProperties(buildFolder, properties);
@@ -68,25 +67,25 @@ public class ProductTests extends PDETestCase {
entries.add("eclipse/Eclipse.app/");
- //bug 206788 names the archive .zip
+ // bug 206788 names the archive .zip
assertZipContents(buildFolder, "I.TestBuild/eclipse-macosx.cocoa.x86_64.zip", entries, false);
assertTrue(entries.contains("eclipse/Eclipse.app/"));
assertTrue(entries.size() == 1);
}
public void test218878() throws Exception {
- //platform specific config.ini files
- //files copied from resources folder
+ // platform specific config.ini files
+ // files copied from resources folder
IFolder buildFolder = newTest("218878");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", "acme.product");
properties.put("configs", "win32,win32,x86 & linux, gtk, x86");
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executable.getAbsolutePath());
Utils.storeBuildProperties(buildFolder, properties);
runProductBuild(buildFolder);
@@ -98,12 +97,14 @@ public class ProductTests extends PDETestCase {
assertZipContents(buildFolder, "I.TestBuild/eclipse-win32.win32.x86.zip", entries, false);
IFile win32Config = buildFolder.getFile("win32.config.ini");
- Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-win32.win32.x86.zip", "eclipse/configuration/config.ini", win32Config);
+ Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-win32.win32.x86.zip", "eclipse/configuration/config.ini",
+ win32Config);
Properties props = Utils.loadProperties(win32Config);
assertEquals("win32", props.getProperty("os"));
IFile linuxConfig = buildFolder.getFile("linux.config.ini");
- Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-linux.gtk.x86.zip", "eclipse/configuration/config.ini", linuxConfig);
+ Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-linux.gtk.x86.zip", "eclipse/configuration/config.ini",
+ linuxConfig);
props = Utils.loadProperties(linuxConfig);
assertEquals("linux", props.getProperty("os"));
}
@@ -111,22 +112,22 @@ public class ProductTests extends PDETestCase {
public void test234032() throws Exception {
IFolder buildFolder = newTest("234032");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", "test.product");
properties.put("configs", "macosx,cocoa,x86_64");
properties.put("archivesFormat", "macosx,cocoa,x86_64-folder");
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executable.getAbsolutePath());
Utils.storeBuildProperties(buildFolder, properties);
runProductBuild(buildFolder);
IFile iniFile = buildFolder.getFile("tmp/eclipse/test.app/Contents/MacOS/test.ini");
assertLogContainsLine(iniFile, "-Dfoo=bar");
- //bug 313940
+ // bug 313940
assertLogContainsLine(iniFile, "-Dschemes1=archive zip jar");
assertLogContainsLine(iniFile, "-Dschemes2=archive zip jar");
}
@@ -134,15 +135,16 @@ public class ProductTests extends PDETestCase {
public void test237922() throws Exception {
IFolder buildFolder = newTest("237922");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
- Utils.generateFeature(buildFolder, "F", null, new String[] {"rcp"});
+ Utils.generateFeature(buildFolder, "F", null, new String[] { "rcp" });
Properties featureProperties = new Properties();
featureProperties.put("root", "file:myFile.txt");
featureProperties.put("bin.includes", "feature.xml");
Utils.storeBuildProperties(buildFolder.getFolder("features/F"), featureProperties);
- Utils.writeBuffer(buildFolder.getFile("features/F/myFile.txt"), new StringBuffer("Please sir, may I have another?\n"));
+ Utils.writeBuffer(buildFolder.getFile("features/F/myFile.txt"),
+ new StringBuffer("Please sir, may I have another?\n"));
Properties properties = BuildConfiguration.getScriptGenerationProperties(buildFolder, "feature", "F");
properties.put("product", "/rcp/rcp.product");
@@ -162,7 +164,7 @@ public class ProductTests extends PDETestCase {
assertTrue(brand.icons.indexOf("mail.ico") > 0);
- //bug 178928
+ // bug 178928
Target gather = antProject.getTargets().get("gather.bin.parts");
Task[] subTasks = gather.getTasks();
assertEquals(subTasks.length, 2);
@@ -171,21 +173,25 @@ public class ProductTests extends PDETestCase {
public void test186224() throws Exception {
IFolder buildFolder = newTest("186224");
- Utils.generateProduct(buildFolder.getFile("features/foo/foo.product"), null, "1.0.0", null, new String[] {"org.eclipse.osgi"}, false);
+ Utils.generateProduct(buildFolder.getFile("features/foo/foo.product"), null, "1.0.0", null,
+ new String[] { "org.eclipse.osgi" }, false);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", "/foo/foo.product");
properties.put("configs", "win32,win32,x86");
- URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/scripts/productBuild/productBuild.xml"), null);
+ URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"),
+ new Path("/scripts/productBuild/productBuild.xml"), null);
String buildXMLPath = FileLocator.toFileURL(resource).getPath();
- runAntScript(buildXMLPath, new String[] {"generateFeature", "generate"}, buildFolder.getLocation().toOSString(), properties);
+ runAntScript(buildXMLPath, new String[] { "generateFeature", "generate" },
+ buildFolder.getLocation().toOSString(), properties);
}
public void test315792() throws Exception {
IFolder buildFolder = newTest("315792");
- Utils.generateProduct(buildFolder.getFile("features/foo/foo.product"), null, "1.0.0", null, new String[] {"org.eclipse.osgi"}, false);
+ Utils.generateProduct(buildFolder.getFile("features/foo/foo.product"), null, "1.0.0", null,
+ new String[] { "org.eclipse.osgi" }, false);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", "/foo/foo.product");
@@ -194,27 +200,30 @@ public class ProductTests extends PDETestCase {
properties.put("baseLocation", buildFolder.getFolder("base").getLocation().toOSString());
properties.put("pluginPath", Platform.getInstallLocation().getURL().getPath());
- URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/scripts/productBuild/productBuild.xml"), null);
+ URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"),
+ new Path("/scripts/productBuild/productBuild.xml"), null);
String buildXMLPath = FileLocator.toFileURL(resource).getPath();
- runAntScript(buildXMLPath, new String[] {"generateFeature"}, buildFolder.getLocation().toOSString(), properties);
+ runAntScript(buildXMLPath, new String[] { "generateFeature" }, buildFolder.getLocation().toOSString(),
+ properties);
assertLogContainsLine(buildFolder.getFile("log.log"), "[eclipse.generateFeature] Incorrect directory entry");
}
public void test237747() throws Exception {
IFolder buildFolder = newTest("237747");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
IFolder fooFolder = Utils.createFolder(buildFolder, "plugins/foo");
Utils.generateBundle(fooFolder, "foo");
- Utils.generateProduct(buildFolder.getFile("plugins/foo/foo.product"), null, "1.0.0", null, new String[] {"org.eclipse.osgi"}, false);
+ Utils.generateProduct(buildFolder.getFile("plugins/foo/foo.product"), null, "1.0.0", null,
+ new String[] { "org.eclipse.osgi" }, false);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", "/foo/foo.product");
properties.put("configs", "win32,win32,x86_64 & aix, gtk, ppc64");
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executable.getAbsolutePath());
Utils.storeBuildProperties(buildFolder, properties);
runProductBuild(buildFolder);
@@ -226,11 +235,11 @@ public class ProductTests extends PDETestCase {
public void testBug238001() throws Exception {
IFolder buildFolder = newTest("238001");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
FilenameFilter filter = (dir, name) -> name.startsWith("org.eclipse.equinox.executable");
- File[] files = new File(delta, "features").listFiles(filter);
+ File[] files = new File(executable, "features").listFiles(filter);
File win32Exe = new File(files[0], "bin/win32/win32/x86/launcher.exe");
assertTrue(win32Exe.exists());
@@ -242,17 +251,19 @@ public class ProductTests extends PDETestCase {
IFile win64File = buildFolder.getFile("win64.exe");
win64File.create(new BufferedInputStream(new FileInputStream(win64Exe)), IResource.FORCE, null);
- //steal the icons from test 237922
- URL ico = FileLocator.find(Platform.getBundle(Activator.PLUGIN_ID), new Path("/resources/237922/rcp/icons/mail.ico"), null);
+ // steal the icons from test 237922
+ URL ico = FileLocator.find(Platform.getBundle(Activator.PLUGIN_ID),
+ new Path("/resources/237922/rcp/icons/mail.ico"), null);
IFile icoFile = buildFolder.getFile("mail.ico");
icoFile.create(ico.openStream(), IResource.FORCE, null);
- //IconExe prints to stderr, redirect that to a file
+ // IconExe prints to stderr, redirect that to a file
PrintStream oldErr = System.err;
- try (PrintStream newErr = new PrintStream(new FileOutputStream(buildFolder.getLocation().toOSString() + "/out.out"))) {
+ try (PrintStream newErr = new PrintStream(
+ new FileOutputStream(buildFolder.getLocation().toOSString() + "/out.out"))) {
System.setErr(newErr);
- IconExe.main(new String[] {win32File.getLocation().toOSString(), icoFile.getLocation().toOSString()});
- IconExe.main(new String[] {win64File.getLocation().toOSString(), icoFile.getLocation().toOSString()});
+ IconExe.main(new String[] { win32File.getLocation().toOSString(), icoFile.getLocation().toOSString() });
+ IconExe.main(new String[] { win64File.getLocation().toOSString(), icoFile.getLocation().toOSString() });
System.setErr(oldErr);
}
@@ -262,8 +273,8 @@ public class ProductTests extends PDETestCase {
public void testBug249410() throws Exception {
IFolder buildFolder = newTest("249410");
IFile product = buildFolder.getFile("foo.product");
- Utils.generateFeature(buildFolder, "f", null, new String[] {"a", "b", "c", "d"});
- Utils.generateProduct(product, null, "1.0.0", null, new String[] {"f"}, true);
+ Utils.generateFeature(buildFolder, "f", null, new String[] { "a", "b", "c", "d" });
+ Utils.generateProduct(product, null, "1.0.0", null, new String[] { "f" }, true);
AbstractScriptGenerator.setConfigInfo("win32,win32,x86 & linux,gtk,x86");
Config win32 = new Config("win32,win32,x86");
@@ -271,14 +282,18 @@ public class ProductTests extends PDETestCase {
AssemblyInformation assembly = new AssemblyInformation();
StateObjectFactory factory = Platform.getPlatformAdmin().getFactory();
- BundleDescription a = factory.createBundleDescription(1, "a", Version.emptyVersion, null, null, null, null, null, true, true, true, null, null, null, null);
- BundleDescription b = factory.createBundleDescription(2, "b", Version.emptyVersion, null, null, null, null, null, true, true, true, null, null, null, null);
+ BundleDescription a = factory.createBundleDescription(1, "a", Version.emptyVersion, null, null, null, null,
+ null, true, true, true, null, null, null, null);
+ BundleDescription b = factory.createBundleDescription(2, "b", Version.emptyVersion, null, null, null, null,
+ null, true, true, true, null, null, null, null);
assembly.addPlugin(win32, a);
assembly.addPlugin(linux, a);
assembly.addPlugin(win32, b);
assembly.addPlugin(linux, b);
- assembly.addPlugin(linux, factory.createBundleDescription(3, "c", Version.emptyVersion, null, null, null, null, null, true, true, true, "(& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x86))", null, null, null));
- assembly.addPlugin(win32, factory.createBundleDescription(4, "d", Version.emptyVersion, null, null, null, null, null, true, true, true, "(& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86))", null, null, null));
+ assembly.addPlugin(linux, factory.createBundleDescription(3, "c", Version.emptyVersion, null, null, null, null,
+ null, true, true, true, "(& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x86))", null, null, null));
+ assembly.addPlugin(win32, factory.createBundleDescription(4, "d", Version.emptyVersion, null, null, null, null,
+ null, true, true, true, "(& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86))", null, null, null));
ProductGenerator generator = new ProductGenerator();
generator.setAssemblyInfo(assembly);
@@ -287,8 +302,10 @@ public class ProductTests extends PDETestCase {
generator.setProduct(product.getLocation().toOSString());
generator.generate();
- Properties win32Config = Utils.loadProperties(buildFolder.getFile("productRootFiles/win32.win32.x86/configuration/config.ini"));
- Properties linuxConfig = Utils.loadProperties(buildFolder.getFile("productRootFiles/linux.gtk.x86/configuration/config.ini"));
+ Properties win32Config = Utils
+ .loadProperties(buildFolder.getFile("productRootFiles/win32.win32.x86/configuration/config.ini"));
+ Properties linuxConfig = Utils
+ .loadProperties(buildFolder.getFile("productRootFiles/linux.gtk.x86/configuration/config.ini"));
String bundlesList = win32Config.getProperty("osgi.bundles");
assertTrue(bundlesList.indexOf('a') > -1);
@@ -304,11 +321,12 @@ public class ProductTests extends PDETestCase {
public void testBug252246() throws Exception {
IFolder buildFolder = newTest("252246");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
IFile product = buildFolder.getFile("foo.product");
- Utils.generateProduct(product, null, "1.0.0", null, new String[] {"A", "org.eclipse.equinox.simpleconfigurator", "org.eclipse.swt", "org.eclipse.swt.gtk.linux.x86"}, false);
+ Utils.generateProduct(product, null, "1.0.0", null, new String[] { "A",
+ "org.eclipse.equinox.simpleconfigurator", "org.eclipse.swt", "org.eclipse.swt.gtk.linux.x86" }, false);
IFolder A1 = Utils.createFolder(buildFolder, "plugins/A1");
IFolder A2 = Utils.createFolder(buildFolder, "plugins/A2");
@@ -322,42 +340,45 @@ public class ProductTests extends PDETestCase {
properties.put("product", product.getLocation().toOSString());
properties.put("includeLaunchers", "false");
properties.put("configs", "win32,win32,x86 & linux,gtk,x86");
- //properties.put("archivesFormat", "win32,win32,x86-folder");
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
+ // properties.put("archivesFormat", "win32,win32,x86-folder");
+ if (!executable.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executable.getAbsolutePath());
Utils.storeBuildProperties(buildFolder, properties);
runProductBuild(buildFolder);
IFolder tmp = Utils.createFolder(buildFolder, "tmp");
- FileUtils.unzipFile(buildFolder.getFile("I.TestBuild/eclipse-win32.win32.x86.zip").getLocation().toFile(), tmp.getLocation().toFile());
+ FileUtils.unzipFile(buildFolder.getFile("I.TestBuild/eclipse-win32.win32.x86.zip").getLocation().toFile(),
+ tmp.getLocation().toFile());
File file = buildFolder.getFolder("tmp/eclipse/plugins").getLocation().toFile();
String[] a = file.list((dir, name) -> name.startsWith("A_1.0.0.v"));
assertTrue(a.length == 1);
- String bundleString = a[0].substring(0, a[0].length() - 4); //trim .jar
+ String bundleString = a[0].substring(0, a[0].length() - 4); // trim .jar
- //bug 218355
- IFile info = buildFolder.getFile("tmp/eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info");
+ // bug 218355
+ IFile info = buildFolder
+ .getFile("tmp/eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info");
assertLogContainsLine(info, bundleString);
boolean swtNotThere = true;
try {
assertLogContainsLine(info, "org.eclipse.swt.gtk.linux.x86");
swtNotThere = false;
} catch (AssertionFailedError e) {
- //good
+ // good
}
assertTrue(swtNotThere);
IFile gtkInfo = buildFolder.getFile("gtk.info");
- Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-linux.gtk.x86.zip", "eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info", gtkInfo);
+ Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-linux.gtk.x86.zip",
+ "eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info", gtkInfo);
assertLogContainsLine(gtkInfo, "org.eclipse.swt.gtk.linux.x86");
}
public void testBug271373() throws Exception {
IFolder buildFolder = newTest("271373");
- Utils.generateFeature(buildFolder, "F", null, new String[] {"A;os=win32,linux;unpack=false"});
+ Utils.generateFeature(buildFolder, "F", null, new String[] { "A;os=win32,linux;unpack=false" });
IFolder A = Utils.createFolder(buildFolder, "plugins/A");
Attributes manifestAdditions = new Attributes();
@@ -367,7 +388,7 @@ public class ProductTests extends PDETestCase {
Utils.writeBuffer(A.getFile("src/foo.java"), new StringBuffer("public class foo { int i; }"));
IFile product = buildFolder.getFile("foo.product");
- Utils.generateProduct(product, null, "1.0.0", new String[] {"F"}, true);
+ Utils.generateProduct(product, null, "1.0.0", new String[] { "F" }, true);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", product.getLocation().toOSString());
@@ -391,7 +412,7 @@ public class ProductTests extends PDETestCase {
buffer.append(" <plugin id=\"A\" version=\"1.0.0.v1\" /> \n");
buffer.append(" </plugins> \n");
buffer.append(" <configurations> \n");
- buffer.append(" <plugin id=\"A\" autoStart=\"true\" startLevel=\"0\" /> \n"); //bug 274901
+ buffer.append(" <plugin id=\"A\" autoStart=\"true\" startLevel=\"0\" /> \n"); // bug 274901
buffer.append(" </configurations> \n");
buffer.append("</product> \n");
Utils.writeBuffer(product, buffer);
@@ -419,7 +440,7 @@ public class ProductTests extends PDETestCase {
IFolder buildFolder = newTest("246060");
IFile product = buildFolder.getFile("foo.product");
- Utils.generateProduct(product, "foo", null, new String[] {"A", "id", "version"}, false);
+ Utils.generateProduct(product, "foo", null, new String[] { "A", "id", "version" }, false);
StringBuffer buffer = new StringBuffer();
buffer.append("<project name=\"project\" default=\"default\"> \n");
@@ -433,7 +454,8 @@ public class ProductTests extends PDETestCase {
IFile buildXML = buildFolder.getFile("build.xml");
Utils.writeBuffer(buildXML, buffer);
- runAntScript(buildXML.getLocation().toOSString(), new String[] {"default"}, buildFolder.getLocation().toOSString(), null);
+ runAntScript(buildXML.getLocation().toOSString(), new String[] { "default" },
+ buildFolder.getLocation().toOSString(), null);
ProductFile productFile = new ProductFile(product.getLocation().toOSString(), null);
assertEquals(productFile.getVersion(), "1.2.3.va");
@@ -457,7 +479,8 @@ public class ProductTests extends PDETestCase {
buffer.append("</product> \n");
Utils.writeBuffer(product, buffer);
- Utils.generateFeature(buildFolder, "container", null, new String[] {"org.eclipse.osgi", "org.eclipse.equinox.util"});
+ Utils.generateFeature(buildFolder, "container", null,
+ new String[] { "org.eclipse.osgi", "org.eclipse.equinox.util" });
Properties properties = BuildConfiguration.getScriptGenerationProperties(buildFolder, "feature", "container");
properties.put("product", product.getLocation().toOSString());
properties.put("includeLaunchers", "false");
@@ -471,13 +494,20 @@ public class ProductTests extends PDETestCase {
IFile product = buildFolder.getFile("foo.product");
StringBuffer extra = new StringBuffer();
- extra.append("<configurations> \n");
- extra.append(" <plugin id=\"org.eclipse.equinox.app\" autoStart=\"false\" startLevel=\"0\" /> \n");
- extra.append(" <plugin id=\"org.eclipse.equinox.common\" autoStart=\"true\" startLevel=\"1\" /> \n");
- extra.append(" <property name=\"org.eclipse.update.reconcile\" value=\"false\" /> \n");
- extra.append(" <property name=\"osgi.bundles.defaultStartLevel\" value=\"3\" /> \n");
- extra.append("</configurations> \n");
- String[] bundles = new String[] {"org.eclipse.core.runtime", "org.eclipse.equinox.simpleconfigurator", "org.eclipse.equinox.app", "org.eclipse.equinox.common"};
+ extra.append(
+ "<configurations> \n");
+ extra.append(
+ " <plugin id=\"org.eclipse.equinox.app\" autoStart=\"false\" startLevel=\"0\" /> \n");
+ extra.append(
+ " <plugin id=\"org.eclipse.equinox.common\" autoStart=\"true\" startLevel=\"1\" /> \n");
+ extra.append(
+ " <property name=\"org.eclipse.update.reconcile\" value=\"false\" /> \n");
+ extra.append(
+ " <property name=\"osgi.bundles.defaultStartLevel\" value=\"3\" /> \n");
+ extra.append(
+ "</configurations> \n");
+ String[] bundles = new String[] { "org.eclipse.core.runtime", "org.eclipse.equinox.simpleconfigurator",
+ "org.eclipse.equinox.app", "org.eclipse.equinox.common" };
Utils.generateProduct(product, "foo.product", "1.0.0", null, bundles, false, extra);
Utils.generateFeature(buildFolder, "container", null, bundles);
@@ -487,16 +517,21 @@ public class ProductTests extends PDETestCase {
properties.put("configs", "win32,win32,x86");
generateScripts(buildFolder, properties);
- IFile config = buildFolder.getFile("features/container/productRootFiles/win32.win32.x86/configuration/config.ini");
- IFile info = buildFolder.getFile("features/container/productRootFiles/win32.win32.x86/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info");
+ IFile config = buildFolder
+ .getFile("features/container/productRootFiles/win32.win32.x86/configuration/config.ini");
+ IFile info = buildFolder.getFile(
+ "features/container/productRootFiles/win32.win32.x86/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info");
Properties versions = Utils.loadProperties(buildFolder.getFile("finalPluginsVersions.properties"));
assertLogContainsLine(config, "org.eclipse.update.reconcile=false");
assertLogContainsLine(config, "osgi.bundles.defaultStartLevel=3");
assertLogContainsLine(config, "osgi.bundles=org.eclipse.equinox.simpleconfigurator@1:start");
- assertLogContainsLine(info, "org.eclipse.core.runtime_" + versions.get("org.eclipse.core.runtime") + ",3,false");
- assertLogContainsLine(info, "org.eclipse.equinox.app_" + versions.get("org.eclipse.equinox.app") + ",3,false"); //bug 274901
- assertLogContainsLine(info, "org.eclipse.equinox.common_" + versions.get("org.eclipse.equinox.common") + ",1,true");
+ assertLogContainsLine(info,
+ "org.eclipse.core.runtime_" + versions.get("org.eclipse.core.runtime") + ",3,false");
+ assertLogContainsLine(info, "org.eclipse.equinox.app_" + versions.get("org.eclipse.equinox.app") + ",3,false"); // bug
+ // 274901
+ assertLogContainsLine(info,
+ "org.eclipse.equinox.common_" + versions.get("org.eclipse.equinox.common") + ",1,true");
}
public void testBug266056_2() throws Exception {
@@ -505,11 +540,15 @@ public class ProductTests extends PDETestCase {
IFile product = buildFolder.getFile("foo.product");
StringBuffer extra = new StringBuffer();
- extra.append("<configurations> \n");
- extra.append(" <plugin id=\"org.eclipse.equinox.common\" autoStart=\"true\" startLevel=\"-1\" /> \n");
- extra.append(" <property name=\"org.eclipse.update.reconcile\" value=\"false\" /> \n");
- extra.append("</configurations> \n");
- String[] bundles = new String[] {"org.eclipse.core.runtime", "org.eclipse.equinox.common"};
+ extra.append(
+ "<configurations> \n");
+ extra.append(
+ " <plugin id=\"org.eclipse.equinox.common\" autoStart=\"true\" startLevel=\"-1\" /> \n");
+ extra.append(
+ " <property name=\"org.eclipse.update.reconcile\" value=\"false\" /> \n");
+ extra.append(
+ "</configurations> \n");
+ String[] bundles = new String[] { "org.eclipse.core.runtime", "org.eclipse.equinox.common" };
Utils.generateProduct(product, "foo.product", "1.0.0", null, bundles, false, extra);
Utils.generateFeature(buildFolder, "container", null, bundles);
@@ -519,23 +558,26 @@ public class ProductTests extends PDETestCase {
properties.put("configs", "win32,win32,x86");
generateScripts(buildFolder, properties);
- IFile config = buildFolder.getFile("features/container/productRootFiles/win32.win32.x86/configuration/config.ini");
+ IFile config = buildFolder
+ .getFile("features/container/productRootFiles/win32.win32.x86/configuration/config.ini");
assertLogContainsLine(config, "org.eclipse.update.reconcile=false");
- assertLogContainsLines(config, new String[] {"osgi.bundles=org.eclipse.core.runtime,", "org.eclipse.equinox.common@start"});
+ assertLogContainsLines(config,
+ new String[] { "osgi.bundles=org.eclipse.core.runtime,", "org.eclipse.equinox.common@start" });
}
public void testBug269540() throws Exception {
IFolder buildFolder = newTest("269540");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
IFolder a = Utils.createFolder(buildFolder, "plugins/A");
Utils.generateBundle(a, "A");
Attributes manifestAdditions = new Attributes();
- manifestAdditions.put(new Attributes.Name("Eclipse-PlatformFilter"), "(& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86))");
+ manifestAdditions.put(new Attributes.Name("Eclipse-PlatformFilter"),
+ "(& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86))");
Utils.generateBundleManifest(a, "A", "1.0.0", manifestAdditions);
Utils.generatePluginBuildProperties(a, null);
Utils.writeBuffer(a.getFile("src/a.java"), new StringBuffer("class A {}"));
@@ -547,19 +589,20 @@ public class ProductTests extends PDETestCase {
buffer.append(" </win> \n");
buffer.append("</launcher> \n");
IFile product = buildFolder.getFile("foo.product");
- Utils.generateProduct(product, "rcp", "1.0.0", null, "rcp", new String[] {"A"}, false, buffer);
+ Utils.generateProduct(product, "rcp", "1.0.0", null, "rcp", new String[] { "A" }, false, buffer);
- //steal the icons from test 237922
- URL ico = FileLocator.find(Platform.getBundle(Activator.PLUGIN_ID), new Path("/resources/237922/rcp/icons/mail.ico"), null);
+ // steal the icons from test 237922
+ URL ico = FileLocator.find(Platform.getBundle(Activator.PLUGIN_ID),
+ new Path("/resources/237922/rcp/icons/mail.ico"), null);
IFile icoFile = a.getFile("mail.ico");
icoFile.create(ico.openStream(), IResource.FORCE, null);
Properties buildProperties = BuildConfiguration.getBuilderProperties(buildFolder);
buildProperties.put("product", product.getLocation().toOSString());
buildProperties.put("filteredDependencies", "true");
- buildProperties.put("pluginPath", delta.getAbsolutePath());
+ buildProperties.put("pluginPath", executable.getAbsolutePath());
buildProperties.put("configs", "win32, win32, x86");
- //buildProperties.put("archivesFormat", "win32,win32,x86 - folder");
+ // buildProperties.put("archivesFormat", "win32,win32,x86 - folder");
Utils.storeBuildProperties(buildFolder, buildProperties);
diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java
index 057632a..805ac19 100644
--- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java
+++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java
@@ -168,9 +168,9 @@ public class Utils {
AbstractScriptGenerator.setConfigInfo("*,*,*");
String baseLocation = Platform.getInstallLocation().getURL().getPath();
BuildTimeSiteFactory.setInstalledBaseSite(baseLocation);
- File delta = findDeltaPack();
- if (delta != null && !delta.equals(new File(baseLocation)))
- generator.setPluginPath(new String[] { delta.getAbsolutePath() });
+ File executable = findExecutable();
+ if (executable != null && !executable.equals(new File(baseLocation)))
+ generator.setPluginPath(new String[] { executable.getAbsolutePath() });
}
generator.setIncludeLaunchers(includeLaunchers);
generator.setVerify(verify);
@@ -305,26 +305,26 @@ public class Utils {
}
private static File findExecutable(File baseLocation) {
- File plugins = new File(baseLocation, "features");
+ File features = new File(baseLocation, "features");
FilenameFilter filter = (dir, name) -> name.startsWith("org.eclipse.equinox.executable");
- String[] files = plugins.list(filter);
+ String[] files = features.list(filter);
if (files != null && files.length > 0)
return baseLocation;
return null;
}
- static private File deltaLocation = null;
+ static private File executableLocation = null;
- public static File findDeltaPack() throws IOException {
- if (deltaLocation != null)
- return deltaLocation;
+ public static File findExecutable() throws IOException {
+ if (executableLocation != null)
+ return executableLocation;
File baseLocation = new File(Platform.getInstallLocation().getURL().getPath());
- deltaLocation = findExecutable(baseLocation);
- if (deltaLocation != null)
- return deltaLocation;
+ executableLocation = findExecutable(baseLocation);
+ if (executableLocation != null)
+ return executableLocation;
SimpleConfiguratorManipulator manipulator = BundleHelper.getDefault()
.acquireService(SimpleConfiguratorManipulator.class);
@@ -337,23 +337,14 @@ public class Utils {
for (int i = 0; i < bundles.length; i++) {
if (bundles[i].getSymbolicName().equals(id)) {
URI location = bundles[i].getLocation();
- deltaLocation = findExecutable(URIUtil.toFile(URIUtil.append(location, "../..")));
- if (deltaLocation != null)
- return deltaLocation;
+ executableLocation = findExecutable(URIUtil.toFile(URIUtil.append(location, "../..")));
+ if (executableLocation != null)
+ return executableLocation;
break;
}
}
}
-
- if (Platform.OS_MACOSX.equals(Platform.getOS())) {
- // After https://bugs.eclipse.org/431116 and related changes, the install
- // location on the Mac
- // moved down two directories (from <folder-containing-Eclipse.app> to
- // Eclipse.app/Contents/Eclipse).
- baseLocation = baseLocation.getParentFile().getParentFile();
- }
- deltaLocation = findExecutable(new File(baseLocation.getParent(), "deltapack/eclipse"));
- return deltaLocation;
+ return executableLocation;
}
public static void writeBuffer(IFile outputFile, StringBuffer buffer) throws IOException, CoreException {
diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java
index ded1dbf..2c145d5 100644
--- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java
+++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java
@@ -38,8 +38,8 @@ public class P2Tests extends P2TestCase {
IFolder buildFolder = newTest("p2.SimpleProduct");
IFolder repo = Utils.createFolder(buildFolder, "repo");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
String os = Platform.getOS();
String ws = Platform.getWS();
@@ -48,8 +48,8 @@ public class P2Tests extends P2TestCase {
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", "/test/test.product");
properties.put("configs", os + ',' + ws + ',' + arch);
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executable.getAbsolutePath());
String repoLocation = "file:" + repo.getLocation().toOSString();
properties.put("generate.p2.metadata", "true");
@@ -66,14 +66,14 @@ public class P2Tests extends P2TestCase {
IMetadataRepository repository = loadMetadataRepository(repoLocation);
assertNotNull(repository);
- //some basic existance
+ // some basic existance
ArrayList<IInstallableUnit> ius = new ArrayList<>();
ius.add(getIU(repository, "test"));
ius.add(getIU(repository, "org.eclipse.equinox.launcher"));
ius.add(getIU(repository, OSGI));
ius.add(getIU(repository, CORE_RUNTIME));
- //check some start level info
+ // check some start level info
IInstallableUnit iu = getIU(repository, "tooling" + p2Config + CORE_RUNTIME);
assertTouchpoint(iu, "configure", "markStarted(started: true);");
ius.add(iu);
@@ -82,32 +82,35 @@ public class P2Tests extends P2TestCase {
assertTouchpoint(iu, "configure", "setStartLevel(startLevel:2);markStarted(started: true);");
ius.add(iu);
- //product settings
+ // product settings
getIU(repository, "toolingtest.product.ini." + p2Config);
iu = getIU(repository, "toolingtest.product.config." + p2Config);
- assertTouchpoint(iu, "configure", "setProgramProperty(propName:eclipse.application,propValue:test.application);");
+ assertTouchpoint(iu, "configure",
+ "setProgramProperty(propName:eclipse.application,propValue:test.application);");
assertTouchpoint(iu, "configure", "setProgramProperty(propName:eclipse.product,propValue:test.product);");
assertProvides(iu, "toolingtest.product", "test.product.config");
- //some launcher stuff
+ // some launcher stuff
iu = getIU(repository, "toolingorg.eclipse.equinox.launcher");
assertTouchpoint(iu, "configure", "addProgramArg(programArg:-startup);addProgramArg(programArg:@artifact);");
ius.add(iu);
iu = getIU(repository, "toolingorg.eclipse.equinox.launcher." + p2Config);
- assertTouchpoint(iu, "configure", "addProgramArg(programArg:--launcher.library);addProgramArg(programArg:@artifact);");
+ assertTouchpoint(iu, "configure",
+ "addProgramArg(programArg:--launcher.library);addProgramArg(programArg:@artifact);");
ius.add(iu);
iu = getIU(repository, "test.product.rootfiles." + p2Config);
assertProvides(iu, "toolingtest.product", "test.product.rootfiles");
- // assertRequires(iu, "org.eclipse.equinox.p2.iu", "org.eclipse.equinox.launcher." + launcherConfig);
+ // assertRequires(iu, "org.eclipse.equinox.p2.iu",
+ // "org.eclipse.equinox.launcher." + launcherConfig);
- //And the main product IU
+ // And the main product IU
iu = getIU(repository, "test.product");
- // assertRequires(iu, "toolingtest.product", "test.product.launcher");
- // assertRequires(iu, "toolingtest.product", "test.product.ini");
- // assertRequires(iu, "toolingtest.product", "test.product.config");
- // assertRequires(iu, ius, true);
+ // assertRequires(iu, "toolingtest.product", "test.product.launcher");
+ // assertRequires(iu, "toolingtest.product", "test.product.ini");
+ // assertRequires(iu, "toolingtest.product", "test.product.config");
+ // assertRequires(iu, ius, true);
if (!Platform.getOS().equals(Platform.OS_MACOSX)) {
iu = getIU(repository, "toolingtest.product.rootfiles." + p2Config);
@@ -123,12 +126,15 @@ public class P2Tests extends P2TestCase {
properties.put("os", os);
properties.put("ws", ws);
properties.put("arch", arch);
- properties.put("equinoxLauncherJar", FileLocator.getBundleFile(Platform.getBundle("org.eclipse.equinox.launcher")).getAbsolutePath());
- URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/scripts/genericTargets.xml"), null);
+ properties.put("equinoxLauncherJar",
+ FileLocator.getBundleFile(Platform.getBundle("org.eclipse.equinox.launcher")).getAbsolutePath());
+ URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"),
+ new Path("/scripts/genericTargets.xml"), null);
String buildXMLPath = FileLocator.toFileURL(resource).getPath();
- runAntScript(buildXMLPath, new String[] {"runDirector"}, buildFolder.getLocation().toOSString(), properties);
+ runAntScript(buildXMLPath, new String[] { "runDirector" }, buildFolder.getLocation().toOSString(), properties);
- IFile iniFile = os.equals("macosx") ? installFolder.getFile("Contents/Eclipse/test.ini") : installFolder.getFile("test.ini");
+ IFile iniFile = os.equals("macosx") ? installFolder.getFile("Contents/Eclipse/test.ini")
+ : installFolder.getFile("test.ini");
assertLogContainsLine(iniFile, "-startup");
assertLogContainsLine(iniFile, "--launcher.library");
assertLogContainsLine(iniFile, "-foo");
@@ -138,7 +144,8 @@ public class P2Tests extends P2TestCase {
IFolder buildFolder = newTest("237096");
IFolder repo = Utils.createFolder(buildFolder, "repo");
- Utils.generateFeature(buildFolder, "F", null, new String[] {OSGI + ";unpack=false", CORE_RUNTIME + ";unpack=false"});
+ Utils.generateFeature(buildFolder, "F", null,
+ new String[] { OSGI + ";unpack=false", CORE_RUNTIME + ";unpack=false" });
Properties featureProperties = new Properties();
featureProperties.put("root", "rootfiles");
Utils.storeBuildProperties(buildFolder.getFolder("features/F"), featureProperties);
@@ -182,10 +189,11 @@ public class P2Tests extends P2TestCase {
IFile productFile = buildFolder.getFile("rcp.product");
IFolder repo = Utils.createFolder(buildFolder, "repo");
- Utils.generateProduct(productFile, "rcp.product", "1.0.0.qualifier", new String[] {OSGI, SIMPLE_CONFIGURATOR}, false);
+ Utils.generateProduct(productFile, "rcp.product", "1.0.0.qualifier", new String[] { OSGI, SIMPLE_CONFIGURATOR },
+ false);
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
String repoLocation = "file:" + repo.getLocation().toOSString();
@@ -196,10 +204,11 @@ public class P2Tests extends P2TestCase {
properties.put("p2.artifact.repo", repoLocation);
properties.put("p2.flavor", "tooling");
properties.put("p2.publish.artifacts", "true");
- // properties.put("p2.product.qualifier", "v1234"); //bug 246060 //commented out for bug 297064
+ // properties.put("p2.product.qualifier", "v1234"); //bug 246060 //commented out
+ // for bug 297064
Utils.storeBuildProperties(buildFolder, properties);
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executable.getAbsolutePath());
Utils.storeBuildProperties(buildFolder, properties);
runProductBuild(buildFolder);
@@ -221,8 +230,9 @@ public class P2Tests extends P2TestCase {
iu = getIU(repository, "rcp.product");
assertRequires(iu, requiredIUs, true);
- //check up to the date on the timestamp, don't worry about hours/mins
- assertTrue(PublisherHelper.toOSGiVersion(iu.getVersion()).getQualifier().startsWith(QualifierReplacer.getDateQualifier().substring(0, 8)));
+ // check up to the date on the timestamp, don't worry about hours/mins
+ assertTrue(PublisherHelper.toOSGiVersion(iu.getVersion()).getQualifier()
+ .startsWith(QualifierReplacer.getDateQualifier().substring(0, 8)));
IFolder installFolder = buildFolder.getFolder("install");
properties.put("p2.director.installPath", installFolder.getLocation().toOSString());
@@ -231,20 +241,24 @@ public class P2Tests extends P2TestCase {
properties.put("os", "win32");
properties.put("ws", "win32");
properties.put("arch", "x86");
- properties.put("equinoxLauncherJar", FileLocator.getBundleFile(Platform.getBundle("org.eclipse.equinox.launcher")).getAbsolutePath());
- URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/scripts/genericTargets.xml"), null);
+ properties.put("equinoxLauncherJar",
+ FileLocator.getBundleFile(Platform.getBundle("org.eclipse.equinox.launcher")).getAbsolutePath());
+ URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"),
+ new Path("/scripts/genericTargets.xml"), null);
String buildXMLPath = FileLocator.toFileURL(resource).getPath();
- runAntScript(buildXMLPath, new String[] {"runDirector"}, buildFolder.getLocation().toOSString(), properties);
+ runAntScript(buildXMLPath, new String[] { "runDirector" }, buildFolder.getLocation().toOSString(), properties);
assertResourceFile(installFolder, "eclipse.exe");
- assertLogContainsLine(installFolder.getFile("configuration/config.ini"), "org.eclipse.equinox.simpleconfigurator.configUrl=file\\:org.eclipse.equinox.simpleconfigurator");
+ assertLogContainsLine(installFolder.getFile("configuration/config.ini"),
+ "org.eclipse.equinox.simpleconfigurator.configUrl=file\\:org.eclipse.equinox.simpleconfigurator");
}
public void testBug222962_305837() throws Exception {
IFolder buildFolder = newTest("222962");
IFolder repo = Utils.createFolder(buildFolder, "repo");
- Utils.generateFeature(buildFolder, "F", null, new String[] {OSGI + ";unpack=false", CORE_RUNTIME + ";unpack=false"});
+ Utils.generateFeature(buildFolder, "F", null,
+ new String[] { OSGI + ";unpack=false", CORE_RUNTIME + ";unpack=false" });
Properties featureProperties = new Properties();
featureProperties.put("bin.includes", "feature.xml");
Utils.storeProperties(buildFolder.getFile("features/F/build.properties"), featureProperties);
@@ -291,16 +305,17 @@ public class P2Tests extends P2TestCase {
IFolder repo = Utils.createFolder(buildFolder, "repo");
IFile productFile = buildFolder.getFile("rcp.product");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
- Utils.generateProduct(productFile, "rcp.product", "1.0.0", new String[] {OSGI, CORE_RUNTIME, SIMPLE_CONFIGURATOR, EQUINOX_PREFERENCES}, false);
+ Utils.generateProduct(productFile, "rcp.product", "1.0.0",
+ new String[] { OSGI, CORE_RUNTIME, SIMPLE_CONFIGURATOR, EQUINOX_PREFERENCES }, false);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", productFile.getLocation().toOSString());
properties.put("configs", Platform.getOS() + ',' + Platform.getWS() + ',' + Platform.getOSArch());
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executable.getAbsolutePath());
String repoLocation = "file:" + repo.getLocation().toOSString();
properties.put("generate.p2.metadata", "true");
properties.put("p2.metadata.repo", repoLocation);
@@ -321,11 +336,11 @@ public class P2Tests extends P2TestCase {
boolean fail = false;
try {
- //bug 270524
+ // bug 270524
getIU(repository, "tooling" + p2Config + EQUINOX_PREFERENCES);
fail = true;
} catch (AssertionFailedError e) {
- //expected
+ // expected
}
if (fail)
fail("Unexpected CU found");
@@ -336,7 +351,8 @@ public class P2Tests extends P2TestCase {
IFolder repo = Utils.createFolder(buildFolder, "repo");
IFile productFile = buildFolder.getFile("rcp.product");
- Utils.generateProduct(productFile, "rcp.product", "1.0.0", new String[] {"org.junit", "org.eclipse.pde.build"}, false);
+ Utils.generateProduct(productFile, "rcp.product", "1.0.0",
+ new String[] { "org.junit", "org.eclipse.pde.build" }, false);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", productFile.getLocation().toOSString());
@@ -354,7 +370,8 @@ public class P2Tests extends P2TestCase {
runProductBuild(buildFolder);
File plugins = repo.getFolder("plugins").getLocation().toFile();
- File[] bundles = plugins.listFiles((FilenameFilter) (dir, name) -> name.startsWith("org.junit_") || name.startsWith("org.eclipse.pde.build"));
+ File[] bundles = plugins.listFiles((FilenameFilter) (dir, name) -> name.startsWith("org.junit_")
+ || name.startsWith("org.eclipse.pde.build"));
assertTrue(bundles.length == 2);
assertJarVerifies(bundles[0]);
assertJarVerifies(bundles[1]);
@@ -363,12 +380,13 @@ public class P2Tests extends P2TestCase {
public void testBug258126() throws Exception {
IFolder buildFolder = newTest("258126");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
IFolder repo = Utils.createFolder(buildFolder, "repo");
- Utils.generateFeature(buildFolder, "F", null, new String[] {OSGI + ";unpack=false", CORE_RUNTIME + ";unpack=false"});
+ Utils.generateFeature(buildFolder, "F", null,
+ new String[] { OSGI + ";unpack=false", CORE_RUNTIME + ";unpack=false" });
Properties featureProperties = new Properties();
featureProperties.put("root", "rootfiles");
Utils.storeBuildProperties(buildFolder.getFolder("features/F"), featureProperties);
@@ -376,14 +394,14 @@ public class P2Tests extends P2TestCase {
Utils.writeBuffer(rootFiles.getFile("eclipse.ini"), new StringBuffer("-foo\n-vmargs\n-Xmx540m\n"));
IFile productFile = buildFolder.getFile("rcp.product");
- Utils.generateProduct(productFile, "rcp.product", "1.0.0", new String[] {"F"}, true);
+ Utils.generateProduct(productFile, "rcp.product", "1.0.0", new String[] { "F" }, true);
String repoLocation = "file:" + repo.getLocation().toOSString();
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", productFile.getLocation().toOSString());
properties.put("configs", "win32,win32,x86");
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executable.getAbsolutePath());
properties.put("archivesFormat", "win32,win32,x86-folder");
properties.put("generate.p2.metadata", "true");
@@ -411,11 +429,12 @@ public class P2Tests extends P2TestCase {
IFolder buildFolder = newTest("262421");
IFile productFile = buildFolder.getFile("rcp.product");
- Utils.generateProduct(productFile, "rcp.product", "1.0.0", new String[] {OSGI}, false);
+ Utils.generateProduct(productFile, "rcp.product", "1.0.0", new String[] { OSGI }, false);
IFile p2Inf = buildFolder.getFile("p2.inf");
StringBuffer buffer = new StringBuffer();
- buffer.append("instructions.configure=addRepository(type:0,location:http${#58}//download.eclipse.org/eclipse/updates/3.4);");
+ buffer.append(
+ "instructions.configure=addRepository(type:0,location:http${#58}//download.eclipse.org/eclipse/updates/3.4);");
Utils.writeBuffer(p2Inf, buffer);
IFolder repo = Utils.createFolder(buildFolder, "repo");
@@ -442,7 +461,7 @@ public class P2Tests extends P2TestCase {
IFolder a = Utils.createFolder(buildFolder, "plugins/a");
IFolder b = Utils.createFolder(buildFolder, "plugins/b");
- Utils.generateFeature(buildFolder, "F", null, new String[] {"a;unpack=false", "b;unpack=true"});
+ Utils.generateFeature(buildFolder, "F", null, new String[] { "a;unpack=false", "b;unpack=true" });
Utils.generateBundle(a, "a");
Utils.writeBuffer(a.getFile("src/a.java"), new StringBuffer("class A {}"));
Utils.generateBundle(b, "b");
@@ -463,29 +482,33 @@ public class P2Tests extends P2TestCase {
properties.put("repoBaseLocation", buildFolder.getFolder("repo").getLocation().toOSString());
properties.put("transformedRepoLocation", buildFolder.getFolder("outRepo").getLocation().toOSString());
- URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/scripts/genericTargets.xml"), null);
+ URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"),
+ new Path("/scripts/genericTargets.xml"), null);
String buildXMLPath = FileLocator.toFileURL(resource).getPath();
- runAntScript(buildXMLPath, new String[] {"transformRepos"}, buildFolder.getLocation().toOSString(), properties);
+ runAntScript(buildXMLPath, new String[] { "transformRepos" }, buildFolder.getLocation().toOSString(),
+ properties);
assertResourceFile(buildFolder, "outRepo/plugins/b_1.0.0/B.class");
assertResourceFile(buildFolder, "outRepo/plugins/a_1.0.0.jar");
assertResourceFile(buildFolder, "outRepo/artifacts.jar");
assertResourceFile(buildFolder, "outRepo/content.jar");
- //part 2, zipped repos
+ // part 2, zipped repos
IFolder zipped = Utils.createFolder(buildFolder, "zipped");
- ZipOutputStream output = new ZipOutputStream(new FileOutputStream(new File(zipped.getLocation().toFile(), "zipped repo.zip")));
+ ZipOutputStream output = new ZipOutputStream(
+ new FileOutputStream(new File(zipped.getLocation().toFile(), "zipped repo.zip")));
File root = buildFolder.getFolder("repo/r1").getLocation().toFile();
FileUtils.zip(output, root, Collections.emptySet(), FileUtils.createRootPathComputer(root));
org.eclipse.pde.internal.build.Utils.close(output);
- //bug 318144
+ // bug 318144
Utils.writeBuffer(zipped.getFile(".repo/not.a.repo"), new StringBuffer("I am not a repo"));
IFolder outRepo2 = Utils.createFolder(buildFolder, "outRepo2");
properties.put("repoBaseLocation", zipped.getLocation().toOSString());
properties.put("transformedRepoLocation", outRepo2.getLocation().toOSString());
- runAntScript(buildXMLPath, new String[] {"transformRepos"}, buildFolder.getLocation().toOSString(), properties);
+ runAntScript(buildXMLPath, new String[] { "transformRepos" }, buildFolder.getLocation().toOSString(),
+ properties);
assertResourceFile(outRepo2, "plugins/b_1.0.0/B.class");
assertResourceFile(outRepo2, "plugins/a_1.0.0.jar");
@@ -499,7 +522,7 @@ public class P2Tests extends P2TestCase {
IFolder repo = Utils.createFolder(buildFolder, "repo");
String repoLocation = "file:" + repo.getLocation().toOSString();
- Utils.generateFeature(buildFolder, "F", new String[] {"org.eclipse.cvs"}, null);
+ Utils.generateFeature(buildFolder, "F", new String[] { "org.eclipse.cvs" }, null);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("topLevelElementId", "F");
properties.put("generate.p2.metadata", "true");
@@ -514,14 +537,15 @@ public class P2Tests extends P2TestCase {
IInstallableUnit iu = getIU(metadata, "org.eclipse.cvs");
assertNotNull(iu);
- //bug 289866
+ // bug 289866
StringBuffer buffer = new StringBuffer();
buffer.append("pack.excludes=plugins/org.eclipse.cvs_" + iu.getVersion() + ".jar\n");
Utils.writeBuffer(repo.getFile("pack.properties"), buffer);
assertResourceFile(buildFolder, "repo/artifacts.xml");
- URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build.tests"), new Path("/resources/keystore/keystore"), null);
+ URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build.tests"),
+ new Path("/resources/keystore/keystore"), null);
assertNotNull(resource);
String keystorePath = FileLocator.toFileURL(resource).getPath();
@@ -542,7 +566,8 @@ public class P2Tests extends P2TestCase {
final IFile buildXML = buildFolder.getFile("build.xml");
Utils.writeBuffer(buildXML, buffer);
- runAntScript(buildXML.getLocation().toOSString(), new String[] {"default"}, buildFolder.getLocation().toOSString(), null);
+ runAntScript(buildXML.getLocation().toOSString(), new String[] { "default" },
+ buildFolder.getLocation().toOSString(), null);
IFolder repoFolder = buildFolder.getFolder("repo");
IArtifactRepository repository = loadArtifactRepository(repoLocation);
@@ -561,7 +586,8 @@ public class P2Tests extends P2TestCase {
if (IArtifactDescriptor.FORMAT_PACKED.equals(descriptors[0].getProperty(IArtifactDescriptor.FORMAT))) {
assertMD5(repoFolder, descriptors[1]);
- } else if (IArtifactDescriptor.FORMAT_PACKED.equals(descriptors[1].getProperty(IArtifactDescriptor.FORMAT))) {
+ } else if (IArtifactDescriptor.FORMAT_PACKED
+ .equals(descriptors[1].getProperty(IArtifactDescriptor.FORMAT))) {
assertMD5(repoFolder, descriptors[0]);
} else {
fail("No pack.gz desriptor");
@@ -596,7 +622,8 @@ public class P2Tests extends P2TestCase {
IFolder b = Utils.createFolder(buildFolder, "plugins/b");
IFolder c = Utils.createFolder(buildFolder, "plugins/c");
- Utils.generateFeature(buildFolder, "F", null, new String[] {"a;unpack=false", "b;unpack=false;os=linux", "b;unpack=false;os=win32", "c;unpack=false"});
+ Utils.generateFeature(buildFolder, "F", null, new String[] { "a;unpack=false", "b;unpack=false;os=linux",
+ "b;unpack=false;os=win32", "c;unpack=false" });
Properties featureProperties = new Properties();
featureProperties.put("bin.includes", "feature.xml");
Utils.storeProperties(buildFolder.getFile("features/F/build.properties"), featureProperties);
@@ -644,13 +671,14 @@ public class P2Tests extends P2TestCase {
properties.put("p2.publish.artifacts", "true");
properties.put("forceContextQualifier", "v1");
properties.put("baseLocation", "");
- properties.put("pluginPath", "${buildDirectory}"); //178449
+ properties.put("pluginPath", "${buildDirectory}"); // 178449
Utils.storeBuildProperties(buildFolder, properties);
runBuild(buildFolder);
- //now change A and recompile
- Utils.generateFeature(buildFolder, "F", null, new String[] {"a;unpack=true", "b;os=linux;optional=true", "c;unpack=false"});
+ // now change A and recompile
+ Utils.generateFeature(buildFolder, "F", null,
+ new String[] { "a;unpack=true", "b;os=linux;optional=true", "c;unpack=false" });
Utils.storeProperties(buildFolder.getFile("features/F/build.properties"), featureProperties);
code = new StringBuffer();
@@ -670,7 +698,8 @@ public class P2Tests extends P2TestCase {
properties.put("forceContextQualifier", "v2");
Utils.storeBuildProperties(buildFolder, properties);
- //bug 271034 same properties file, touched with new timestamp, perhaps new order
+ // bug 271034 same properties file, touched with new timestamp, perhaps new
+ // order
properties = new Properties();
properties.put("bin.includes", "META-INF/, ., build.properties");
Utils.generatePluginBuildProperties(c, properties);
@@ -685,18 +714,30 @@ public class P2Tests extends P2TestCase {
assertResourceFile(buildFolder, "repo2/plugins/c_1.0.0.jar");
StringBuffer test = new StringBuffer();
- test.append("<project default=\"mirror\"> \n");
- test.append(" <target name=\"mirror\"> \n");
- test.append(" <p2.artifact.mirror baseLine=\"${compareAgainst}\" \n");
- test.append(" source=\"${compareFrom}\" \n");
- test.append(" destination=\"${newLocation}\" \n");
- test.append(" destinationName=\"testRepoName\" \n");
- test.append(" comparatorId=\"org.eclipse.equinox.p2.repository.tools.jar.comparator\" \n");
- test.append(" comparatorLog=\"${basedir}/compare.log\" \n");
- test.append(" ignoreErrors=\"true\" \n");
- test.append(" /> \n");
- test.append(" </target> \n");
- test.append("</project> \n");
+ test.append(
+ "<project default=\"mirror\"> \n");
+ test.append(
+ " <target name=\"mirror\"> \n");
+ test.append(
+ " <p2.artifact.mirror baseLine=\"${compareAgainst}\" \n");
+ test.append(
+ " source=\"${compareFrom}\" \n");
+ test.append(
+ " destination=\"${newLocation}\" \n");
+ test.append(
+ " destinationName=\"testRepoName\" \n");
+ test.append(
+ " comparatorId=\"org.eclipse.equinox.p2.repository.tools.jar.comparator\" \n");
+ test.append(
+ " comparatorLog=\"${basedir}/compare.log\" \n");
+ test.append(
+ " ignoreErrors=\"true\" \n");
+ test.append(
+ " /> \n");
+ test.append(
+ " </target> \n");
+ test.append(
+ "</project> \n");
IFile testXML = buildFolder.getFile("test.xml");
Utils.writeBuffer(testXML, test);
@@ -705,19 +746,25 @@ public class P2Tests extends P2TestCase {
properties.put("compareAgainst", repo1Location);
properties.put("compareFrom", repo2Location);
properties.put("newLocation", finalLocation);
- runAntScript(testXML.getLocation().toOSString(), new String[] {"mirror"}, buildFolder.getLocation().toOSString(), properties);
+ runAntScript(testXML.getLocation().toOSString(), new String[] { "mirror" },
+ buildFolder.getLocation().toOSString(), properties);
IArtifactRepository artifact = loadArtifactRepository(finalLocation);
- assertEquals(artifact.getName(), "testRepoName"); //bug 274094
+ assertEquals(artifact.getName(), "testRepoName"); // bug 274094
assertLogContainsLine(buildFolder.getFile("log.log"), "Messages while mirroring artifact descriptors");
- assertLogContainsLines(buildFolder.getFile("compare.log"), new String[] {"canonical: org.eclipse.update.feature,F,1.0.0", "The feature has a different number of entries", "The entry \"Plugin: a 1.0.0.v2\" is not present in both features", "The entry \"Plugin: b 1.0.0\" has different unpack attribute values"});
- assertLogContainsLines(buildFolder.getFile("compare.log"), new String[] {"canonical: osgi.bundle,b,1.0.0", "The class B.class is different."});
+ assertLogContainsLines(buildFolder.getFile("compare.log"),
+ new String[] { "canonical: org.eclipse.update.feature,F,1.0.0",
+ "The feature has a different number of entries",
+ "The entry \"Plugin: a 1.0.0.v2\" is not present in both features",
+ "The entry \"Plugin: b 1.0.0\" has different unpack attribute values" });
+ assertLogContainsLines(buildFolder.getFile("compare.log"),
+ new String[] { "canonical: osgi.bundle,b,1.0.0", "The class B.class is different." });
boolean failed = true;
try {
assertLogContainsLine(buildFolder.getFile("compare.log"), "build.properties");
failed = false;
} catch (AssertionFailedError e) {
- //expected
+ // expected
}
assertTrue(failed);
}
@@ -734,7 +781,7 @@ public class P2Tests extends P2TestCase {
IFolder a = Utils.createFolder(buildFolder, "plugins/a");
- Utils.generateFeature(buildFolder, "F", null, new String[] {"a;unpack=false"});
+ Utils.generateFeature(buildFolder, "F", null, new String[] { "a;unpack=false" });
Attributes additionalAttributes = new Attributes();
additionalAttributes = new Attributes();
@@ -764,7 +811,7 @@ public class P2Tests extends P2TestCase {
runBuild(buildFolder);
- //now change A and recompile
+ // now change A and recompile
code = new StringBuffer();
code.append("package a; \n");
code.append("public class A { \n");
@@ -787,16 +834,26 @@ public class P2Tests extends P2TestCase {
assertResourceFile(buildFolder, "repo2/plugins/a_1.0.0.jar");
StringBuffer test = new StringBuffer();
- test.append("<project default=\"mirror\"> \n");
- test.append(" <target name=\"mirror\"> \n");
- test.append(" <p2.artifact.mirror baseLine=\"${compareAgainst}\" \n");
- test.append(" source=\"${compareFrom}\" \n");
- test.append(" destination=\"${newLocation}\" \n");
- test.append(" comparatorId=\"org.eclipse.equinox.p2.repository.tools.jar.comparator\" \n");
- test.append(" comparatorLog=\"${basedir}/compare.log\" \n");
- test.append(" /> \n");
- test.append(" </target> \n");
- test.append("</project> \n");
+ test.append(
+ "<project default=\"mirror\"> \n");
+ test.append(
+ " <target name=\"mirror\"> \n");
+ test.append(
+ " <p2.artifact.mirror baseLine=\"${compareAgainst}\" \n");
+ test.append(
+ " source=\"${compareFrom}\" \n");
+ test.append(
+ " destination=\"${newLocation}\" \n");
+ test.append(
+ " comparatorId=\"org.eclipse.equinox.p2.repository.tools.jar.comparator\" \n");
+ test.append(
+ " comparatorLog=\"${basedir}/compare.log\" \n");
+ test.append(
+ " /> \n");
+ test.append(
+ " </target> \n");
+ test.append(
+ "</project> \n");
IFile testXML = buildFolder.getFile("test.xml");
Utils.writeBuffer(testXML, test);
@@ -805,32 +862,34 @@ public class P2Tests extends P2TestCase {
properties.put("compareAgainst", repo1Location);
properties.put("compareFrom", repo2Location);
properties.put("newLocation", finalLocation);
- runAntScript(testXML.getLocation().toOSString(), new String[] {"mirror"}, buildFolder.getLocation().toOSString(), properties);
+ runAntScript(testXML.getLocation().toOSString(), new String[] { "mirror" },
+ buildFolder.getLocation().toOSString(), properties);
boolean warnings = false;
try {
assertLogContainsLine(buildFolder.getFile("log.log"), "Mirroring completed with warnings and/or errors.");
warnings = true;
} catch (AssertionFailedError e) {
- //expected
+ // expected
}
assertFalse(warnings);
}
public void testBug267461() throws Exception {
IFolder buildFolder = newTest("267461");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
IFile productFile = buildFolder.getFile("rcp.product");
IFolder repo = Utils.createFolder(buildFolder, "repo");
- Utils.generateProduct(productFile, "uid.product", "rcp.product", "1.0.0", "my.app", null, new String[] {OSGI, SIMPLE_CONFIGURATOR}, false, null);
+ Utils.generateProduct(productFile, "uid.product", "rcp.product", "1.0.0", "my.app", null,
+ new String[] { OSGI, SIMPLE_CONFIGURATOR }, false, null);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
String repoLocation = "file:" + repo.getLocation().toOSString();
properties.put("configs", "win32,win32,x86");
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executable.getAbsolutePath());
properties.put("product", productFile.getLocation().toOSString());
properties.put("generate.p2.metadata", "true");
properties.put("p2.metadata.repo", repoLocation);
@@ -853,23 +912,35 @@ public class P2Tests extends P2TestCase {
IFolder buildFolder = newTest("304736");
StringBuffer customBuffer = new StringBuffer();
- customBuffer.append("<project name=\"custom\" default=\"noDefault\"> \n");
+ customBuffer
+ .append("<project name=\"custom\" default=\"noDefault\"> \n");
customBuffer.append(" <import file=\"${eclipse.pdebuild.templates}/headless-build/allElements.xml\"/> \n");
- customBuffer.append(" <target name=\"allElementsDelegator\"> \n");
- customBuffer.append(" <ant antfile=\"${genericTargets}\" target=\"${target}\"> \n");
- customBuffer.append(" <property name=\"type\" value=\"feature\" /> \n");
- customBuffer.append(" <property name=\"id\" value=\"F1\" /> \n");
- customBuffer.append(" </ant> \n");
- customBuffer.append(" <ant antfile=\"${genericTargets}\" target=\"${target}\"> \n");
- customBuffer.append(" <property name=\"type\" value=\"feature\" /> \n");
- customBuffer.append(" <property name=\"id\" value=\"F2\" /> \n");
- customBuffer.append(" </ant> \n");
- customBuffer.append(" </target> \n");
- customBuffer.append("</project> \n");
+ customBuffer
+ .append(" <target name=\"allElementsDelegator\"> \n");
+ customBuffer
+ .append(" <ant antfile=\"${genericTargets}\" target=\"${target}\"> \n");
+ customBuffer
+ .append(" <property name=\"type\" value=\"feature\" /> \n");
+ customBuffer
+ .append(" <property name=\"id\" value=\"F1\" /> \n");
+ customBuffer
+ .append(" </ant> \n");
+ customBuffer
+ .append(" <ant antfile=\"${genericTargets}\" target=\"${target}\"> \n");
+ customBuffer
+ .append(" <property name=\"type\" value=\"feature\" /> \n");
+ customBuffer
+ .append(" <property name=\"id\" value=\"F2\" /> \n");
+ customBuffer
+ .append(" </ant> \n");
+ customBuffer
+ .append(" </target> \n");
+ customBuffer
+ .append("</project> \n");
Utils.writeBuffer(buildFolder.getFile("allElements.xml"), customBuffer);
- Utils.generateFeature(buildFolder, "F1", null, new String[] {"A"});
- Utils.generateFeature(buildFolder, "F2", null, new String[] {"B"});
+ Utils.generateFeature(buildFolder, "F1", null, new String[] { "A" });
+ Utils.generateFeature(buildFolder, "F2", null, new String[] { "B" });
IFolder A = Utils.createFolder(buildFolder, "plugins/a");
IFolder B = Utils.createFolder(buildFolder, "plugins/b");
@@ -886,14 +957,15 @@ public class P2Tests extends P2TestCase {
properties.put("p2.publish.artifacts", "false");
Utils.storeBuildProperties(buildFolder, properties);
runBuild(buildFolder);
- //test passes if there was no build failure
+ // test passes if there was no build failure
}
public void testBug271373() throws Exception {
IFolder buildFolder = newTest("271373_generator");
- Utils.generateFeature(buildFolder, "F", null, new String[] {"A;os=win32,linux;unpack=false"});
- Utils.writeBuffer(buildFolder.getFile("features/F/build.properties"), new StringBuffer("bin.includes=feature.xml\n"));
+ Utils.generateFeature(buildFolder, "F", null, new String[] { "A;os=win32,linux;unpack=false" });
+ Utils.writeBuffer(buildFolder.getFile("features/F/build.properties"),
+ new StringBuffer("bin.includes=feature.xml\n"));
IFolder A = Utils.createFolder(buildFolder, "plugins/A");
Attributes manifestAdditions = new Attributes();
@@ -903,7 +975,7 @@ public class P2Tests extends P2TestCase {
Utils.writeBuffer(A.getFile("src/foo.java"), new StringBuffer("public class foo { int i; }"));
IFile product = buildFolder.getFile("foo.product");
- Utils.generateProduct(product, "foo.product", "1.0.0", new String[] {"F"}, true);
+ Utils.generateProduct(product, "foo.product", "1.0.0", new String[] { "F" }, true);
IFolder repo = Utils.createFolder(buildFolder, "repo");
URI repoLocation = repo.getLocationURI();
@@ -929,96 +1001,13 @@ public class P2Tests extends P2TestCase {
properties.put("os", "win32");
properties.put("ws", "win32");
properties.put("arch", "x86");
- properties.put("equinoxLauncherJar", FileLocator.getBundleFile(Platform.getBundle("org.eclipse.equinox.launcher")).getAbsolutePath());
- URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/scripts/genericTargets.xml"), null);
+ properties.put("equinoxLauncherJar",
+ FileLocator.getBundleFile(Platform.getBundle("org.eclipse.equinox.launcher")).getAbsolutePath());
+ URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"),
+ new Path("/scripts/genericTargets.xml"), null);
String buildXMLPath = FileLocator.toFileURL(resource).getPath();
- runAntScript(buildXMLPath, new String[] {"runDirector"}, buildFolder.getLocation().toOSString(), properties);
+ runAntScript(buildXMLPath, new String[] { "runDirector" }, buildFolder.getLocation().toOSString(), properties);
assertResourceFile(installFolder, "plugins/A_1.0.0.jar");
}
-
- // Test disabled and resources deleted 23 July 2013 as the Plugin Converter is no longer available in the SDK (Bug 411907)
- // It isn't clear where the plugin converter is required, but the build log indicates it was unavailable at three different points
- // public void testMetadataGenerator_BootStrap() throws Exception {
- // IFolder testFolder = newTest("metadataGenerator_Bootstrap");
- //
- // File delta = Utils.findDeltaPack();
- // assertNotNull(delta);
- //
- // IFile productFile = testFolder.getFile("Bootstrap.product");
- //
- // //Step one, build old fashioned product
- // IFolder buildFolder = Utils.createFolder(testFolder, "build");
- // Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
- // properties.put("configs", "win32,win32,x86");
- // properties.put("archivesFormat", "win32,win32,x86-folder");
- // if (!delta.equals(new File((String) properties.get("baseLocation"))))
- // properties.put("pluginPath", delta.getAbsolutePath());
- // properties.put("product", productFile.getLocation().toOSString());
- // Utils.storeBuildProperties(buildFolder, properties);
- //
- // runProductBuild(buildFolder);
- //
- // IFolder repoFolder = testFolder.getFolder("repository");
- // IFolder installFolder = testFolder.getFolder("install");
- //
- // //step two, invoke the metadata generator on the product
- // StringBuffer scriptBuffer = new StringBuffer();
- // scriptBuffer.append("<project name=\"project\" default=\"go\"> \n");
- // scriptBuffer.append(" <target name=\"go\"> \n");
- // scriptBuffer.append(" <last id=\"launcher\"> \n");
- // scriptBuffer.append(" <sort> \n");
- // scriptBuffer.append(" <fileset dir=\"${eclipse.home}/plugins\" includes=\"org.eclipse.equinox.launcher_*\" /> \n");
- // scriptBuffer.append(" </sort> \n");
- // scriptBuffer.append(" </last> \n");
- // scriptBuffer.append(" <property name=\"launcher\" refid=\"launcher\" /> \n");
- // scriptBuffer.append(" <condition property=\"p2.director.devMode\" value=\"-dev &quot;${osgi.dev}&quot;\" else=\"\"> \n");
- // scriptBuffer.append(" <isset property=\"osgi.dev\" /> \n");
- // scriptBuffer.append(" </condition> \n");
- // scriptBuffer.append(" <java dir=\"${basedir}\" jar=\"${launcher}\" fork=\"true\"> \n");
- // scriptBuffer.append(" <arg line=\"-application org.eclipse.equinox.p2.publisher.EclipseGenerator\" /> \n");
- // scriptBuffer.append(" <arg line=\"${p2.director.devMode}\" /> \n");
- // scriptBuffer.append(" <sysproperty key=\"osgi.configuration.area\" value=\"${osgi.configuration.area}\" /> \n");
- // scriptBuffer.append(" <arg line=\"-metadataRepositoryName BootStrapRepo\" /> \n");
- // scriptBuffer.append(" <arg value=\"-metadataRepository\" /> \n");
- // scriptBuffer.append(" <arg value=\"" + URIUtil.toUnencodedString(repoFolder.getLocationURI()) + "\" /> \n");
- // scriptBuffer.append(" <arg value=\"-artifactRepository\" /> \n");
- // scriptBuffer.append(" <arg value=\"" + URIUtil.toUnencodedString(repoFolder.getLocationURI()) + "\" /> \n");
- // scriptBuffer.append(" <arg value=\"-source\" /> \n");
- // scriptBuffer.append(" <arg value=\"" + buildFolder.getFolder("tmp/eclipse").getLocation().toOSString() + "\" /> \n");
- // scriptBuffer.append(" <arg line=\"-root bootstrap -rootVersion 1.2.0.12345\" /> \n");
- // scriptBuffer.append(" <arg line=\"-flavor tooling -publishArtifacts -append\" /> \n");
- // //scriptBuffer.append(" <jvmarg line=\"-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000\" /> \n");
- // scriptBuffer.append(" </java> \n");
- //
- // //step three call the director
- // scriptBuffer.append(" <java dir=\"${basedir}\" jar=\"${launcher}\" fork=\"true\"> \n");
- // scriptBuffer.append(" <arg line=\"${p2.director.devMode}\" /> \n");
- // scriptBuffer.append(" <sysproperty key=\"osgi.configuration.area\" value=\"${osgi.configuration.area}\" /> \n");
- // scriptBuffer.append(" <arg line=\"-application org.eclipse.equinox.p2.director\" /> \n");
- // scriptBuffer.append(" <arg value=\"-metadataRepository\" /> \n");
- // scriptBuffer.append(" <arg value=\"" + URIUtil.toUnencodedString(repoFolder.getLocationURI()) + "\" /> \n");
- // scriptBuffer.append(" <arg value=\"-artifactRepository\" /> \n");
- // scriptBuffer.append(" <arg value=\"" + URIUtil.toUnencodedString(repoFolder.getLocationURI()) + "\" /> \n");
- // scriptBuffer.append(" <arg line=\"-installIU bootstrap/1.2.0.12345 -profile bootProfile\" /> \n");
- // scriptBuffer.append(" <arg line=\"-profileProperties org.eclipse.update.install.features=true\" /> \n");
- // scriptBuffer.append(" <arg line=\"-p2.os win32 -p2.ws win32 -p2.arch x86\" /> \n");
- // scriptBuffer.append(" <arg value=\"-destination\" /> \n");
- // scriptBuffer.append(" <arg value=\"" + installFolder.getLocation().toOSString() + "\" /> \n");
- // //scriptBuffer.append(" <jvmarg value=\"-Declipse.p2.data.area=" + installFolder.getLocation().toOSString() + "/p2\" /> \n");
- // //scriptBuffer.append(" <jvmarg line=\"-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000\" /> \n");
- // scriptBuffer.append(" </java> \n");
- // scriptBuffer.append(" </target> \n");
- // scriptBuffer.append("</project> \n");
- // IFile script = buildFolder.getFile("build.xml");
- // Utils.writeBuffer(script, scriptBuffer);
- //
- // runAntScript(script.getLocation().toOSString(), new String[] {"go"}, testFolder.getLocation().toOSString(), null);
- //
- // IMetadataRepository metaRepo = loadMetadataRepository(repoFolder.getLocationURI());
- // assertEquals(metaRepo.getName(), "BootStrapRepo");
- // IInstallableUnit iu = getIU(metaRepo, "bootstrap");
- // assertEquals(iu.getVersion().toString(), "1.2.0.12345");
- // assertResourceFile(installFolder, "eclipse.exe");
- // }
}
diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java
index 22d7179..cd3dda4 100644
--- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java
+++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java
@@ -43,10 +43,13 @@ public class PublishingTests extends P2TestCase {
IFolder buildFolder = newTest("PublishBundle_simple");
IFolder bundle = Utils.createFolder(buildFolder, "plugins/bundle");
- Utils.writeBuffer(bundle.getFile("src/A.java"), new StringBuffer("import b.c.d.B; public class A { B b = new B(); }"));
- Utils.writeBuffer(bundle.getFile("src/b/c/d/B.java"), new StringBuffer("package b.c.d; public class B { int i = 0; }"));
+ Utils.writeBuffer(bundle.getFile("src/A.java"),
+ new StringBuffer("import b.c.d.B; public class A { B b = new B(); }"));
+ Utils.writeBuffer(bundle.getFile("src/b/c/d/B.java"),
+ new StringBuffer("package b.c.d; public class B { int i = 0; }"));
Utils.writeBuffer(bundle.getFile("about.txt"), new StringBuffer("All about bundle."));
- Utils.writeBuffer(bundle.getFile("META-INF/p2.inf"), new StringBuffer("instructions.install=myRandomAction(foo: bar);"));
+ Utils.writeBuffer(bundle.getFile("META-INF/p2.inf"),
+ new StringBuffer("instructions.install=myRandomAction(foo: bar);"));
Properties properties = new Properties();
properties.put("bin.includes", "META-INF/, ., about.txt");
Attributes manifestAdditions = new Attributes();
@@ -60,7 +63,8 @@ public class PublishingTests extends P2TestCase {
generateScripts(buildFolder, properties);
String buildXMLPath = bundle.getFile("build.xml").getLocation().toOSString();
- runAntScript(buildXMLPath, new String[] {"build.jars", "publish.bin.parts"}, buildFolder.getLocation().toOSString(), properties);
+ runAntScript(buildXMLPath, new String[] { "build.jars", "publish.bin.parts" },
+ buildFolder.getLocation().toOSString(), properties);
assertResourceFile(buildFolder, "buildRepo/plugins/bundle_1.0.0.v1234.jar");
IFile jar = buildFolder.getFile("buildRepo/plugins/bundle_1.0.0.v1234.jar");
@@ -84,7 +88,8 @@ public class PublishingTests extends P2TestCase {
contents.add("b/c/d/B.class");
assertZipContents(buildFolder, "buildRepo/plugins/bundle_1.0.0.v1234.jar", contents);
- IMetadataRepository repository = loadMetadataRepository("file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString());
+ IMetadataRepository repository = loadMetadataRepository(
+ "file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString());
assertNotNull(repository);
IInstallableUnit iu = getIU(repository, "bundle");
@@ -106,7 +111,7 @@ public class PublishingTests extends P2TestCase {
Utils.storeProperties(rootFile, rootProperties);
IFile productFile = buildFolder.getFile("foo.product");
- Utils.generateProduct(productFile, "foo", "1.0.0.qualifier", null, new String[] {OSGI}, false);
+ Utils.generateProduct(productFile, "foo", "1.0.0.qualifier", null, new String[] { OSGI }, false);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("p2.gathering", "true");
@@ -137,14 +142,14 @@ public class PublishingTests extends P2TestCase {
IFolder buildFolder = newTest("277824_2");
IFolder f = Utils.createFolder(buildFolder, "features/f");
- Utils.generateFeature(buildFolder, "f", null, new String[] {EQUINOX_COMMON});
+ Utils.generateFeature(buildFolder, "f", null, new String[] { EQUINOX_COMMON });
Utils.writeBuffer(f.getFile("file.txt"), new StringBuffer("I'm a file!"));
Properties properties = new Properties();
properties.put("root", "file:file.txt");
Utils.storeBuildProperties(f, properties);
IFile productFile = buildFolder.getFile("foo.product");
- Utils.generateProduct(productFile, "foo", "1.0.0.qualifier", null, new String[] {OSGI}, false);
+ Utils.generateProduct(productFile, "foo", "1.0.0.qualifier", null, new String[] { OSGI }, false);
properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("p2.gathering", "true");
@@ -173,8 +178,9 @@ public class PublishingTests extends P2TestCase {
Utils.writeBuffer(f.getFile("app/contents/file"), buffer);
Utils.writeBuffer(f.getFile("app/second"), buffer);
Properties rootProperties = new Properties();
- //bug 274203
- rootProperties.put("root.folder.contents", "absolute:file:" + f.getFile("app/contents/file").getLocation().toOSString());
+ // bug 274203
+ rootProperties.put("root.folder.contents",
+ "absolute:file:" + f.getFile("app/contents/file").getLocation().toOSString());
rootProperties.put("root", "file:app/second");
rootProperties.put("root.permissions.755", "file, second");
rootProperties.put("root.permissions.766", "contents/file");
@@ -186,7 +192,8 @@ public class PublishingTests extends P2TestCase {
generateScripts(buildFolder, properties);
String buildXMLPath = f.getFile("build.xml").getLocation().toOSString();
- runAntScript(buildXMLPath, new String[] {"publish.bin.parts"}, buildFolder.getLocation().toOSString(), properties);
+ runAntScript(buildXMLPath, new String[] { "publish.bin.parts" }, buildFolder.getLocation().toOSString(),
+ properties);
IMetadataRepository meta = loadMetadataRepository(buildFolder.getFolder("buildRepo").getLocationURI());
getIU(meta, "f.feature.group");
@@ -223,7 +230,8 @@ public class PublishingTests extends P2TestCase {
Utils.generatePluginBuildProperties(bar, null);
Utils.writeBuffer(bar.getFile("src/bar.java"), new StringBuffer("public class bar { int i; }"));
- //bug 274672, write the feature manually since generateFeature always adds an unpack attribute
+ // bug 274672, write the feature manually since generateFeature always adds an
+ // unpack attribute
StringBuffer buffer = new StringBuffer();
buffer.append("<feature id=\"F\" version=\"1.0.0.qualifier\"> \n");
buffer.append(" <plugin id=\"foo\" version=\"0.0.0\" /> \n");
@@ -271,9 +279,11 @@ public class PublishingTests extends P2TestCase {
IFolder buildFolder = newTest("PublishBundle_callbacks");
IFolder bundle = Utils.createFolder(buildFolder, "plugins/bundle");
- Utils.writeBuffer(bundle.getFile("src/A.java"), new StringBuffer("import b.B; public class A { B b = new B(); }"));
+ Utils.writeBuffer(bundle.getFile("src/A.java"),
+ new StringBuffer("import b.B; public class A { B b = new B(); }"));
Utils.writeBuffer(bundle.getFile("src/b/B.java"), new StringBuffer("package b; public class B { int i = 0; }"));
- Utils.writeBuffer(bundle.getFile("META-INF/p2.inf"), new StringBuffer("instructions.install=myRandomAction(foo: bar);"));
+ Utils.writeBuffer(bundle.getFile("META-INF/p2.inf"),
+ new StringBuffer("instructions.install=myRandomAction(foo: bar);"));
Properties properties = new Properties();
properties.put("bin.includes", "META-INF/, .");
properties.put("customBuildCallbacks", "customBuildCallbacks.xml");
@@ -302,7 +312,8 @@ public class PublishingTests extends P2TestCase {
generateScripts(buildFolder, properties);
String buildXMLPath = bundle.getFile("build.xml").getLocation().toOSString();
- runAntScript(buildXMLPath, new String[] {"build.jars", "publish.bin.parts"}, buildFolder.getLocation().toOSString(), properties);
+ runAntScript(buildXMLPath, new String[] { "build.jars", "publish.bin.parts" },
+ buildFolder.getLocation().toOSString(), properties);
HashSet<String> contents = new HashSet<>();
contents.add("a.txt");
@@ -345,7 +356,7 @@ public class PublishingTests extends P2TestCase {
Utils.writeBuffer(bundle.getFile("META-INF/p2.inf"), inf);
IFile productFile = buildFolder.getFile("foo.product");
- Utils.generateProduct(productFile, "foo", "1.0.0", null, new String[] {OSGI, "bundle"}, false);
+ Utils.generateProduct(productFile, "foo", "1.0.0", null, new String[] { OSGI, "bundle" }, false);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", productFile.getLocation().toOSString());
@@ -359,14 +370,15 @@ public class PublishingTests extends P2TestCase {
Utils.storeBuildProperties(buildFolder, properties);
runProductBuild(buildFolder);
- assertLogContainsLine(buildFolder.getFile("tmp/eclipse/configuration/config.ini"), "bundle_1.0.0.jar@1\\:start");
+ assertLogContainsLine(buildFolder.getFile("tmp/eclipse/configuration/config.ini"),
+ "bundle_1.0.0.jar@1\\:start");
assertLogContainsLine(buildFolder.getFile("director.log"), "Installing foo 1.0.0");
}
- protected File findExecutableFeature(File delta) throws Exception {
+ protected File findExecutableFeature(File base) throws Exception {
FilenameFilter filter = (dir, name) -> name.startsWith(EQUINOX_EXECUTABLE);
- File[] features = new File(delta, "features").listFiles(filter);
+ File[] features = new File(base, "features").listFiles(filter);
assertTrue(features.length > 0);
Arrays.sort(features, (o1, o2) -> -1 * o1.getName().compareTo(o2.getName()));
return features[0];
@@ -403,14 +415,15 @@ public class PublishingTests extends P2TestCase {
generateScripts(buildFolder, properties);
String buildXMLPath = f.getFile("build.xml").getLocation().toOSString();
- runAntScript(buildXMLPath, new String[] {"publish.bin.parts"}, buildFolder.getLocation().toOSString(), properties);
+ runAntScript(buildXMLPath, new String[] { "publish.bin.parts" }, buildFolder.getLocation().toOSString(),
+ properties);
HashSet<String> contents = new HashSet<>();
contents.add("a.txt");
contents.add("feature.xml");
contents.add("p2.inf");
assertZipContents(buildFolder, "buildRepo/features/f_1.0.0.jar", contents, false);
- //p2.inf was not expected in the jar
+ // p2.inf was not expected in the jar
assertEquals(contents.size(), 1);
assertTrue(contents.contains("p2.inf"));
@@ -424,35 +437,32 @@ public class PublishingTests extends P2TestCase {
return;
IFolder buildFolder = newTest("PublishFeature_Executable");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executableLocation = Utils.findExecutable();
+ assertNotNull(executableLocation);
- File originalExecutable = findExecutableFeature(delta);
+ File originalExecutable = findExecutableFeature(executableLocation);
- Properties properties = BuildConfiguration.getScriptGenerationProperties(buildFolder, "feature", EQUINOX_EXECUTABLE);
+ Properties properties = BuildConfiguration.getScriptGenerationProperties(buildFolder, "feature",
+ EQUINOX_EXECUTABLE);
properties.put("launcherName", "eclipse");
properties.put("p2.gathering", "true");
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
+ if (!executableLocation.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executableLocation.getAbsolutePath());
generateScripts(buildFolder, properties);
String buildXMLPath = new File(originalExecutable, "build.xml").getAbsolutePath();
- runAntScript(buildXMLPath, new String[] {"publish.bin.parts"}, buildFolder.getLocation().toOSString(), properties);
+ runAntScript(buildXMLPath, new String[] { "publish.bin.parts" }, buildFolder.getLocation().toOSString(),
+ properties);
String executable = EQUINOX_EXECUTABLE;
String fileName = originalExecutable.getName();
String version = fileName.substring(fileName.indexOf('_') + 1);
Set<String> entries = new HashSet<>();
- // Linux zips contain launcher and about.html (libCairo no longer packaged in the delta pack (bug 354978))
- // entries.add("libcairo-swt.so");
- // entries.add("about_files/about_cairo.html");
- // entries.add("about_files/mpl-v11.txt");
- // entries.add("about_files/pixman-licenses.txt");
- // entries.add("about_files/");
entries.add("launcher");
entries.add("about.html");
- assertZipContents(buildFolder.getFolder("buildRepo/binary"), executable + "_root.gtk.linux.x86_" + version, entries);
+ assertZipContents(buildFolder.getFolder("buildRepo/binary"), executable + "_root.gtk.linux.x86_" + version,
+ entries);
// Mac zips contain app structure
entries.add("Eclipse.app/");
@@ -461,25 +471,30 @@ public class PublishingTests extends P2TestCase {
entries.add("Eclipse.app/Contents/MacOS/");
entries.add("Eclipse.app/Contents/MacOS/eclipse.ini");
entries.add("Eclipse.app/Contents/MacOS/launcher");
- assertZipContents(buildFolder.getFolder("buildRepo/binary"), executable + "_root.cocoa.macosx.x86_" + version, entries);
+ assertZipContents(buildFolder.getFolder("buildRepo/binary"), executable + "_root.cocoa.macosx.x86_" + version,
+ entries);
// Windows zips just contain the launcher
- IMetadataRepository repository = loadMetadataRepository("file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString());
+ IMetadataRepository repository = loadMetadataRepository(
+ "file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString());
assertNotNull(repository);
IInstallableUnit iu = getIU(repository, "org.eclipse.equinox.executable_root.gtk.linux.ppc");
assertEquals(iu.getVersion().toString(), version);
// LibCairo no longer installed using a touchpoint (Bug 354978)
- // assertTouchpoint(iu, "install", "chmod(targetDir:${installFolder}, targetFile:libcairo-swt.so, permissions:755);");
+ // assertTouchpoint(iu, "install", "chmod(targetDir:${installFolder},
+ // targetFile:libcairo-swt.so, permissions:755);");
}
public void testPublishBundle_APITooling() throws Exception {
IFolder buildFolder = newTest("PublishBundle_APITooling");
IFolder bundle = Utils.createFolder(buildFolder, "plugins/bundle");
- Utils.writeBuffer(bundle.getFile("src/A.java"), new StringBuffer("import b.B; public class A { B b = new B(); /** @nooverride */public void Bar(){}}"));
- Utils.writeBuffer(bundle.getFile("src/b/B.java"), new StringBuffer("package b; /** @noextend */public class B { /** @noreference */public int i = 0; public void Foo(){}}"));
+ Utils.writeBuffer(bundle.getFile("src/A.java"),
+ new StringBuffer("import b.B; public class A { B b = new B(); /** @nooverride */public void Bar(){}}"));
+ Utils.writeBuffer(bundle.getFile("src/b/B.java"), new StringBuffer(
+ "package b; /** @noextend */public class B { /** @noreference */public int i = 0; public void Foo(){}}"));
StringBuffer buffer = new StringBuffer();
buffer.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?> \n");
@@ -508,7 +523,8 @@ public class PublishingTests extends P2TestCase {
generateScripts(buildFolder, properties);
String buildXMLPath = bundle.getFile("build.xml").getLocation().toOSString();
- runAntScript(buildXMLPath, new String[] {"build.jars", "publish.bin.parts"}, buildFolder.getLocation().toOSString(), properties);
+ runAntScript(buildXMLPath, new String[] { "build.jars", "publish.bin.parts" },
+ buildFolder.getLocation().toOSString(), properties);
assertResourceFile(buildFolder, "buildRepo/plugins/bundle_1.0.0.v1234.jar");
HashSet<String> contents = new HashSet<>();
@@ -521,7 +537,7 @@ public class PublishingTests extends P2TestCase {
public void testPublish_Packaging_1() throws Exception {
IFolder buildFolder = newTest("packaging_1");
IFolder a = Utils.createFolder(buildFolder, "plugins/a");
- Utils.generateFeature(buildFolder, "F", new String[] {"org.eclipse.cvs"}, new String[] {"a"});
+ Utils.generateFeature(buildFolder, "F", new String[] { "org.eclipse.cvs" }, new String[] { "a" });
Utils.generateBundle(a, "a");
Utils.writeBuffer(a.getFile("src/A.java"), new StringBuffer("public class A { int i; }"));
@@ -534,7 +550,8 @@ public class PublishingTests extends P2TestCase {
buildFolder.refreshLocal(IResource.DEPTH_INFINITE, null);
- IMetadataRepository repository = loadMetadataRepository("file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString());
+ IMetadataRepository repository = loadMetadataRepository(
+ "file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString());
assertNotNull(repository);
HashSet<String> entries = new HashSet<>();
@@ -579,11 +596,13 @@ public class PublishingTests extends P2TestCase {
IFolder buildFolder = newTest("source_1");
IFolder bundle = Utils.createFolder(buildFolder, "plugins/bundle");
- Utils.writeBuffer(bundle.getFile("src/A.java"), new StringBuffer("import b.B; public class A { B b = new B(); public void Bar(){}}"));
- Utils.writeBuffer(bundle.getFile("src/b/B.java"), new StringBuffer("package b; public class B { public int i = 0; public void Foo(){}}"));
+ Utils.writeBuffer(bundle.getFile("src/A.java"),
+ new StringBuffer("import b.B; public class A { B b = new B(); public void Bar(){}}"));
+ Utils.writeBuffer(bundle.getFile("src/b/B.java"),
+ new StringBuffer("package b; public class B { public int i = 0; public void Foo(){}}"));
Utils.generateBundle(bundle, "bundle");
- Utils.generateFeature(buildFolder, "F", null, new String[] {"bundle", "bundle.source"});
+ Utils.generateFeature(buildFolder, "F", null, new String[] { "bundle", "bundle.source" });
Properties properties = new Properties();
properties.put("generate.plugin@bundle.source", "bundle");
properties.put("individualSourceBundles", "true");
@@ -609,10 +628,10 @@ public class PublishingTests extends P2TestCase {
IFolder buildFolder = newTest("brand_1");
IFolder rcp = Utils.createFolder(buildFolder, "rcp");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executableLocation = Utils.findExecutable();
+ assertNotNull(executableLocation);
- File executable = findExecutableFeature(delta);
+ File executable = findExecutableFeature(executableLocation);
String executableVersion = executable.getName().substring(executable.getName().indexOf('_') + 1);
IFile product = rcp.getFile("rcp.product");
@@ -625,22 +644,23 @@ public class PublishingTests extends P2TestCase {
branding.append(" </win> \n");
branding.append("</launcher> \n");
- //bug 273115 - no version
- Utils.generateProduct(product, "org.example.rcp", null, null, new String[] {OSGI}, false, branding);
+ // bug 273115 - no version
+ Utils.generateProduct(product, "org.example.rcp", null, null, new String[] { OSGI }, false, branding);
- //steal the icons from test 237922
- URL ico = FileLocator.find(Platform.getBundle(Activator.PLUGIN_ID), new Path("/resources/237922/rcp/icons/mail.ico"), null);
+ // steal the icons from test 237922
+ URL ico = FileLocator.find(Platform.getBundle(Activator.PLUGIN_ID),
+ new Path("/resources/237922/rcp/icons/mail.ico"), null);
IFile icoFile = rcp.getFile("mail.ico");
icoFile.create(ico.openStream(), IResource.FORCE, null);
- //cheat and spoof a icns file for mac
+ // cheat and spoof a icns file for mac
Utils.copy(icoFile.getLocation().toFile(), new File(rcp.getLocation().toFile(), "mail.icns"));
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", product.getLocation().toOSString());
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
- //bug 274527 - cocoa.x86_64
+ if (!executableLocation.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executableLocation.getAbsolutePath());
+ // bug 274527 - cocoa.x86_64
properties.put("configs", "win32,win32,x86 & macosx, cocoa, x86_64");
properties.put("p2.gathering", "true");
Utils.storeBuildProperties(buildFolder, properties);
@@ -652,13 +672,16 @@ public class PublishingTests extends P2TestCase {
entries.add("branded.app/Contents/MacOS/branded.ini");
entries.add("branded.app/Contents/MacOS/branded");
entries.add("branded.app/Contents/Resources/mail.icns");
- assertZipContents(buildFolder.getFolder("buildRepo/binary"), "org.example.rcp_root.cocoa.macosx.x86_64_" + executableVersion, entries);
+ assertZipContents(buildFolder.getFolder("buildRepo/binary"),
+ "org.example.rcp_root.cocoa.macosx.x86_64_" + executableVersion, entries);
entries.clear();
entries.add("branded.exe");
- assertZipContents(buildFolder.getFolder("buildRepo/binary"), "org.example.rcp_root.win32.win32.x86_" + executableVersion, entries);
+ assertZipContents(buildFolder.getFolder("buildRepo/binary"),
+ "org.example.rcp_root.win32.win32.x86_" + executableVersion, entries);
- IMetadataRepository repository = loadMetadataRepository("file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString());
+ IMetadataRepository repository = loadMetadataRepository(
+ "file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString());
assertNotNull(repository);
IInstallableUnit iu = getIU(repository, "org.example.rcp");
@@ -666,7 +689,7 @@ public class PublishingTests extends P2TestCase {
assertEquals(iu.getVersion().toString(), "0.0.0");
assertRequires(iu, "org.eclipse.equinox.p2.iu", OSGI);
- //bug 218377
+ // bug 218377
iu = getIU(repository, "org.example.rcp_root.cocoa.macosx.x86_64");
assertTouchpoint(iu, "install", "targetFile:branded.app/Contents/MacOS/branded");
@@ -677,13 +700,15 @@ public class PublishingTests extends P2TestCase {
entries.add("eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_" + iu.getVersion() + "/");
assertZipContents(buildFolder, "I.TestBuild/eclipse-macosx.cocoa.x86_64.zip", entries);
- //bug 295282, bug 282652
+ // bug 295282, bug 282652
IFile iniFile = buildFolder.getFile("branded.ini");
- Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-macosx.cocoa.x86_64.zip", "eclipse/branded.app/Contents/MacOS/branded.ini", iniFile);
+ Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-macosx.cocoa.x86_64.zip",
+ "eclipse/branded.app/Contents/MacOS/branded.ini", iniFile);
assertLogContainsLine(iniFile, "../../../plugins/org.eclipse.equinox.launcher");
IFile wrongFile = buildFolder.getFile("wrong.ini");
- Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-macosx.cocoa.x86_64.zip", "eclipse/Branded.app/Contents/MacOS/branded.ini", wrongFile);
+ Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-macosx.cocoa.x86_64.zip",
+ "eclipse/Branded.app/Contents/MacOS/branded.ini", wrongFile);
assertFalse(wrongFile.exists());
}
@@ -691,12 +716,14 @@ public class PublishingTests extends P2TestCase {
IFolder buildFolder = newTest("publishAssemblePackage");
IFolder p = Utils.createFolder(buildFolder, "plugins/p");
- Utils.writeBuffer(p.getFile("src/A.java"), new StringBuffer("import b.B; public class A { B b = new B(); public void Bar(){}}"));
- Utils.writeBuffer(p.getFile("src/b/B.java"), new StringBuffer("package b; public class B { public int i = 0; public void Foo(){}}"));
+ Utils.writeBuffer(p.getFile("src/A.java"),
+ new StringBuffer("import b.B; public class A { B b = new B(); public void Bar(){}}"));
+ Utils.writeBuffer(p.getFile("src/b/B.java"),
+ new StringBuffer("package b; public class B { public int i = 0; public void Foo(){}}"));
Utils.generateBundle(p, "p");
IFolder f = Utils.createFolder(buildFolder, "features/f");
- Utils.generateFeature(buildFolder, "f", null, new String[] {"p", OSGI});
+ Utils.generateFeature(buildFolder, "f", null, new String[] { "p", OSGI });
Utils.writeBuffer(f.getFile("about.html"), new StringBuffer("about!\n"));
Utils.writeBuffer(f.getFile("rootFiles/license.html"), new StringBuffer("license"));
Properties properties = new Properties();
@@ -717,7 +744,8 @@ public class PublishingTests extends P2TestCase {
Utils.storeBuildProperties(buildFolder, properties);
runBuild(buildFolder);
- IMetadataRepository repository = loadMetadataRepository("file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString());
+ IMetadataRepository repository = loadMetadataRepository(
+ "file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString());
IInstallableUnit osgi = getIU(repository, OSGI);
IFile tar = buildFolder.getFile("I.TestBuild/f-TestBuild-group.group.group.tar.gz");
@@ -761,7 +789,8 @@ public class PublishingTests extends P2TestCase {
IFile script = buildFolder.getFile("append.xml");
Utils.writeBuffer(script, buffer);
- runAntScript(script.getLocation().toOSString(), new String[] {"category"}, buildFolder.getLocation().toOSString(), null);
+ runAntScript(script.getLocation().toOSString(), new String[] { "category" },
+ buildFolder.getLocation().toOSString(), null);
assertResourceFile(buildFolder, "untarred/artifacts.jar");
assertResourceFile(buildFolder, "untarred/content.jar");
@@ -772,10 +801,10 @@ public class PublishingTests extends P2TestCase {
public void testPublishAndRunSimpleProduct() throws Exception {
IFolder buildFolder = newTest("PublishAndRunSimpleProduct");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
- //headless rcp hello world
+ // headless rcp hello world
IFolder headless = Utils.createFolder(buildFolder, "plugins/headless");
StringBuffer buffer = new StringBuffer();
buffer.append("package headless; \n");
@@ -814,16 +843,18 @@ public class PublishingTests extends P2TestCase {
Utils.generatePluginBuildProperties(headless, properties);
IFile productFile = buildFolder.getFile("headless.product");
- String[] bundles = new String[] {"headless", "org.eclipse.core.contenttype", "org.eclipse.core.jobs", "org.eclipse.core.runtime", EQUINOX_APP, EQUINOX_COMMON, EQUINOX_PREFERENCES, EQUINOX_REGISTRY, OSGI};
- Utils.generateProduct(productFile, "headless.product", "1.0.0.qualifier", "headless.application", "headless", bundles, false, null);
+ String[] bundles = new String[] { "headless", "org.eclipse.core.contenttype", "org.eclipse.core.jobs",
+ "org.eclipse.core.runtime", EQUINOX_APP, EQUINOX_COMMON, EQUINOX_PREFERENCES, EQUINOX_REGISTRY, OSGI };
+ Utils.generateProduct(productFile, "headless.product", "1.0.0.qualifier", "headless.application", "headless",
+ bundles, false, null);
Properties p2Inf = new Properties(); // bug 268223
p2Inf.put("instructions.configure", "addRepository(type:0,location:file${#58}//foo/bar);");
Utils.storeProperties(buildFolder.getFile("p2.inf"), p2Inf);
properties = BuildConfiguration.getBuilderProperties(buildFolder);
String config = Platform.getOS() + ',' + Platform.getWS() + ',' + Platform.getOSArch();
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executable.getAbsolutePath());
if (Platform.getOS().equals("macosx"))
properties.put("archivePrefix", "Headless.app");
properties.put("product", productFile.getLocation().toOSString());
@@ -845,29 +876,34 @@ public class PublishingTests extends P2TestCase {
if (Platform.getOS().equals("macosx")) {
IFile iniFile = buildFolder.getFile("/tmp/Headless.app/Contents/Eclipse/headless.ini");
- assertLogContainsLines(iniFile, new String[] {"-startup", "plugins/org.eclipse.equinox.launcher_"});
- assertLogContainsLines(iniFile, new String[] {"--launcher.library", "plugins/org.eclipse.equinox.launcher."});
+ assertLogContainsLines(iniFile, new String[] { "-startup", "plugins/org.eclipse.equinox.launcher_" });
+ assertLogContainsLines(iniFile,
+ new String[] { "--launcher.library", "plugins/org.eclipse.equinox.launcher." });
} else {
IFile iniFile = buildFolder.getFile("/tmp/eclipse/headless.ini");
- assertLogContainsLines(iniFile, new String[] {"-startup", "plugins/org.eclipse.equinox.launcher_"});
- assertLogContainsLines(iniFile, new String[] {"--launcher.library", "plugins/org.eclipse.equinox.launcher."});
+ assertLogContainsLines(iniFile, new String[] { "-startup", "plugins/org.eclipse.equinox.launcher_" });
+ assertLogContainsLines(iniFile,
+ new String[] { "--launcher.library", "plugins/org.eclipse.equinox.launcher." });
}
IFolder binaryFolder = buildFolder.getFolder("/tmp/eclipse/binary");
assertFalse(binaryFolder.exists());
- IMetadataRepository finalRepo = loadMetadataRepository("file:" + buildFolder.getFolder("finalRepo").getLocation().toOSString());
+ IMetadataRepository finalRepo = loadMetadataRepository(
+ "file:" + buildFolder.getFolder("finalRepo").getLocation().toOSString());
getIU(finalRepo, "a.jre.javase");
IInstallableUnit productIu = getIU(finalRepo, "headless.product");
- assertFalse(productIu.getVersion().toString().equals("1.0.0.qualifier")); //bug 246060, should be a timestamp
- //check up to the date on the timestamp, don't worry about hours/mins
- assertTrue(PublisherHelper.toOSGiVersion(productIu.getVersion()).getQualifier().startsWith(QualifierReplacer.getDateQualifier().substring(0, 8)));
+ assertFalse(productIu.getVersion().toString().equals("1.0.0.qualifier")); // bug 246060, should be a timestamp
+ // check up to the date on the timestamp, don't worry about hours/mins
+ assertTrue(PublisherHelper.toOSGiVersion(productIu.getVersion()).getQualifier()
+ .startsWith(QualifierReplacer.getDateQualifier().substring(0, 8)));
assertTouchpoint(productIu, "configure", "addRepository(type:0,location:file${#58}//foo/bar);");
IInstallableUnit iu = getIU(finalRepo, "toolingorg.eclipse.equinox.common");
assertEquals(iu.getVersion(), productIu.getVersion());
- iu = getIU(finalRepo, "toolingheadless.product_root." + Platform.getWS() + '.' + Platform.getOS() + '.' + Platform.getOSArch());
+ iu = getIU(finalRepo, "toolingheadless.product_root." + Platform.getWS() + '.' + Platform.getOS() + '.'
+ + Platform.getOSArch());
assertTouchpoint(iu, "configure", "setLauncherName(name:headless");
assertEquals(iu.getVersion(), productIu.getVersion());
@@ -881,19 +917,23 @@ public class PublishingTests extends P2TestCase {
}
IFolder p = Utils.createFolder(buildFolder, "plugins/p");
- Utils.writeBuffer(p.getFile("src/A.java"), new StringBuffer("import b.B; public class A { B b = new B(); public void Bar(){}}"));
- Utils.writeBuffer(p.getFile("src/b/B.java"), new StringBuffer("package b; public class B { public int i = 0; public void Foo(){}}"));
+ Utils.writeBuffer(p.getFile("src/A.java"),
+ new StringBuffer("import b.B; public class A { B b = new B(); public void Bar(){}}"));
+ Utils.writeBuffer(p.getFile("src/b/B.java"),
+ new StringBuffer("package b; public class B { public int i = 0; public void Foo(){}}"));
Utils.generateBundle(p, "p");
IFolder f = Utils.createFolder(buildFolder, "features/f");
- Utils.generateFeature(buildFolder, "f", new String[] {"org.eclipse.rcp"}, new String[] {"p"});
- Utils.writeBuffer(buildFolder.getFile("features/f/p2.inf"), new StringBuffer("properties.1.name=org.eclipse.equinox.p2.type.group\nproperties.1.value=false\n"));
+ Utils.generateFeature(buildFolder, "f", new String[] { "org.eclipse.rcp" }, new String[] { "p" });
+ Utils.writeBuffer(buildFolder.getFile("features/f/p2.inf"),
+ new StringBuffer("properties.1.name=org.eclipse.equinox.p2.type.group\nproperties.1.value=false\n"));
Utils.writeBuffer(f.getFile("about.html"), new StringBuffer("about!\n"));
Properties properties = new Properties();
properties.put("bin.includes", "about.html, feature.xml");
Utils.storeBuildProperties(f, properties);
- URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build.tests"), new org.eclipse.core.runtime.Path("/resources/keystore/keystore"), null);
+ URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build.tests"),
+ new org.eclipse.core.runtime.Path("/resources/keystore/keystore"), null);
assertNotNull(resource);
String keystorePath = FileLocator.toFileURL(resource).getPath();
@@ -913,15 +953,16 @@ public class PublishingTests extends P2TestCase {
Utils.storeBuildProperties(buildFolder, properties);
runBuild(buildFolder);
- //bug 270887
+ // bug 270887
IFolder repo = Utils.createFolder(buildFolder, "buildRepo");
URI repoURI = URIUtil.fromString("file:" + repo.getLocation().toOSString());
assertManagerDoesntContain(repoURI);
- IMetadataRepository repository = loadMetadataRepository("file:" + buildFolder.getFolder("tmp/eclipse").getLocation().toOSString());
+ IMetadataRepository repository = loadMetadataRepository(
+ "file:" + buildFolder.getFolder("tmp/eclipse").getLocation().toOSString());
assertNotNull(repository);
- //bug 274703
+ // bug 274703
IInstallableUnit iu = getIU(repository, "f.feature.group");
assertFalse(Boolean.valueOf(iu.getProperty("org.eclipse.equinox.p2.type.group")).booleanValue());
@@ -939,11 +980,14 @@ public class PublishingTests extends P2TestCase {
assertJarVerifies(new File(buildFile, "tmp/eclipse/plugins/com.ibm.icu_" + iu.getVersion() + ".jar"));
iu = getIU(repository, "org.eclipse.core.commands");
assertNotNull(iu);
- assertZipContents(buildFolder, "tmp/eclipse/plugins/org.eclipse.core.commands_" + iu.getVersion() + ".jar", entries);
- assertJarVerifies(new File(buildFile, "tmp/eclipse/plugins/org.eclipse.core.commands_" + iu.getVersion() + ".jar"));
+ assertZipContents(buildFolder, "tmp/eclipse/plugins/org.eclipse.core.commands_" + iu.getVersion() + ".jar",
+ entries);
+ assertJarVerifies(
+ new File(buildFile, "tmp/eclipse/plugins/org.eclipse.core.commands_" + iu.getVersion() + ".jar"));
iu = getIU(repository, EQUINOX_APP);
assertNotNull(iu);
- assertZipContents(buildFolder, "tmp/eclipse/plugins/org.eclipse.equinox.app_" + iu.getVersion() + ".jar", entries);
+ assertZipContents(buildFolder, "tmp/eclipse/plugins/org.eclipse.equinox.app_" + iu.getVersion() + ".jar",
+ entries);
iu = getIU(repository, "org.eclipse.help");
assertNotNull(iu);
assertZipContents(buildFolder, "tmp/eclipse/plugins/org.eclipse.help_" + iu.getVersion() + ".jar", entries);
@@ -958,7 +1002,8 @@ public class PublishingTests extends P2TestCase {
public void testMultiConfig() throws Exception {
IFolder buildFolder = newTest("multiConfig");
- Utils.generateFeature(buildFolder, "f", null, new String[] {OSGI + ";os=win32", EQUINOX_COMMON + ";os=linux"});
+ Utils.generateFeature(buildFolder, "f", null,
+ new String[] { OSGI + ";os=win32", EQUINOX_COMMON + ";os=linux" });
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("topLevelElementId", "f");
@@ -972,7 +1017,8 @@ public class PublishingTests extends P2TestCase {
File untarred = new File(buildFolder.getLocation().toFile(), "unzipped");
FileUtils.unzipFile(tar.getLocation().toFile(), untarred);
- IMetadataRepository repository = loadMetadataRepository("file:" + buildFolder.getFolder("unzipped").getLocation().toOSString());
+ IMetadataRepository repository = loadMetadataRepository(
+ "file:" + buildFolder.getFolder("unzipped").getLocation().toOSString());
IInstallableUnit osgi = getIU(repository, OSGI);
IInstallableUnit common = getIU(repository, EQUINOX_COMMON);
@@ -986,10 +1032,10 @@ public class PublishingTests extends P2TestCase {
IFolder buildFolder = newTest("publishShape");
IFolder a = Utils.createFolder(buildFolder, "plugins/a");
IFolder b = Utils.createFolder(buildFolder, "plugins/b");
- Utils.generateFeature(buildFolder, "f", null, new String[] {"a;unpack=true", "b;unpack=false"});
+ Utils.generateFeature(buildFolder, "f", null, new String[] { "a;unpack=true", "b;unpack=false" });
Utils.generateBundle(a, "a");
- //bug 287537
+ // bug 287537
Properties props = new Properties();
props.put("customBuildCallbacks", "true");
Utils.generatePluginBuildProperties(a, props);
@@ -1012,7 +1058,8 @@ public class PublishingTests extends P2TestCase {
runBuild(buildFolder);
- URI uri = URIUtil.fromString("file:" + buildFolder.getFolder("I.TestBuild/f-TestBuild-group.group.group.zip").getLocation().toOSString());
+ URI uri = URIUtil.fromString("file:"
+ + buildFolder.getFolder("I.TestBuild/f-TestBuild-group.group.group.zip").getLocation().toOSString());
IMetadataRepository repo = loadMetadataRepository(URIUtil.toJarURI(uri, new Path("")));
IInstallableUnit iuA = getIU(repo, "a");
assertTouchpoint(iuA, "zipped", "true");
@@ -1021,50 +1068,67 @@ public class PublishingTests extends P2TestCase {
assertTrue(Boolean.valueOf(iuB.getProperties().get("pde.build")).booleanValue());
/*
- * Part 2. Use the above zipped repo as input to a build to test reusing IUs (bug 259792)
+ * Part 2. Use the above zipped repo as input to a build to test reusing IUs
+ * (bug 259792)
*/
IFolder build2 = Utils.createFolder(buildFolder, "build2");
- Utils.generateFeature(build2, "f", null, new String[] {"a;unpack=false", "b;unpack=false"});
+ Utils.generateFeature(build2, "f", null, new String[] { "a;unpack=false", "b;unpack=false" });
properties = BuildConfiguration.getBuilderProperties(build2);
properties.put("topLevelElementId", "f");
properties.put("p2.gathering", "true");
properties.put("repoBaseLocation", buildFolder.getFolder("I.TestBuild").getLocation().toOSString());
- //space here tries bug 267509, bug 267219
+ // space here tries bug 267509, bug 267219
properties.put("transformedRepoLocation", build2.getFolder("trans formed").getLocation().toOSString());
Utils.storeBuildProperties(build2, properties);
- //bug 269122
+ // bug 269122
StringBuffer customBuffer = new StringBuffer();
- customBuffer.append("<project name=\"custom\" default=\"noDefault\"> \n");
- customBuffer.append(" <import file=\"${eclipse.pdebuild.templates}/headless-build/customTargets.xml\"/> \n");
- customBuffer.append(" <target name=\"preProcessRepos\"> \n");
- customBuffer.append(" <echo message=\"pre Process Repos!\" /> \n");
- customBuffer.append(" </target> \n");
- customBuffer.append(" <target name=\"postProcessRepos\"> \n");
- customBuffer.append(" <echo message=\"post Process Repos!\" /> \n");
- customBuffer.append(" </target> \n");
- customBuffer.append("</project> \n");
+ customBuffer
+ .append("<project name=\"custom\" default=\"noDefault\"> \n");
+ customBuffer
+ .append(" <import file=\"${eclipse.pdebuild.templates}/headless-build/customTargets.xml\"/> \n");
+ customBuffer
+ .append(" <target name=\"preProcessRepos\"> \n");
+ customBuffer
+ .append(" <echo message=\"pre Process Repos!\" /> \n");
+ customBuffer
+ .append(" </target> \n");
+ customBuffer
+ .append(" <target name=\"postProcessRepos\"> \n");
+ customBuffer
+ .append(" <echo message=\"post Process Repos!\" /> \n");
+ customBuffer
+ .append(" </target> \n");
+ customBuffer
+ .append("</project> \n");
Utils.writeBuffer(build2.getFile("customTargets.xml"), customBuffer);
- //bug 269122
+ // bug 269122
customBuffer = new StringBuffer();
- customBuffer.append("<project name=\"custom\" default=\"noDefault\"> \n");
- customBuffer.append(" <import file=\"${eclipse.pdebuild.templates}/headless-build/customAssembly.xml\"/> \n");
- customBuffer.append(" <target name=\"post.gather.bin.parts\"> \n");
- customBuffer.append(" <echo message=\"post bin parts!\" /> \n");
- customBuffer.append(" </target> \n");
- customBuffer.append("</project> \n");
+ customBuffer
+ .append("<project name=\"custom\" default=\"noDefault\"> \n");
+ customBuffer
+ .append(" <import file=\"${eclipse.pdebuild.templates}/headless-build/customAssembly.xml\"/> \n");
+ customBuffer
+ .append(" <target name=\"post.gather.bin.parts\"> \n");
+ customBuffer
+ .append(" <echo message=\"post bin parts!\" /> \n");
+ customBuffer
+ .append(" </target> \n");
+ customBuffer
+ .append("</project> \n");
Utils.writeBuffer(build2.getFile("customAssembly.xml"), customBuffer);
runBuild(build2);
IFile log = build2.getFile("log.log");
- assertLogContainsLines(log, new String[] {"pre Process Repos!", "post Process Repos!"});
- assertLogContainsLines(log, new String[] {"post bin parts!"});
+ assertLogContainsLines(log, new String[] { "pre Process Repos!", "post Process Repos!" });
+ assertLogContainsLines(log, new String[] { "post bin parts!" });
- //reusing the metadata from part 1
- uri = URIUtil.fromString("file:" + build2.getFolder("I.TestBuild/f-TestBuild-group.group.group.zip").getLocation().toOSString());
+ // reusing the metadata from part 1
+ uri = URIUtil.fromString(
+ "file:" + build2.getFolder("I.TestBuild/f-TestBuild-group.group.group.zip").getLocation().toOSString());
repo = loadMetadataRepository(URIUtil.toJarURI(uri, new Path("")));
iuB = getIU(repo, "b");
@@ -1076,11 +1140,12 @@ public class PublishingTests extends P2TestCase {
public void testBug267461_2() throws Exception {
IFolder buildFolder = newTest("267461_2");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
IFile productFile = buildFolder.getFile("rcp.product");
- Utils.generateProduct(productFile, "uid.product", "rcp.product", "1.0.0.qualifier", "my.app", null, new String[] {OSGI, SIMPLE_CONFIGURATOR}, false, null);
+ Utils.generateProduct(productFile, "uid.product", "rcp.product", "1.0.0.qualifier", "my.app", null,
+ new String[] { OSGI, SIMPLE_CONFIGURATOR }, false, null);
Properties p2Inf = new Properties(); // bug 268223
p2Inf.put("org.eclipse.pde.build.append.launchers", "false");
Utils.storeProperties(buildFolder.getFile("p2.inf"), p2Inf);
@@ -1088,17 +1153,19 @@ public class PublishingTests extends P2TestCase {
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("configs", "win32,win32,x86");
properties.put("archivesFormat", "win32,win32,x86-folder");
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executable.getAbsolutePath());
properties.put("product", productFile.getLocation().toOSString());
properties.put("p2.gathering", "true");
- properties.put("p2.product.qualifier", "I10232"); //bug 246060
+ properties.put("p2.product.qualifier", "I10232"); // bug 246060
Utils.storeBuildProperties(buildFolder, properties);
runProductBuild(buildFolder);
- assertLogContainsLine(buildFolder.getFile("tmp/eclipse/configuration/config.ini"), "eclipse.product=rcp.product");
- assertLogContainsLine(buildFolder.getFile("tmp/eclipse/configuration/config.ini"), "eclipse.application=my.app");
+ assertLogContainsLine(buildFolder.getFile("tmp/eclipse/configuration/config.ini"),
+ "eclipse.product=rcp.product");
+ assertLogContainsLine(buildFolder.getFile("tmp/eclipse/configuration/config.ini"),
+ "eclipse.application=my.app");
IFolder repo = Utils.createFolder(buildFolder, "buildRepo");
IMetadataRepository metadata = loadMetadataRepository("file:" + repo.getLocation().toOSString());
@@ -1118,25 +1185,26 @@ public class PublishingTests extends P2TestCase {
public void testBug267972() throws Exception {
IFolder buildFolder = newTest("267972");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
IFile productFile = buildFolder.getFile("rcp.product");
- Utils.generateProduct(productFile, "rcp.product", "1.0.0.qualifier", new String[] {OSGI, EQUINOX_COMMON, "org.eclipse.swt", "org.eclipse.swt.win32.win32.x86", "org.eclipse.swt.gtk.linux.x86"}, false);
+ Utils.generateProduct(productFile, "rcp.product", "1.0.0.qualifier", new String[] { OSGI, EQUINOX_COMMON,
+ "org.eclipse.swt", "org.eclipse.swt.win32.win32.x86", "org.eclipse.swt.gtk.linux.x86" }, false);
Properties p2Inf = new Properties(); // bug 268223
p2Inf.put("org.eclipse.pde.build.append.startlevels", "false");
Utils.storeProperties(buildFolder.getFile("p2.inf"), p2Inf);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("configs", "win32,win32,x86");
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executable.getAbsolutePath());
properties.put("product", productFile.getLocation().toOSString());
properties.put("filteredDependencyCheck", "true");
- properties.put("includeLaunchers", "false"); //bug 268119
+ properties.put("includeLaunchers", "false"); // bug 268119
properties.put("p2.gathering", "true");
- properties.put("forceContextQualifier", "v1234"); //bug 246060
- properties.put("skipDirector", "true"); //bug 271141
+ properties.put("forceContextQualifier", "v1234"); // bug 246060
+ properties.put("skipDirector", "true"); // bug 271141
properties.put("skipMirroring", "true");
properties.put("p2.metadata.repo", "file:" + buildFolder.getFolder("finalRepo").getLocation().toOSString());
properties.put("p2.artifact.repo", "file:" + buildFolder.getFolder("finalRepo").getLocation().toOSString());
@@ -1146,14 +1214,14 @@ public class PublishingTests extends P2TestCase {
IFolder repo = Utils.createFolder(buildFolder, "buildRepo");
URI repoURI = URIUtil.fromString("file:" + repo.getLocation().toOSString());
- assertManagerDoesntContain(repoURI); //bug 268867
+ assertManagerDoesntContain(repoURI); // bug 268867
IMetadataRepository metadata = loadMetadataRepository(repoURI);
IInstallableUnit iu = getIU(metadata, "rcp.product");
assertEquals(iu.getVersion().toString(), "1.0.0.v1234");
assertNull(getIU(metadata, "toolingorg.eclipse.equinox.common", false));
- //bug 271141
+ // bug 271141
assertFalse(buildFolder.getFile("I.TestBuild/eclipse-win32.win32.x86.zip").exists());
assertFalse(buildFolder.getFolder("finalRepo").exists());
}
@@ -1164,13 +1232,13 @@ public class PublishingTests extends P2TestCase {
IFolder f = Utils.createFolder(buildFolder, "features/f");
IFolder e = Utils.createFolder(buildFolder, "features/e");
- Utils.generateFeature(buildFolder, "f", new String[] {"e", "e.source"}, null);
+ Utils.generateFeature(buildFolder, "f", new String[] { "e", "e.source" }, null);
Properties properties = new Properties();
properties.put("generate.feature@e.source", "e");
properties.put("individualSourceBundles", "true");
Utils.storeBuildProperties(f, properties);
- Utils.generateFeature(buildFolder, "e", null, new String[] {"e"});
+ Utils.generateFeature(buildFolder, "e", null, new String[] { "e" });
Utils.writeBuffer(e.getFile("sourceTemplatePlugin/license.html"), new StringBuffer("important stuff!\n"));
Utils.generateBundle(bundle, "e");
@@ -1182,7 +1250,7 @@ public class PublishingTests extends P2TestCase {
properties.put("topLevelElementId", "f");
properties.put("p2.gathering", "true");
properties.put("archivesFormat", "group,group,group-folder");
- properties.put("skipMirroring", "true"); //bug 271114
+ properties.put("skipMirroring", "true"); // bug 271114
Utils.storeBuildProperties(buildFolder, properties);
runBuild(buildFolder);
@@ -1225,7 +1293,7 @@ public class PublishingTests extends P2TestCase {
buffer.append("</project> \n");
Utils.writeBuffer(f.getFile("customBuildCallbacks.xml"), buffer);
- //bug 270894
+ // bug 270894
buffer = new StringBuffer();
buffer.append("<site> \n");
buffer.append(" <feature url=\"features/f_1.0.0.qualifier.jar\" id=\"f\" version=\"1.0.0.qualifier\"> \n");
@@ -1236,7 +1304,7 @@ public class PublishingTests extends P2TestCase {
IFile siteXML = buildFolder.getFile("site.xml");
Utils.writeBuffer(siteXML, buffer);
- //bug 272362
+ // bug 272362
IFile categoryXML = buildFolder.getFile("category.xml");
String categoryString = buffer.toString();
categoryString = categoryString.replaceAll("new_category_1", "new_category_2");
@@ -1296,7 +1364,8 @@ public class PublishingTests extends P2TestCase {
IFolder build2 = Utils.createFolder(buildFolder, "../build2");
IFile productFile = build2.getFile("rcp.product");
- Utils.generateProduct(productFile, "rcp.product", "1.0.0", null, "rcp", new String[] {OSGI, EQUINOX_COMMON}, false, null);
+ Utils.generateProduct(productFile, "rcp.product", "1.0.0", null, "rcp", new String[] { OSGI, EQUINOX_COMMON },
+ false, null);
properties = BuildConfiguration.getBuilderProperties(build2);
properties.put("configs", "win32,win32,x86 & linux,gtk,x86 & macosx,carbon,ppc");
@@ -1305,7 +1374,7 @@ public class PublishingTests extends P2TestCase {
properties.put("p2.gathering", "true");
properties.put("skipDirector", "true");
properties.put("skipMirroring", "true");
- //this tests bug 269361
+ // this tests bug 269361
properties.put("repoBaseLocation", buildFolder.getFolder("tmp").getLocation().toOSString());
properties.put("transformedRepoLocation", build2.getFolder("transformed").getLocation().toOSString());
@@ -1320,7 +1389,8 @@ public class PublishingTests extends P2TestCase {
assertRequires(iu, "org.eclipse.equinox.p2.iu", "org.eclipse.equinox.executable_root.win32.win32.x86");
assertRequires(iu, "org.eclipse.equinox.p2.iu", "org.eclipse.equinox.executable_root.gtk.linux.x86");
assertRequires(iu, "org.eclipse.equinox.p2.iu", "org.eclipse.equinox.executable_root.carbon.macosx.ppc");
- //bug 273059, the action will be written out of a map, so there is no order on the parameters
+ // bug 273059, the action will be written out of a map, so there is no order on
+ // the parameters
iu = getIU(metadata, "rcp.product_root.carbon.macosx.ppc");
assertResourceFile(repo, "binary/org.eclipse.equinox.executable_root.win32.win32.x86_3.3.200");
@@ -1334,7 +1404,7 @@ public class PublishingTests extends P2TestCase {
IFolder buildFolder = newTest("269972");
IFolder a = Utils.createFolder(buildFolder, "plugins/a");
IFolder b = Utils.createFolder(buildFolder, "plugins/b");
- Utils.generateFeature(buildFolder, "f", null, new String[] {"a;unpack=false", "b;unpack=false"});
+ Utils.generateFeature(buildFolder, "f", null, new String[] { "a;unpack=false", "b;unpack=false" });
Utils.generateBundle(a, "a");
Utils.writeBuffer(a.getFile("src/A.java"), new StringBuffer("public class A { int i; ds }"));
@@ -1368,9 +1438,9 @@ public class PublishingTests extends P2TestCase {
IFolder a = Utils.createFolder(build1, "plugins/a");
IFolder b = Utils.createFolder(build1, "plugins/b");
- Utils.generateFeature(build1, "f1", new String[] {"f2"}, new String[] {"a"});
+ Utils.generateFeature(build1, "f1", new String[] { "f2" }, new String[] { "a" });
- Utils.generateFeature(build1, "f2", null, new String[] {"b"});
+ Utils.generateFeature(build1, "f2", null, new String[] { "b" });
StringBuffer p2Inf = new StringBuffer();
P2InfUtils.printRequires(p2Inf, null, 1, P2InfUtils.NAMESPACE_IU, "a", "[1.0.0,1.0.0]", null, true);
Utils.writeBuffer(build1.getFile("features/f2/p2.inf"), p2Inf);
@@ -1389,7 +1459,8 @@ public class PublishingTests extends P2TestCase {
Utils.storeBuildProperties(build1, properties);
runBuild(build1);
- URI repoURI = URIUtil.fromString("file:" + build1.getFile("I.TestBuild/f1-TestBuild-group.group.group.zip").getLocation().toOSString());
+ URI repoURI = URIUtil.fromString(
+ "file:" + build1.getFile("I.TestBuild/f1-TestBuild-group.group.group.zip").getLocation().toOSString());
IMetadataRepository metadata = loadMetadataRepository(URIUtil.toJarURI(repoURI, null));
IInstallableUnit iu = getIU(metadata, "f2.feature.group");
@@ -1397,7 +1468,7 @@ public class PublishingTests extends P2TestCase {
IFolder build2 = Utils.createFolder(root, "build2");
- Utils.generateFeature(build2, "f3", new String[] {"f2"}, null);
+ Utils.generateFeature(build2, "f3", new String[] { "f2" }, null);
properties = BuildConfiguration.getBuilderProperties(build2);
properties.put("topLevelElementId", "f3");
properties.put("p2.gathering", "true");
@@ -1406,16 +1477,17 @@ public class PublishingTests extends P2TestCase {
Utils.storeBuildProperties(build2, properties);
runBuild(build2);
- //bug 272219
+ // bug 272219
assertResourceFile(build2.getFolder("transformed"), "binary/f2_root_1.0.0");
- repoURI = URIUtil.fromString("file:" + build2.getFile("I.TestBuild/f3-TestBuild-group.group.group.zip").getLocation().toOSString());
+ repoURI = URIUtil.fromString(
+ "file:" + build2.getFile("I.TestBuild/f3-TestBuild-group.group.group.zip").getLocation().toOSString());
metadata = loadMetadataRepository(URIUtil.toJarURI(repoURI, null));
iu = getIU(metadata, "f2.feature.group");
assertRequires(iu, P2InfUtils.NAMESPACE_IU, "a");
getIU(metadata, "a");
- getIU(metadata, "f2_root"); //bug 271848, mirroring from context
+ getIU(metadata, "f2_root"); // bug 271848, mirroring from context
assertResourceFile(build2, "buildRepo/binary/f2_root_1.0.0");
metadata = null;
@@ -1426,22 +1498,22 @@ public class PublishingTests extends P2TestCase {
IFolder buildFolder = newTest("featureBasedProduct");
IFolder finalRepo = Utils.createFolder(buildFolder, "final");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
- Utils.generateFeature(buildFolder, "f", null, new String[] {OSGI, EQUINOX_COMMON});
+ Utils.generateFeature(buildFolder, "f", null, new String[] { OSGI, EQUINOX_COMMON });
Utils.writeBuffer(buildFolder.getFile("features/f/important.txt"), new StringBuffer("boo-urns"));
Properties properties = new Properties();
properties.put("bin.includes", "feature.xml");
- properties.put("root.folder.sub", "file:important.txt"); //bug 272392
+ properties.put("root.folder.sub", "file:important.txt"); // bug 272392
Utils.storeBuildProperties(buildFolder.getFolder("features/f"), properties);
IFile productFile = buildFolder.getFile("rcp.product");
- Utils.generateProduct(productFile, "rcp.product", "1.0.0", new String[] {"f"}, true);
+ Utils.generateProduct(productFile, "rcp.product", "1.0.0", new String[] { "f" }, true);
properties = BuildConfiguration.getBuilderProperties(buildFolder);
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executable.getAbsolutePath());
properties.put("configs", "win32,win32,x86");
properties.put("product", productFile.getLocation().toOSString());
properties.put("filteredDependencyCheck", "true");
@@ -1450,19 +1522,30 @@ public class PublishingTests extends P2TestCase {
properties.put("p2.build.repo", "file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString());
Utils.storeBuildProperties(buildFolder, properties);
- //bug 269523
+ // bug 269523
StringBuffer customBuffer = new StringBuffer();
- customBuffer.append("<project name=\"custom\" default=\"noDefault\"> \n");
- customBuffer.append(" <import file=\"${eclipse.pdebuild.templates}/headless-build/customTargets.xml\"/> \n");
- customBuffer.append(" <target name=\"postBuild\"> \n");
- customBuffer.append(" <p2.mirror destination=\"" + finalRepo.getLocation().toOSString() + "\" \n");
- customBuffer.append(" source=\"${p2.build.repo}\" > \n");
- customBuffer.append(" <slicingOptions platformFilter=\"win32,win32,x86\" \n");
- customBuffer.append(" followStrict=\"true\" /> \n");
- customBuffer.append(" <iu id=\"rcp.product\" version=\"1.0.0\" /> \n");
- customBuffer.append(" </p2.mirror> \n");
- customBuffer.append(" </target> \n");
- customBuffer.append("</project> \n");
+ customBuffer
+ .append("<project name=\"custom\" default=\"noDefault\"> \n");
+ customBuffer
+ .append(" <import file=\"${eclipse.pdebuild.templates}/headless-build/customTargets.xml\"/> \n");
+ customBuffer
+ .append(" <target name=\"postBuild\"> \n");
+ customBuffer
+ .append(" <p2.mirror destination=\"" + finalRepo.getLocation().toOSString() + "\" \n");
+ customBuffer
+ .append(" source=\"${p2.build.repo}\" > \n");
+ customBuffer
+ .append(" <slicingOptions platformFilter=\"win32,win32,x86\" \n");
+ customBuffer
+ .append(" followStrict=\"true\" /> \n");
+ customBuffer
+ .append(" <iu id=\"rcp.product\" version=\"1.0.0\" /> \n");
+ customBuffer
+ .append(" </p2.mirror> \n");
+ customBuffer
+ .append(" </target> \n");
+ customBuffer
+ .append("</project> \n");
Utils.writeBuffer(buildFolder.getFile("customTargets.xml"), customBuffer);
runProductBuild(buildFolder);
@@ -1480,11 +1563,12 @@ public class PublishingTests extends P2TestCase {
public void testDirectorLogging() throws Exception {
IFolder buildFolder = newTest("directorLogging");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
IFile productFile = buildFolder.getFile("rcp.product");
- Utils.generateProduct(productFile, "uid.product", "rcp.product", "1.0.0.qualifier", "my.app", null, new String[] {OSGI, SIMPLE_CONFIGURATOR}, false, null);
+ Utils.generateProduct(productFile, "uid.product", "rcp.product", "1.0.0.qualifier", "my.app", null,
+ new String[] { OSGI, SIMPLE_CONFIGURATOR }, false, null);
Properties p2Inf = new Properties(); // bug 268223
p2Inf.put("requires.1.namespace", "foo");
p2Inf.put("requires.1.name", "bar");
@@ -1493,10 +1577,10 @@ public class PublishingTests extends P2TestCase {
Utils.storeProperties(buildFolder.getFile("p2.inf"), p2Inf);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
- properties.put("configs", "win32,win32,x86");
- properties.put("archivesFormat", "win32,win32,x86-folder");
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
+ properties.put("configs", "gtk,linux,x86_64");
+ properties.put("archivesFormat", "gtk,linux,x86_64-folder");
+ if (!executable.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executable.getAbsolutePath());
properties.put("product", productFile.getLocation().toOSString());
properties.put("p2.gathering", "true");
properties.put("p2.product.qualifier", "I10232");
@@ -1510,7 +1594,8 @@ public class PublishingTests extends P2TestCase {
assertTrue(e.getMessage().indexOf("A problem occured while invoking the director") > -1);
}
- assertLogContainsLines(buildFolder.getFile("director.log"), new String[] {"Installation failed.", "Missing requirement: rcp.product 1.0.0.I10232 (uid.product 1.0.0.I10232) requires 'foo bar [1.0.0]' but it could not be found"});
+ assertLogContainsLines(buildFolder.getFile("director.log"), new String[] { "Installation failed.",
+ "Missing requirement: rcp.product 1.0.0.I10232 (uid.product 1.0.0.I10232) requires 'foo bar [1.0.0]' but it could not be found" });
}
public void testBug272907() throws Exception {
@@ -1527,12 +1612,12 @@ public class PublishingTests extends P2TestCase {
Utils.writeBuffer(foo.getFile("src/foo.java"), new StringBuffer("public class foo { int i; }"));
Utils.writeBuffer(foo.getFile("src2/foob.java"), new StringBuffer("public class foob { int i; }"));
- Utils.generateFeature(buildFolder, "f", null, new String[] {"foo"});
+ Utils.generateFeature(buildFolder, "f", null, new String[] { "foo" });
buildProperties = new Properties();
buildProperties.put("bin.includes", "feature.xml");
Utils.storeBuildProperties(f, buildProperties);
- //bug 274702
+ // bug 274702
StringBuffer buffer = new StringBuffer();
buffer.append("requires.0.namespace=org.eclipse.equinox.p2.iu \n");
buffer.append("requires.0.name=testid0 \n");
@@ -1572,25 +1657,32 @@ public class PublishingTests extends P2TestCase {
IFolder buildFolder = newTest("268498");
IFolder rcp = Utils.createFolder(buildFolder, "rcp");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
IFile product = rcp.getFile("rcp.product");
StringBuffer extra = new StringBuffer();
- extra.append("<launcherArgs> \n");
- extra.append(" <programArgsMac>-vm myVm -showsplash org.eclipse.platform</programArgsMac> \n");
- extra.append(" <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac> \n");
- extra.append(" </launcherArgs> \n");
- extra.append(" <configurations> \n");
+ extra.append(
+ "<launcherArgs> \n");
+ extra.append(
+ " <programArgsMac>-vm myVm -showsplash org.eclipse.platform</programArgsMac> \n");
+ extra.append(
+ " <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac> \n");
+ extra.append(
+ " </launcherArgs> \n");
+ extra.append(
+ " <configurations> \n");
extra.append(" <plugin id=\"" + EQUINOX_COMMON + "\" autoStart=\"true\" startLevel=\"2\" /> \n");
- extra.append(" </configurations> \n");
- Utils.generateProduct(product, "org.example.rcp", "1.0.0", null, new String[] {OSGI, EQUINOX_COMMON}, false, extra);
+ extra.append(
+ " </configurations> \n");
+ Utils.generateProduct(product, "org.example.rcp", "1.0.0", null, new String[] { OSGI, EQUINOX_COMMON }, false,
+ extra);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("archivePrefix", "Eclipse.app");
properties.put("product", product.getLocation().toOSString());
- if (!delta.equals(new File((String) properties.get("baseLocation"))))
- properties.put("pluginPath", delta.getAbsolutePath());
+ if (!executable.equals(new File((String) properties.get("baseLocation"))))
+ properties.put("pluginPath", executable.getAbsolutePath());
properties.put("configs", "macosx, cocoa, x86_64");
properties.put("p2.gathering", "true");
Utils.storeBuildProperties(buildFolder, properties);
@@ -1599,30 +1691,33 @@ public class PublishingTests extends P2TestCase {
IFile ini = buildFolder.getFile("eclipse.ini");
boolean lowerCase = true;
- if (!Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-macosx.cocoa.x86_64.zip", "eclipse.app/Contents/Eclipse/eclipse.ini", ini)) {
+ if (!Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-macosx.cocoa.x86_64.zip",
+ "eclipse.app/Contents/Eclipse/eclipse.ini", ini)) {
lowerCase = false;
- Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-macosx.cocoa.x86_64.zip", "Eclipse.app/Contents/Eclipse/eclipse.ini", ini);
+ Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-macosx.cocoa.x86_64.zip",
+ "Eclipse.app/Contents/Eclipse/eclipse.ini", ini);
}
IFile zip = buildFolder.getFile("I.TestBuild/eclipse-macosx.cocoa.x86_64.zip");
String exeString = (lowerCase ? "eclipse.app/" : "Eclipse.app/") + "Contents/MacOS/eclipse";
assertZipPermissions(zip, exeString, "-rwxr-xr-x");
- assertLogContainsLines(ini, new String[] {"-vm", "myVm"});
+ assertLogContainsLines(ini, new String[] { "-vm", "myVm" });
boolean duplicate = false;
try {
- assertLogContainsLines(ini, new String[] {"-XstartOnFirstThread", "-XstartOnFirstThread"});
+ assertLogContainsLines(ini, new String[] { "-XstartOnFirstThread", "-XstartOnFirstThread" });
duplicate = true;
} catch (Error e) {
- //expected
+ // expected
}
assertFalse(duplicate);
try {
- assertLogContainsLines(ini, new String[] {"-showSplash", "org.eclipse.platform", "-showSplash", "org.eclipse.platform"});
+ assertLogContainsLines(ini,
+ new String[] { "-showSplash", "org.eclipse.platform", "-showSplash", "org.eclipse.platform" });
duplicate = true;
} catch (Error e) {
- //expected
+ // expected
}
assertFalse(duplicate);
@@ -1646,11 +1741,11 @@ public class PublishingTests extends P2TestCase {
IFolder buildFolder = newTest("infConfig");
IFolder rcp = Utils.createFolder(buildFolder, "rcp");
- File delta = Utils.findDeltaPack();
- assertNotNull(delta);
+ File executable = Utils.findExecutable();
+ assertNotNull(executable);
IFile product = rcp.getFile("rcp.product");
- Utils.generateProduct(product, "org.example.rcp", "1.0.0", null, new String[] {OSGI}, false, null);
+ Utils.generateProduct(product, "org.example.rcp", "1.0.0", null, new String[] { OSGI }, false, null);
StringBuffer inf = new StringBuffer();
inf.append("requires.1.namespace=org.eclipse.equinox.p2.iu \n");
@@ -1671,8 +1766,10 @@ public class PublishingTests extends P2TestCase {
inf.append("units.1.filter=(osgi.os=macosx) \n");
inf.append("units.1.touchpoint.id=org.eclipse.equinox.p2.osgi \n");
inf.append("units.1.touchpoint.version=1.0.0 \n");
- inf.append("units.1.instructions.configure=setProgramProperty(propName:osgi.instance.area.default,propValue:@user.home/Documents/workspace);\n");
- inf.append("units.1.instructions.unconfigure=setProgramProperty(propName:osgi.instance.area.default,propValue:);\n");
+ inf.append(
+ "units.1.instructions.configure=setProgramProperty(propName:osgi.instance.area.default,propValue:@user.home/Documents/workspace);\n");
+ inf.append(
+ "units.1.instructions.unconfigure=setProgramProperty(propName:osgi.instance.area.default,propValue:);\n");
inf.append("units.2.id=toolingorg.eclipse.configuration \n");
inf.append("units.2.version=1.0.0 \n");
inf.append("units.2.provides.1.namespace=org.eclipse.equinox.p2.iu \n");
@@ -1681,8 +1778,10 @@ public class PublishingTests extends P2TestCase {
inf.append("units.2.filter=(!(osgi.os=macosx)) \n");
inf.append("units.2.touchpoint.id=org.eclipse.equinox.p2.osgi \n");
inf.append("units.2.touchpoint.version=1.0.0 \n");
- inf.append("units.2.instructions.configure=setProgramProperty(propName:osgi.instance.area.default,propValue:@user.home/workspace);\n");
- inf.append("units.2.instructions.unconfigure=setProgramProperty(propName:osgi.instance.area.default,propValue:);\n");
+ inf.append(
+ "units.2.instructions.configure=setProgramProperty(propName:osgi.instance.area.default,propValue:@user.home/workspace);\n");
+ inf.append(
+ "units.2.instructions.unconfigure=setProgramProperty(propName:osgi.instance.area.default,propValue:);\n");
Utils.writeBuffer(rcp.getFile("p2.inf"), inf);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
@@ -1695,13 +1794,16 @@ public class PublishingTests extends P2TestCase {
runProductBuild(buildFolder);
IFile ini = buildFolder.getFile("config-mac.ini");
- Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-macosx.carbon.ppc.zip", "eclipse/configuration/config.ini", ini);
+ Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-macosx.carbon.ppc.zip",
+ "eclipse/configuration/config.ini", ini);
assertLogContainsLine(ini, "osgi.instance.area.default=@user.home/Documents/workspace");
ini = buildFolder.getFile("config-mac2.ini");
- Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-macosx.cocoa.x86.zip", "eclipse/configuration/config.ini", ini);
+ Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-macosx.cocoa.x86.zip",
+ "eclipse/configuration/config.ini", ini);
assertLogContainsLine(ini, "osgi.instance.area.default=@user.home/Documents/workspace");
ini = buildFolder.getFile("config-win32.ini");
- Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-win32.win32.x86.zip", "eclipse/configuration/config.ini", ini);
+ Utils.extractFromZip(buildFolder, "I.TestBuild/eclipse-win32.win32.x86.zip", "eclipse/configuration/config.ini",
+ ini);
assertLogContainsLine(ini, "osgi.instance.area.default=@user.home/workspace");
}
@@ -1722,8 +1824,9 @@ public class PublishingTests extends P2TestCase {
extra.append(" <linux>/bundle/config.ini</linux>\n");
extra.append(" <macosx>/bundle/config.ini</macosx>\n");
extra.append("</configIni>\n");
- String[] entries = new String[] {EQUINOX_COMMON, OSGI, EQUINOX_APP, EQUINOX_REGISTRY};
- Utils.generateProduct(product, "bun.dle.pro.duct", "bundle.product", "1.0.0", null, null, entries, false, extra);
+ String[] entries = new String[] { EQUINOX_COMMON, OSGI, EQUINOX_APP, EQUINOX_REGISTRY };
+ Utils.generateProduct(product, "bun.dle.pro.duct", "bundle.product", "1.0.0", null, null, entries, false,
+ extra);
String configString = Platform.getOS() + ',' + Platform.getWS() + ',' + Platform.getOSArch();
Properties buildProperties = BuildConfiguration.getBuilderProperties(buildFolder);
@@ -1737,7 +1840,7 @@ public class PublishingTests extends P2TestCase {
runProductBuild(buildFolder);
IFolder productFolder = buildFolder.getFolder("features/org.eclipse.pde.build.container.feature/product");
- //check we copied the config.ini file
+ // check we copied the config.ini file
assertResourceFile(productFolder.getFile("bundle/config.ini"));
URI repoURI = URIUtil.fromString("file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString());
@@ -1762,14 +1865,15 @@ public class PublishingTests extends P2TestCase {
IFolder F = Utils.createFolder(buildFolder, "features/F");
IFolder rcp = Utils.createFolder(buildFolder, "rcp");
- String[] bundles = new String[] {OSGI, EQUINOX_COMMON, CORE_JOBS, SIMPLE_CONFIGURATOR};
+ String[] bundles = new String[] { OSGI, EQUINOX_COMMON, CORE_JOBS, SIMPLE_CONFIGURATOR };
String[] bundleVersions = Utils.getVersionsNoQualifier(bundles);
StringBuffer buffer = new StringBuffer();
buffer.append("<feature id=\"F\" version=\"1.0.0\"> \n");
buffer.append(" <requires> \n");
for (int i = 0; i < bundleVersions.length; i++) {
- buffer.append(" <import plugin=\"" + bundles[i] + "\" version=\"" + bundleVersions[i] + "\" match=\"equivalent\" /> \n");
+ buffer.append(" <import plugin=\"" + bundles[i] + "\" version=\"" + bundleVersions[i]
+ + "\" match=\"equivalent\" /> \n");
}
buffer.append(" </requires> \n");
buffer.append("</feature> \n");
@@ -1780,11 +1884,15 @@ public class PublishingTests extends P2TestCase {
IFile product = rcp.getFile("rcp.product");
StringBuffer extra = new StringBuffer();
- extra.append(" <configurations> \n");
- extra.append(" <plugin id=\"" + EQUINOX_COMMON + "\" autoStart=\"true\" startLevel=\"2\" /> \n");
- extra.append(" <plugin id=\"org.eclipse.equinox.simpleconfigurator\" autoStart=\"true\" startLevel=\"1\" /> \n");
- extra.append(" </configurations> \n");
- Utils.generateProduct(product, "org.example.rcp", "1.0.0", null, new String[] {"F"}, true, extra);
+ extra.append(
+ " <configurations> \n");
+ extra.append(
+ " <plugin id=\"" + EQUINOX_COMMON + "\" autoStart=\"true\" startLevel=\"2\" /> \n");
+ extra.append(
+ " <plugin id=\"org.eclipse.equinox.simpleconfigurator\" autoStart=\"true\" startLevel=\"1\" /> \n");
+ extra.append(
+ " </configurations> \n");
+ Utils.generateProduct(product, "org.example.rcp", "1.0.0", null, new String[] { "F" }, true, extra);
properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", product.getLocation().toOSString());
@@ -1792,16 +1900,18 @@ public class PublishingTests extends P2TestCase {
properties.put("configs", "win32,win32,x86");
properties.put("archivesFormat", "win32,win32,x86-folder");
properties.put("p2.gathering", "true");
- properties.put("p2.context.repos", URIUtil.toUnencodedString(createCompositeFromBase(buildFolder.getFolder("context"))));
+ properties.put("p2.context.repos",
+ URIUtil.toUnencodedString(createCompositeFromBase(buildFolder.getFolder("context"))));
Utils.storeBuildProperties(buildFolder, properties);
runProductBuild(buildFolder);
- IFile bundlesInfo = buildFolder.getFile("tmp/eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info");
+ IFile bundlesInfo = buildFolder
+ .getFile("tmp/eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info");
assertResourceFile(bundlesInfo);
assertLogContainsLine(bundlesInfo, ",2,true");
- //bug 283091
+ // bug 283091
IMetadataRepository meta = loadMetadataRepository(buildFolder.getFolder("buildRepo").getLocationURI());
assertNull(getIU(meta, EQUINOX_APP, false));
}
@@ -1809,10 +1919,10 @@ public class PublishingTests extends P2TestCase {
public void testBug284499() throws Exception {
IFolder buildFolder = newTest("284499");
- Utils.generateFeature(buildFolder, "f", null, new String[] {OSGI, EQUINOX_COMMON});
+ Utils.generateFeature(buildFolder, "f", null, new String[] { OSGI, EQUINOX_COMMON });
IFile product = buildFolder.getFile("foo.product");
- Utils.generateProduct(product, "foo", "1.0.0", null, new String[] {"f"}, true);
+ Utils.generateProduct(product, "foo", "1.0.0", null, new String[] { "f" }, true);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", product.getLocation().toOSString());
@@ -1840,7 +1950,8 @@ public class PublishingTests extends P2TestCase {
Utils.generateBundle(A2, "a", "2.0.0.qualifier");
IFile product = buildFolder.getFile("foo.product");
- Utils.generateProduct(product, "foo", "1.0.0", new String[] {"a;version=1.0.0.qualifier", "a;version=2.0.0.qualifier"}, false);
+ Utils.generateProduct(product, "foo", "1.0.0",
+ new String[] { "a;version=1.0.0.qualifier", "a;version=2.0.0.qualifier" }, false);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", product.getLocation().toOSString());
@@ -1859,7 +1970,8 @@ public class PublishingTests extends P2TestCase {
if (reqCap.getName().equals("a")) {
VersionRange range = reqCap.getRange();
assertTrue(PublisherHelper.toOSGiVersion(range.getMinimum()).getQualifier().startsWith("20"));
- assertTrue(PublisherHelper.toOSGiVersion(range.getMinimum()).getMajor() == 1 || PublisherHelper.toOSGiVersion(range.getMinimum()).getMajor() == 2);
+ assertTrue(PublisherHelper.toOSGiVersion(range.getMinimum()).getMajor() == 1
+ || PublisherHelper.toOSGiVersion(range.getMinimum()).getMajor() == 2);
}
}
}
@@ -1867,7 +1979,7 @@ public class PublishingTests extends P2TestCase {
public void testBug307157() throws Exception {
IFolder buildFolder = newTest("307157");
- Utils.generateFeature(buildFolder, "F", new String[] {"F1", "F2"}, null);
+ Utils.generateFeature(buildFolder, "F", new String[] { "F1", "F2" }, null);
Utils.generateFeature(buildFolder, "F1", null, null);
Utils.generateFeature(buildFolder, "F2", null, null);
@@ -1903,7 +2015,7 @@ public class PublishingTests extends P2TestCase {
public void testBug271373() throws Exception {
IFolder buildFolder = newTest("271373_publisher");
- Utils.generateFeature(buildFolder, "F", null, new String[] {"A;os=win32,linux;unpack=false"});
+ Utils.generateFeature(buildFolder, "F", null, new String[] { "A;os=win32,linux;unpack=false" });
IFolder A = Utils.createFolder(buildFolder, "plugins/A");
Attributes manifestAdditions = new Attributes();
@@ -1913,7 +2025,7 @@ public class PublishingTests extends P2TestCase {
Utils.writeBuffer(A.getFile("src/foo.java"), new StringBuffer("public class foo { int i; }"));
IFile product = buildFolder.getFile("foo.product");
- Utils.generateProduct(product, "foo.product", "1.0.0", new String[] {"F"}, true);
+ Utils.generateProduct(product, "foo.product", "1.0.0", new String[] { "F" }, true);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", product.getLocation().toOSString());
@@ -1934,11 +2046,11 @@ public class PublishingTests extends P2TestCase {
IFolder A_2 = Utils.createFolder(buildFolder, "plugins/A_2");
IFile productFile = buildFolder.getFile("product.product");
- Utils.generateFeature(buildFolder, "F", null, new String[] {"A;version=1"});
+ Utils.generateFeature(buildFolder, "F", null, new String[] { "A;version=1" });
Utils.generateBundle(A_1, "A", "1");
Utils.generateBundle(A_2, "A", "2");
- Utils.generateProduct(productFile, "product", "1.0.0", new String[] {"A"}, false);
+ Utils.generateProduct(productFile, "product", "1.0.0", new String[] { "A" }, false);
Properties properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", productFile.getLocation().toOSString());
@@ -1956,7 +2068,7 @@ public class PublishingTests extends P2TestCase {
IFolder A = Utils.createFolder(buildFolder, "plugins/A");
Utils.generateBundle(A, "A", "1");
- Utils.generateFeature(buildFolder, "F", null, new String[] {"A"});
+ Utils.generateFeature(buildFolder, "F", null, new String[] { "A" });
Utils.writeBuffer(F.getFile("file.txt"), new StringBuffer("I'm a file!"));
Utils.writeBuffer(F.getFile("meToo.txt"), new StringBuffer("I'm also a file!"));
@@ -1966,7 +2078,7 @@ public class PublishingTests extends P2TestCase {
Utils.storeBuildProperties(F, properties);
IFile productFile = buildFolder.getFile("product.product");
- Utils.generateProduct(productFile, "product", "1", new String[] {"F"}, true);
+ Utils.generateProduct(productFile, "product", "1", new String[] { "F" }, true);
properties = BuildConfiguration.getBuilderProperties(buildFolder);
properties.put("product", productFile.getLocation().toOSString());
@@ -1987,11 +2099,13 @@ public class PublishingTests extends P2TestCase {
IFolder buildFolder = newTest("329162");
IFolder bundle = Utils.createFolder(buildFolder, "plugins/bundle");
- Utils.writeBuffer(bundle.getFile("src/A.java"), new StringBuffer("import b.B; public class A { B b = new B(); public void Bar(){}}"));
- Utils.writeBuffer(bundle.getFile("src/b/B.java"), new StringBuffer("package b; public class B { public int i = 0; public void Foo(){}}"));
+ Utils.writeBuffer(bundle.getFile("src/A.java"),
+ new StringBuffer("import b.B; public class A { B b = new B(); public void Bar(){}}"));
+ Utils.writeBuffer(bundle.getFile("src/b/B.java"),
+ new StringBuffer("package b; public class B { public int i = 0; public void Foo(){}}"));
Utils.generateBundle(bundle, "bundle");
- Utils.generateFeature(buildFolder, "F", null, new String[] {"bundle", "org.eclipse.osgi"});
+ Utils.generateFeature(buildFolder, "F", null, new String[] { "bundle", "org.eclipse.osgi" });
IFolder templateFolder = Utils.createFolder(buildFolder, "features/template");
StringBuffer buffer = new StringBuffer();