Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Bull2010-07-12 20:29:16 +0000
committerIan Bull2010-07-12 20:29:16 +0000
commit1f82149ad307bd932a5d1b82cfe130d6728ce1d6 (patch)
tree043562998ca6e9c1c00bc045f80fcda79e350f67 /bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher
parentbfcf6f0013ad4702fbd3e2a5336529aadcc59099 (diff)
downloadrt.equinox.p2-1f82149ad307bd932a5d1b82cfe130d6728ce1d6.tar.gz
rt.equinox.p2-1f82149ad307bd932a5d1b82cfe130d6728ce1d6.tar.xz
rt.equinox.p2-1f82149ad307bd932a5d1b82cfe130d6728ce1d6.zip
bug 279015: Support update descriptor advice in p2.infv20100712-1655
https://bugs.eclipse.org/bugs/show_bug.cgi?id=279015
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AbstractPublisherActionTest.java42
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceFileParserTest.java94
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceMatcher.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java57
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/FeaturesActionTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java4
6 files changed, 194 insertions, 12 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AbstractPublisherActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AbstractPublisherActionTest.java
index 9952f76a0..ab82db039 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AbstractPublisherActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AbstractPublisherActionTest.java
@@ -13,14 +13,16 @@ package org.eclipse.equinox.p2.tests.publisher.actions;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
+import org.eclipse.equinox.internal.p2.metadata.RequiredCapability;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription;
import org.eclipse.equinox.p2.publisher.*;
import org.eclipse.equinox.p2.publisher.actions.ICapabilityAdvice;
+import org.eclipse.equinox.p2.publisher.actions.IUpdateDescriptorAdvice;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.eclipse.equinox.spi.p2.publisher.PublisherHelper;
-public class AbstractPublisherActionTest extends AbstractProvisioningTest {
+public final class AbstractPublisherActionTest extends AbstractProvisioningTest {
//Note: this is tests for AbstractPublisherAction and not a base class for other tests
static class TestAction extends AbstractPublisherAction {
@@ -34,6 +36,26 @@ public class AbstractPublisherActionTest extends AbstractProvisioningTest {
AbstractPublisherAction.processCapabilityAdvice(iu, publisherInfo);
}
+ public void testProcessUpdateDescriptorAdvice(InstallableUnitDescription iu, IPublisherInfo publisherInfo) {
+ AbstractPublisherAction.processUpdateDescriptorAdvice(iu, publisherInfo);
+ }
+ }
+
+ static class TestUpdateDescriptorAdvice implements IUpdateDescriptorAdvice {
+
+ private final IUpdateDescriptor updateDescriptor;
+
+ public TestUpdateDescriptorAdvice(IUpdateDescriptor updateDescriptor) {
+ this.updateDescriptor = updateDescriptor;
+ }
+
+ public boolean isApplicable(String configSpec, boolean includeDefault, String id, Version version) {
+ return id.equals("test");
+ }
+
+ public IUpdateDescriptor getUpdateDescriptor(InstallableUnitDescription iu) {
+ return this.updateDescriptor;
+ }
}
static class TestCapabilityAdvice implements ICapabilityAdvice {
@@ -73,6 +95,24 @@ public class AbstractPublisherActionTest extends AbstractProvisioningTest {
}
}
+ public void testAddUpdateDescriptor() {
+ InstallableUnitDescription iu = new InstallableUnitDescription();
+ iu.setId("test");
+
+ IPublisherInfo info = new PublisherInfo();
+ VersionRange range = new VersionRange("[0.0.0,1.1.1)");
+ IUpdateDescriptor testUpdateDescriptor = MetadataFactory.createUpdateDescriptor("name1", range, 10, "Test Description");
+
+ info.addAdvice(new TestUpdateDescriptorAdvice(testUpdateDescriptor));
+ TestAction action = new TestAction();
+ action.testProcessUpdateDescriptorAdvice(iu, info);
+
+ assertEquals("name1", RequiredCapability.extractName(iu.getUpdateDescriptor().getIUsBeingUpdated().iterator().next()));
+ assertEquals(range, RequiredCapability.extractRange(iu.getUpdateDescriptor().getIUsBeingUpdated().iterator().next()));
+ assertEquals(10, iu.getUpdateDescriptor().getSeverity());
+ assertEquals("Test Description", iu.getUpdateDescriptor().getDescription());
+ }
+
public void testAddCapabilities() {
InstallableUnitDescription iu = new InstallableUnitDescription();
iu.setId("test");
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceFileParserTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceFileParserTest.java
index d734ea8e6..a285325db 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceFileParserTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceFileParserTest.java
@@ -45,6 +45,100 @@ public class AdviceFileParserTest extends TestCase {
fail("expected version parse problem");
}
+ public void testUpdateDescriptorAdvice() {
+ Map map = new HashMap();
+ map.put("update.id", "testName");
+ map.put("update.severity", "10");
+ map.put("update.description", "Test Description");
+ map.put("update.range", "(1.0.0,10.10.10)");
+
+ AdviceFileParser parser = new AdviceFileParser("id", Version.emptyVersion, map);
+ parser.parse();
+
+ IUpdateDescriptor updateDescriptor = parser.getUpdateDescriptor();
+ String testName = RequiredCapability.extractName(updateDescriptor.getIUsBeingUpdated().iterator().next());
+ VersionRange testVersionRange = RequiredCapability.extractRange(updateDescriptor.getIUsBeingUpdated().iterator().next());
+ assertEquals("testName", testName);
+ assertEquals(Version.parseVersion("1.0.0"), testVersionRange.getMinimum());
+ assertEquals(Version.parseVersion("10.10.10"), testVersionRange.getMaximum());
+ assertEquals(10, updateDescriptor.getSeverity());
+ assertEquals("Test Description", updateDescriptor.getDescription());
+ }
+
+ public void testUpdateDescriptorAdviceDefaultBound() {
+ Map map = new HashMap();
+ map.put("update.id", "testName");
+ map.put("update.severity", "10");
+ map.put("update.description", "Test Description");
+ map.put("update.range", "(1.0.0,$version$)");
+
+ AdviceFileParser parser = new AdviceFileParser("id", Version.parseVersion("9.10.11"), map);
+ parser.parse();
+
+ IUpdateDescriptor updateDescriptor = parser.getUpdateDescriptor();
+ String testName = RequiredCapability.extractName(updateDescriptor.getIUsBeingUpdated().iterator().next());
+ VersionRange testVersionRange = RequiredCapability.extractRange(updateDescriptor.getIUsBeingUpdated().iterator().next());
+ assertEquals("testName", testName);
+ assertEquals(Version.parseVersion("1.0.0"), testVersionRange.getMinimum());
+ assertEquals(Version.parseVersion("9.10.11"), testVersionRange.getMaximum());
+ assertEquals(10, updateDescriptor.getSeverity());
+ assertEquals("Test Description", updateDescriptor.getDescription());
+ }
+
+ public void testUpdateDescriptorAdviceDefaultBound2() {
+ Map map = new HashMap();
+ map.put("update.id", "testName");
+ map.put("update.severity", "10");
+ map.put("update.description", "Test Description");
+
+ AdviceFileParser parser = new AdviceFileParser("id", Version.parseVersion("9.10.11"), map);
+ parser.parse();
+
+ IUpdateDescriptor updateDescriptor = parser.getUpdateDescriptor();
+ String testName = RequiredCapability.extractName(updateDescriptor.getIUsBeingUpdated().iterator().next());
+ VersionRange testVersionRange = RequiredCapability.extractRange(updateDescriptor.getIUsBeingUpdated().iterator().next());
+ assertEquals("testName", testName);
+ assertEquals(Version.parseVersion("0.0.0"), testVersionRange.getMinimum());
+ assertEquals(Version.parseVersion("9.10.11"), testVersionRange.getMaximum());
+ assertEquals(10, updateDescriptor.getSeverity());
+ assertEquals("Test Description", updateDescriptor.getDescription());
+ }
+
+ public void testUpdateDescriptorAdviceDefaultID() {
+ Map map = new HashMap();
+ map.put("update.severity", "10");
+ map.put("update.description", "Test Description");
+
+ AdviceFileParser parser = new AdviceFileParser("id", Version.parseVersion("9.10.11"), map);
+ parser.parse();
+
+ IUpdateDescriptor updateDescriptor = parser.getUpdateDescriptor();
+ String testName = RequiredCapability.extractName(updateDescriptor.getIUsBeingUpdated().iterator().next());
+ VersionRange testVersionRange = RequiredCapability.extractRange(updateDescriptor.getIUsBeingUpdated().iterator().next());
+ assertEquals("id", testName);
+ assertEquals(Version.parseVersion("0.0.0"), testVersionRange.getMinimum());
+ assertEquals(Version.parseVersion("9.10.11"), testVersionRange.getMaximum());
+ assertEquals(10, updateDescriptor.getSeverity());
+ assertEquals("Test Description", updateDescriptor.getDescription());
+ }
+
+ public void testUpdateDescriptorAdviceDefaults() {
+ Map map = new HashMap();
+ map.put("update.id", "id");
+
+ AdviceFileParser parser = new AdviceFileParser("id", Version.parseVersion("9.10.11"), map);
+ parser.parse();
+
+ IUpdateDescriptor updateDescriptor = parser.getUpdateDescriptor();
+ String testName = RequiredCapability.extractName(updateDescriptor.getIUsBeingUpdated().iterator().next());
+ VersionRange testVersionRange = RequiredCapability.extractRange(updateDescriptor.getIUsBeingUpdated().iterator().next());
+ assertEquals("id", testName);
+ assertEquals(Version.parseVersion("0.0.0"), testVersionRange.getMinimum());
+ assertEquals(Version.parseVersion("9.10.11"), testVersionRange.getMaximum());
+ assertEquals(0, updateDescriptor.getSeverity());
+ assertEquals(null, updateDescriptor.getDescription());
+ }
+
public void testPropertyAdvice() {
Map map = new HashMap();
map.put("properties.0.name", "testName1");
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceMatcher.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceMatcher.java
index 010469ce2..4d4ca67ef 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceMatcher.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceMatcher.java
@@ -21,8 +21,10 @@ import org.eclipse.equinox.p2.publisher.IPublisherAdvice;
public class AdviceMatcher implements IArgumentMatcher {
private final Version version;
private final String id;
+ private static Class clazz;
- public static IPublisherAdvice adviceMatches(String id, Version version) {
+ public static IPublisherAdvice adviceMatches(String id, Version version, Class clazz) {
+ AdviceMatcher.clazz = clazz;
EasyMock.reportMatcher(new AdviceMatcher(id, version));
return null;
}
@@ -39,8 +41,9 @@ public class AdviceMatcher implements IArgumentMatcher {
public boolean matches(Object arg) {
if (!(arg instanceof IPublisherAdvice))
return false;
+ if (!(clazz.isAssignableFrom(arg.getClass())))
+ return false;
IPublisherAdvice advice = (IPublisherAdvice) arg;
return advice.isApplicable("", false, id, version);
}
-
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java
index 1a8807ec6..6d8c49de8 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java
@@ -18,14 +18,12 @@ import java.util.zip.ZipInputStream;
import org.easymock.EasyMock;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.director.QueryableArray;
-import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
-import org.eclipse.equinox.internal.p2.metadata.TranslationSupport;
+import org.eclipse.equinox.internal.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription;
import org.eclipse.equinox.p2.publisher.*;
import org.eclipse.equinox.p2.publisher.actions.*;
-import org.eclipse.equinox.p2.publisher.eclipse.BundlesAction;
-import org.eclipse.equinox.p2.publisher.eclipse.IBundleShapeAdvice;
+import org.eclipse.equinox.p2.publisher.eclipse.*;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
@@ -49,6 +47,7 @@ public class BundlesActionTest extends ActionTest {
private static final String TEST2_PROVY_NAME = "iuy";//$NON-NLS-1$
private static final String TEST2_PROVX_NAME = "iux";//$NON-NLS-1$
private static final String TEST2_PROVBUNDLE_NAME = "test2";//$NON-NLS-1$
+ private static final String TEST3_PROVBUNDLE_NAME = "test3";//$NON-NLS-1$
private static final File TEST_BASE = new File(TestActivator.getTestDataFolder(), "BundlesActionTest");//$NON-NLS-1$
private static final File TEST_FILE1 = new File(TEST_BASE, TEST1_PROVBUNDLE_NAME);
@@ -67,6 +66,8 @@ public class BundlesActionTest extends ActionTest {
private final Version BUNDLE1_VERSION = Version.create("0.1.0");//$NON-NLS-1$
private final Version BUNDLE2_VERSION = Version.create("1.0.0.qualifier");//$NON-NLS-1$
+ private final Version BUNDLE3_VERSION = Version.create("0.1.0.qualifier");//$NON-NLS-1$
+
private final Version PROVBUNDLE2_VERSION = BUNDLE2_VERSION;
private final Version TEST2_PROVZ_VERSION = Version.emptyVersion;
private final Version TEST2_PROVY_VERSION = Version.emptyVersion;
@@ -79,11 +80,15 @@ public class BundlesActionTest extends ActionTest {
protected TestArtifactRepository artifactRepository = new TestArtifactRepository(getAgent());
private MultiCapture<ITouchpointAdvice> tpAdvice1, tpAdvice2;
+ private MultiCapture<IUpdateDescriptorAdvice> udAdvice3;
@Override
public void setupPublisherInfo() {
tpAdvice1 = new MultiCapture<ITouchpointAdvice>();
tpAdvice2 = new MultiCapture<ITouchpointAdvice>();
+
+ udAdvice3 = new MultiCapture<IUpdateDescriptorAdvice>();
+
super.setupPublisherInfo();
}
@@ -141,6 +146,7 @@ public class BundlesActionTest extends ActionTest {
// verify publisher result
verifyBundle1();
verifyBundle2();
+ verifyBundle3();
verifyArtifactRepository();
}
@@ -260,6 +266,25 @@ public class BundlesActionTest extends ActionTest {
}
+ private void verifyBundle3() {
+ ArrayList ius = new ArrayList(publisherResult.getIUs(TEST3_PROVBUNDLE_NAME, IPublisherResult.ROOT));
+
+ assertTrue(ius.size() == 1);
+ IInstallableUnit bundle3IU = (IInstallableUnit) ius.get(0);
+
+ IUpdateDescriptor updateDescriptor = bundle3IU.getUpdateDescriptor();
+ String name = RequiredCapability.extractName(updateDescriptor.getIUsBeingUpdated().iterator().next());
+ VersionRange range = RequiredCapability.extractRange(updateDescriptor.getIUsBeingUpdated().iterator().next());
+ String description = updateDescriptor.getDescription();
+ int severity = updateDescriptor.getSeverity();
+
+ VersionRange expectedRange = new VersionRange("(0.0.1," + BUNDLE3_VERSION + "]");
+ assertEquals(TEST3_PROVBUNDLE_NAME, name);
+ assertEquals(expectedRange, range);
+ assertEquals("Some description about this update", description.trim());
+ assertEquals(8, severity);
+ }
+
public void cleanup() {
super.cleanup();
if (artifactRepository != null) {
@@ -297,19 +322,37 @@ public class BundlesActionTest extends ActionTest {
expect(publisherInfo.getAdvice(null, false, TEST1_PROVBUNDLE_NAME, BUNDLE1_VERSION, ICapabilityAdvice.class)).andReturn(Collections.EMPTY_LIST); //$NON-NLS-1$
expect(publisherInfo.getAdvice(null, false, TEST1_PROVBUNDLE_NAME, BUNDLE1_VERSION, IPropertyAdvice.class)).andReturn(adviceCollection1).times(2); //$NON-NLS-1$
expect(publisherInfo.getAdvice(null, false, TEST1_PROVBUNDLE_NAME, BUNDLE1_VERSION, IAdditionalInstallableUnitAdvice.class)).andReturn(Collections.EMPTY_LIST); //$NON-NLS-1$
+ expect(publisherInfo.getAdvice(null, false, TEST1_PROVBUNDLE_NAME, BUNDLE1_VERSION, IUpdateDescriptorAdvice.class)).andReturn(Collections.EMPTY_LIST);//$NON-NLS-1$
expect(publisherInfo.getAdvice(null, false, TEST2_PROVBUNDLE_NAME, BUNDLE2_VERSION, ICapabilityAdvice.class)).andReturn(Collections.EMPTY_LIST);//$NON-NLS-1$
expect(publisherInfo.getAdvice(null, false, TEST2_PROVBUNDLE_NAME, BUNDLE2_VERSION, IPropertyAdvice.class)).andReturn(adviceCollection2).times(2);//$NON-NLS-1$
- expect(publisherInfo.getAdvice(null, false, TEST2_PROVBUNDLE_NAME, BUNDLE2_VERSION, IAdditionalInstallableUnitAdvice.class)).andReturn(Collections.EMPTY_LIST);//$NON-NLS-1$
+ expect(publisherInfo.getAdvice(null, false, TEST2_PROVBUNDLE_NAME, BUNDLE2_VERSION, IAdditionalInstallableUnitAdvice.class)).andReturn(Collections.EMPTY_LIST);//$NON-NLS-1$
+ expect(publisherInfo.getAdvice(null, false, TEST2_PROVBUNDLE_NAME, BUNDLE2_VERSION, IUpdateDescriptorAdvice.class)).andReturn(Collections.EMPTY_LIST);//$NON-NLS-1$
expect(publisherInfo.getAdvice(null, true, TEST1_PROVBUNDLE_NAME, BUNDLE1_VERSION, IBundleShapeAdvice.class)).andReturn(null); //$NON-NLS-1$
expect(publisherInfo.getAdvice(null, true, TEST2_PROVBUNDLE_NAME, BUNDLE2_VERSION, IBundleShapeAdvice.class)).andReturn(null);//$NON-NLS-1$
+ expect(publisherInfo.getAdvice(null, false, TEST3_PROVBUNDLE_NAME, BUNDLE3_VERSION, ICapabilityAdvice.class)).andReturn(Collections.EMPTY_LIST); //$NON-NLS-1$
+ expect(publisherInfo.getAdvice(null, false, TEST3_PROVBUNDLE_NAME, BUNDLE3_VERSION, IPropertyAdvice.class)).andReturn(adviceCollection1).times(2); //$NON-NLS-1$
+ expect(publisherInfo.getAdvice(null, false, TEST3_PROVBUNDLE_NAME, BUNDLE3_VERSION, IAdditionalInstallableUnitAdvice.class)).andReturn(Collections.EMPTY_LIST); //$NON-NLS-1$
+ expect(publisherInfo.getAdvice(null, false, TEST3_PROVBUNDLE_NAME, BUNDLE3_VERSION, ITouchpointAdvice.class)).andReturn(Collections.EMPTY_LIST);//$NON-NLS-1$
+ expect(publisherInfo.getAdvice(null, true, TEST3_PROVBUNDLE_NAME, BUNDLE3_VERSION, IBundleShapeAdvice.class)).andReturn(null); //$NON-NLS-1$
+
expect(publisherInfo.getArtifactOptions()).andReturn(IPublisherInfo.A_INDEX | IPublisherInfo.A_OVERWRITE | IPublisherInfo.A_PUBLISH).anyTimes();
expect(publisherInfo.getAdvice(null, false, null, null, ICapabilityAdvice.class)).andReturn(new ArrayList()).anyTimes();
//capture any touchpoint advice, and return the captured advice when the action asks for it
- publisherInfo.addAdvice(and(AdviceMatcher.adviceMatches(TEST1_PROVBUNDLE_NAME, BUNDLE1_VERSION), capture(tpAdvice1)));
- publisherInfo.addAdvice(and(AdviceMatcher.adviceMatches(TEST2_PROVBUNDLE_NAME, BUNDLE2_VERSION), capture(tpAdvice2)));
+ publisherInfo.addAdvice(and(AdviceMatcher.adviceMatches(TEST1_PROVBUNDLE_NAME, BUNDLE1_VERSION, ITouchpointAdvice.class), capture(tpAdvice1)));
EasyMock.expectLastCall().anyTimes();
+
+ publisherInfo.addAdvice(and(AdviceMatcher.adviceMatches(TEST2_PROVBUNDLE_NAME, BUNDLE2_VERSION, ITouchpointAdvice.class), capture(tpAdvice2)));
+ EasyMock.expectLastCall().anyTimes();
+
+ publisherInfo.addAdvice(and(AdviceMatcher.adviceMatches(TEST3_PROVBUNDLE_NAME, BUNDLE3_VERSION, AdviceFileAdvice.class), capture(udAdvice3)));
+ EasyMock.expectLastCall().anyTimes();
+
expect(publisherInfo.getAdvice(null, false, TEST1_PROVBUNDLE_NAME, BUNDLE1_VERSION, ITouchpointAdvice.class)).andReturn(tpAdvice1).anyTimes();
expect(publisherInfo.getAdvice(null, false, TEST2_PROVBUNDLE_NAME, BUNDLE2_VERSION, ITouchpointAdvice.class)).andReturn(tpAdvice2).anyTimes();
+
+ expect(publisherInfo.getAdvice(null, false, TEST3_PROVBUNDLE_NAME, BUNDLE3_VERSION, IUpdateDescriptorAdvice.class)).andReturn(udAdvice3).anyTimes();
+
}
+
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/FeaturesActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/FeaturesActionTest.java
index 75ff6faa5..b2614eb9c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/FeaturesActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/FeaturesActionTest.java
@@ -217,11 +217,13 @@ public class FeaturesActionTest extends ActionTest {
expect(publisherInfo.getAdvice(null, false, "bar.feature.group", barVersion, ICapabilityAdvice.class)).andReturn(Collections.EMPTY_LIST).anyTimes();
expect(publisherInfo.getAdvice(null, false, "bar.feature.group", barVersion, IAdditionalInstallableUnitAdvice.class)).andReturn(Collections.EMPTY_LIST).anyTimes();
expect(publisherInfo.getAdvice(null, false, "foo.feature.jar", fooVersion, IPropertyAdvice.class)).andReturn(adviceCollection).anyTimes();
+ expect(publisherInfo.getAdvice(null, false, "bar.feature.group", barVersion, IUpdateDescriptorAdvice.class)).andReturn(Collections.EMPTY_LIST).anyTimes();
expect(publisherInfo.getAdvice(null, false, "foo", fooVersion, IPropertyAdvice.class)).andReturn(adviceCollection).anyTimes();
expect(publisherInfo.getAdvice(null, false, "foo", fooVersion, IFeatureRootAdvice.class)).andReturn(Collections.EMPTY_LIST).anyTimes();
expect(publisherInfo.getAdvice(null, false, "foo.feature.group", fooVersion, IPropertyAdvice.class)).andReturn(adviceCollection).anyTimes();
expect(publisherInfo.getAdvice(null, false, "foo.feature.group", fooVersion, ICapabilityAdvice.class)).andReturn(Collections.EMPTY_LIST).anyTimes();
expect(publisherInfo.getAdvice(null, false, "foo.feature.group", fooVersion, IAdditionalInstallableUnitAdvice.class)).andReturn(Collections.EMPTY_LIST).anyTimes();
+ expect(publisherInfo.getAdvice(null, false, "foo.feature.group", fooVersion, IUpdateDescriptorAdvice.class)).andReturn(Collections.EMPTY_LIST).anyTimes();
expect(publisherInfo.getArtifactOptions()).andReturn(IPublisherInfo.A_INDEX | IPublisherInfo.A_OVERWRITE | IPublisherInfo.A_PUBLISH).anyTimes();
expect(publisherInfo.getArtifactRepository()).andReturn(artifactRepository).anyTimes();
expect(publisherInfo.getMetadataRepository()).andReturn(metadataRepository).anyTimes();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java
index dcf0b7e82..07aa817b5 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java
@@ -12,8 +12,6 @@ package org.eclipse.equinox.p2.tests.publisher.actions;
import static org.easymock.EasyMock.expect;
-import org.eclipse.equinox.p2.query.MatchQuery;
-
import java.util.*;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
@@ -22,6 +20,7 @@ import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.publisher.IPublisherResult;
import org.eclipse.equinox.p2.publisher.actions.*;
import org.eclipse.equinox.p2.query.IQuery;
+import org.eclipse.equinox.p2.query.MatchQuery;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.TestMetadataRepository;
@@ -344,6 +343,7 @@ public class RootIUActionTest extends ActionTest {
expect(publisherInfo.getAdvice(null, true, null, null, IRootIUAdvice.class)).andReturn(rootIUAdviceCollection).anyTimes();
expect(publisherInfo.getAdvice(null, true, null, null, IVersionAdvice.class)).andReturn(null).anyTimes();
expect(publisherInfo.getAdvice(null, false, rootIU, versionArg, ITouchpointAdvice.class)).andReturn(new ArrayList()).anyTimes();
+ expect(publisherInfo.getAdvice(null, false, rootIU, versionArg, IUpdateDescriptorAdvice.class)).andReturn(new ArrayList()).anyTimes();
expect(publisherInfo.getAdvice(null, false, rootIU, versionArg, IPropertyAdvice.class)).andReturn(new ArrayList()).anyTimes();
expect(publisherInfo.getAdvice(null, false, rootIU, versionArg, IAdditionalInstallableUnitAdvice.class)).andReturn(new ArrayList()).anyTimes();
expect(publisherInfo.getAdvice(null, true, rootIU, versionArg, ILicenseAdvice.class)).andReturn(new ArrayList()).anyTimes();

Back to the top