Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java31
2 files changed, 32 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java
index bbb56ea2d..1bfccb8f8 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java
@@ -422,7 +422,7 @@ public class FeaturesAction extends AbstractPublisherAction {
// TODO its not clear when this would ever be false reasonably. Features are always
// supposed to be installed unzipped. It is also not clear what it means to set this prop.
// Anyway, in the future it seems reasonable that features be installed as JARs...
- if (feature.getLocation() != null && !feature.getLocation().endsWith(".jar")) {
+ if (feature.getLocation() == null || !feature.getLocation().endsWith(".jar")) {
Map touchpointData = new HashMap();
touchpointData.put("zipped", "true"); //$NON-NLS-1$ //$NON-NLS-2$
iu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java
index 7b767d572..36afec516 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java
@@ -14,6 +14,7 @@ import java.io.ByteArrayOutputStream;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.Map;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.core.runtime.IStatus;
@@ -464,6 +465,36 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
}
}
+ /**
+ * Tests that the feature jar IU has the appropriate touchpoint instruction for
+ * unzipping the feature on install.
+ */
+ public void testFeatureJarUnzipInstruction() {
+ IMetadataRepositoryManager repoMan = (IMetadataRepositoryManager) ServiceHelper.getService(TestActivator.getContext(), IMetadataRepositoryManager.class.getName());
+ File site = getTestData("0.1", "/testData/updatesite/site");
+ URL location = null;
+ try {
+ location = site.toURL();
+ } catch (MalformedURLException e) {
+ fail("0.99", e);
+ }
+ IMetadataRepository repository;
+ try {
+ repository = repoMan.loadRepository(location, getMonitor());
+ } catch (ProvisionException e) {
+ fail("1.99", e);
+ return;
+ }
+ Collector result = repository.query(new InstallableUnitQuery("test.feature.feature.jar"), new Collector(), getMonitor());
+ assertTrue("1.0", !result.isEmpty());
+ IInstallableUnit unit = (IInstallableUnit) result.iterator().next();
+ TouchpointData[] data = unit.getTouchpointData();
+ assertEquals("1.1", 1, data.length);
+ Map instructions = data[0].getInstructions();
+ assertEquals("1.2", 1, instructions.size());
+ assertEquals("1.3", "true", instructions.get("zipped"));
+ }
+
public void testMirrors() {
// TODO test the case where the site.xml points to a mirror location
}

Back to the top