diff options
author | Simon Kaegi | 2008-10-17 17:38:39 +0000 |
---|---|---|
committer | Simon Kaegi | 2008-10-17 17:38:39 +0000 |
commit | 1c23a115814f9d5f4ae8733628f4c470666f6777 (patch) | |
tree | bf61f3779e31eaa50cd1f5c782f0b9e42fe4c260 /bundles/org.eclipse.equinox.p2.tests | |
parent | 662eebfe3fa89fa4e43bd1b4529e578389b669b5 (diff) | |
download | rt.equinox.p2-1c23a115814f9d5f4ae8733628f4c470666f6777.tar.gz rt.equinox.p2-1c23a115814f9d5f4ae8733628f4c470666f6777.tar.xz rt.equinox.p2-1c23a115814f9d5f4ae8733628f4c470666f6777.zip |
Bug 203323 [prov] Touchpoint and touchpoint actions
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests')
10 files changed, 199 insertions, 42 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/plugin.xml b/bundles/org.eclipse.equinox.p2.tests/plugin.xml index 145d09118..a40be5d18 100644 --- a/bundles/org.eclipse.equinox.p2.tests/plugin.xml +++ b/bundles/org.eclipse.equinox.p2.tests/plugin.xml @@ -40,7 +40,16 @@ point="org.eclipse.equinox.p2.engine.actions"> <action class="org.eclipse.equinox.p2.tests.engine.InstructionParserTest$TestAction" - id="org.eclipse.equinox.p2.tests.engine.test"> + name="org.eclipse.equinox.p2.tests.engine.test" + version="1.0.0"> + </action> + </extension> + <extension + point="org.eclipse.equinox.p2.engine.actions"> + <action + class="org.eclipse.equinox.p2.tests.engine.PhaseTest$TestAction" + name="phasetest.test" + version="1"> </action> </extension> diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/AllTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/AllTests.java index ce2736065..9f8f2d222 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/AllTests.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/AllTests.java @@ -29,6 +29,7 @@ public class AllTests extends TestCase { suite.addTestSuite(ProfileTest.class); suite.addTestSuite(ProfileRegistryTest.class); suite.addTestSuite(SurrogateProfileHandlerTest.class); + suite.addTestSuite(TouchpointManagerTest.class); suite.addTestSuite(TouchpointTest.class); return suite; } diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/InstructionParserTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/InstructionParserTest.java index fe7ea3edf..6f3ff2f8f 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/InstructionParserTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/InstructionParserTest.java @@ -19,10 +19,6 @@ public class InstructionParserTest extends AbstractProvisioningTest { public static class NullActionTouchpoint extends Touchpoint { private static final TouchpointType TOUCHPOINT_TYPE = MetadataFactory.createTouchpointType("NullActionTouchpoint", new Version("1.0")); //$NON-NLS-1$ //$NON-NLS-2$ - public ProvisioningAction getAction(String actionId) { - return null; - } - public TouchpointType getTouchpointType() { return TOUCHPOINT_TYPE; } @@ -62,32 +58,70 @@ public class InstructionParserTest extends AbstractProvisioningTest { public void testGoodAction() { InstructionParser parser = new InstructionParser(new Collect(1), new NullTouchpoint()); - ProvisioningAction[] actions = parser.parseActions("goodAction()"); + ProvisioningAction[] actions = parser.parseActions(MetadataFactory.createTouchpointInstruction("goodAction()", null)); + assertEquals(1, actions.length); + } + + public void testGoodActionFullyQualified() { + InstructionParser parser = new InstructionParser(new Collect(1), new NullActionTouchpoint()); + ProvisioningAction[] actions = parser.parseActions(MetadataFactory.createTouchpointInstruction("phasetest.test()", null)); + assertEquals(1, actions.length); + } + + public void testBadActionFullyQualified() { + InstructionParser parser = new InstructionParser(new Collect(1), new NullActionTouchpoint()); + try { + ProvisioningAction[] actions = parser.parseActions(MetadataFactory.createTouchpointInstruction("bad.phasetest.test()", null)); + } catch (IllegalArgumentException e) { + return; + } + fail(); + } + + public void testGoodActionFromImport() { + InstructionParser parser = new InstructionParser(new Collect(1), new NullActionTouchpoint()); + ProvisioningAction[] actions = parser.parseActions(MetadataFactory.createTouchpointInstruction("test()", "phasetest.test")); assertEquals(1, actions.length); } + public void testGoodActionFromImportWithVersionRange() { + InstructionParser parser = new InstructionParser(new Collect(1), new NullActionTouchpoint()); + ProvisioningAction[] actions = parser.parseActions(MetadataFactory.createTouchpointInstruction("test()", "phasetest.test;version=[1.0,2.0)")); + assertEquals(1, actions.length); + } + + public void testBadActionFromImport() { + InstructionParser parser = new InstructionParser(new Collect(1), new NullActionTouchpoint()); + try { + ProvisioningAction[] actions = parser.parseActions(MetadataFactory.createTouchpointInstruction("test()", "bad.phasetest.test")); + } catch (IllegalArgumentException e) { + return; + } + fail(); + } + public void testGoodActions() { InstructionParser parser = new InstructionParser(new Collect(1), new NullTouchpoint()); - ProvisioningAction[] actions = parser.parseActions("goodAction1(); goodAction2()"); + ProvisioningAction[] actions = parser.parseActions(MetadataFactory.createTouchpointInstruction("goodAction1(); goodAction2()", null)); assertEquals(2, actions.length); } public void testGoodParameter() { InstructionParser parser = new InstructionParser(new Collect(1), new NullTouchpoint()); - ProvisioningAction[] actions = parser.parseActions("goodAction(a:1)"); + ProvisioningAction[] actions = parser.parseActions(MetadataFactory.createTouchpointInstruction("goodAction(a:1)", null)); assertEquals(1, actions.length); } public void testGoodParameters() { InstructionParser parser = new InstructionParser(new Collect(1), new NullTouchpoint()); - ProvisioningAction[] actions = parser.parseActions("goodAction(a:1, b:2)"); + ProvisioningAction[] actions = parser.parseActions(MetadataFactory.createTouchpointInstruction("goodAction(a:1, b:2)", null)); assertEquals(1, actions.length); } public void testBadParameter() { InstructionParser parser = new InstructionParser(new Collect(1), new NullTouchpoint()); try { - parser.parseActions("goodAction(badParameter)"); + parser.parseActions(MetadataFactory.createTouchpointInstruction("goodAction(badParameter)", null)); } catch (IllegalArgumentException e) { return; } @@ -97,7 +131,7 @@ public class InstructionParserTest extends AbstractProvisioningTest { public void testGoodParamterBadParameter() { InstructionParser parser = new InstructionParser(new Collect(1), new NullTouchpoint()); try { - parser.parseActions("goodAction(a:1, badParameter)"); + parser.parseActions(MetadataFactory.createTouchpointInstruction("goodAction(a:1, badParameter)", null)); } catch (IllegalArgumentException e) { return; } @@ -107,7 +141,7 @@ public class InstructionParserTest extends AbstractProvisioningTest { public void testBadAction() { InstructionParser parser = new InstructionParser(new Collect(1), new NullTouchpoint()); try { - parser.parseActions("badAction"); + parser.parseActions(MetadataFactory.createTouchpointInstruction("badAction", null)); } catch (IllegalArgumentException e) { return; } @@ -117,7 +151,7 @@ public class InstructionParserTest extends AbstractProvisioningTest { public void testGoodActionBadAction() { InstructionParser parser = new InstructionParser(new Collect(1), new NullTouchpoint()); try { - parser.parseActions("goodAction(); badAction"); + parser.parseActions(MetadataFactory.createTouchpointInstruction("goodAction(); badAction", null)); } catch (IllegalArgumentException e) { return; } @@ -128,7 +162,7 @@ public class InstructionParserTest extends AbstractProvisioningTest { Touchpoint empty = new NullActionTouchpoint(); InstructionParser parser = new InstructionParser(new Collect(1), empty); try { - parser.parseActions("notfoundaction()"); + parser.parseActions(MetadataFactory.createTouchpointInstruction("notfoundaction()", null)); } catch (IllegalArgumentException e) { return; } @@ -138,7 +172,7 @@ public class InstructionParserTest extends AbstractProvisioningTest { public void testActionManagerActionFound() { Touchpoint empty = new NullActionTouchpoint(); InstructionParser parser = new InstructionParser(new Collect(1), empty); - ProvisioningAction[] actions = parser.parseActions("org.eclipse.equinox.p2.tests.engine.test(a:1, b:2)"); + ProvisioningAction[] actions = parser.parseActions(MetadataFactory.createTouchpointInstruction("org.eclipse.equinox.p2.tests.engine.test(a:1, b:2)", null)); assertEquals(1, actions.length); } } diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/NullTouchpointTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/NullTouchpointTest.java index 65099a104..bacbdcaf0 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/NullTouchpointTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/NullTouchpointTest.java @@ -3,6 +3,7 @@ package org.eclipse.equinox.p2.tests.engine; import junit.framework.Test; import junit.framework.TestSuite; import org.eclipse.core.runtime.IStatus; +import org.eclipse.equinox.internal.p2.engine.ActionManager; import org.eclipse.equinox.internal.p2.engine.NullTouchpoint; import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningAction; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; @@ -12,9 +13,10 @@ public class NullTouchpointTest extends AbstractProvisioningTest { return new TestSuite(NullTouchpointTest.class); } - public void testGetAction() { + public void testQualifyAction() { NullTouchpoint touchpoint = new NullTouchpoint(); - ProvisioningAction action = touchpoint.getAction(""); + String actionId = touchpoint.qualifyAction(""); + ProvisioningAction action = ActionManager.getInstance().getAction(actionId); assertEquals(IStatus.OK, action.execute(null).getSeverity()); assertEquals(IStatus.OK, action.undo(null).getSeverity()); } diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/PhaseTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/PhaseTest.java index cabd2f4e3..1d79fe6a2 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/PhaseTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/PhaseTest.java @@ -10,13 +10,16 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.engine; -import java.util.Map; +import java.util.*; import org.eclipse.core.runtime.*; +import org.eclipse.equinox.internal.p2.engine.NullAction; +import org.eclipse.equinox.internal.p2.engine.ParameterizedProvisioningAction; import org.eclipse.equinox.internal.provisional.p2.engine.*; -import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.internal.provisional.p2.metadata.*; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; import org.eclipse.equinox.p2.tests.TestActivator; import org.osgi.framework.ServiceReference; +import org.osgi.framework.Version; /** * Simple test of the engine API. @@ -63,18 +66,32 @@ public class PhaseTest extends AbstractProvisioningTest { return super.initializeOperand(profile, operand, parameters, monitor); } - protected IStatus completeInstallableUnitPhase(IProgressMonitor monitor, IProfile profile, Map parameters) { + protected IStatus completePhase(IProgressMonitor monitor, IProfile profile, Map parameters) { completePhase = true; - return super.completeInstallableUnitPhase(monitor, profile, parameters); + return super.completePhase(monitor, profile, parameters); } - protected IStatus initializeInstallableUnitPhase(IProgressMonitor monitor, IProfile profile, Map parameters) { + protected IStatus initializePhase(IProgressMonitor monitor, IProfile profile, Map parameters) { initializePhase = true; - return super.initializeInstallableUnitPhase(monitor, profile, parameters); + return super.initializePhase(monitor, profile, parameters); } protected ProvisioningAction[] getActions(InstallableUnitOperand operand) { - return null; + final Touchpoint touchpoint = getTouchpoint(operand); + ProvisioningAction action = new ProvisioningAction() { + public IStatus execute(Map parameters) { + return null; + } + + public IStatus undo(Map parameters) { + return null; + } + + public Touchpoint getTouchpoint() { + return touchpoint; + } + }; + return new ProvisioningAction[] {action}; } } @@ -137,7 +154,7 @@ public class PhaseTest extends AbstractProvisioningTest { } public void testPerform() { - PhaseSet phaseSet = new TestPhaseSet(); + PhaseSet phaseSet = new TestPhaseSet(new TestPhase()); IProfile profile = createProfile("PhaseTest"); engine.perform(profile, phaseSet, new InstallableUnitOperand[0], null, new NullProgressMonitor()); @@ -199,4 +216,52 @@ public class PhaseTest extends AbstractProvisioningTest { assertTrue(phase.initializeOperand); assertTrue(phase.completeOperand); } + + public static class TestAction extends ProvisioningAction { + + public IStatus execute(Map parameters) { + return null; + } + + public IStatus undo(Map parameters) { + return null; + } + } + + public void testGetAction() { + final ArrayList actionsList1 = new ArrayList(); + InstallableUnitPhase phase1 = new InstallableUnitPhase("test", 1) { + protected ProvisioningAction[] getActions(InstallableUnitOperand operand) { + ProvisioningAction[] actions = getActions(operand.second(), "test1"); + actionsList1.addAll(Arrays.asList(actions)); + return actions; + } + }; + final ArrayList actionsList2 = new ArrayList(); + InstallableUnitPhase phase2 = new InstallableUnitPhase("test", 1) { + protected ProvisioningAction[] getActions(InstallableUnitOperand operand) { + ProvisioningAction[] actions = getActions(operand.second(), "test2"); + actionsList2.addAll(Arrays.asList(actions)); + return actions; + } + }; + + PhaseSet phaseSet = new TestPhaseSet(new Phase[] {phase1, phase2}); + IProfile profile = createProfile("PhaseTest"); + + Map instructions = new HashMap(); + instructions.put("test1", MetadataFactory.createTouchpointInstruction("phasetest.test()", null)); + instructions.put("test2", MetadataFactory.createTouchpointInstruction("test()", null)); + TouchpointData touchpointData = MetadataFactory.createTouchpointData(instructions); + IInstallableUnit unit = createIU("test", new Version("1.0.0"), null, NO_REQUIRES, new ProvidedCapability[0], NO_PROPERTIES, TouchpointType.NONE, touchpointData, false); + IStatus status = engine.perform(profile, phaseSet, new InstallableUnitOperand[] {new InstallableUnitOperand(null, unit)}, null, new NullProgressMonitor()); + if (!status.isOK()) { + System.out.println(status); + fail(); + } + + assertEquals(TestAction.class, ((ParameterizedProvisioningAction) actionsList1.get(0)).getAction().getClass()); + assertEquals(NullAction.class, ((ParameterizedProvisioningAction) actionsList2.get(0)).getAction().getClass()); + } + } diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/TouchpointManagerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/TouchpointManagerTest.java new file mode 100644 index 000000000..0132c32c9 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/TouchpointManagerTest.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.equinox.p2.tests.engine; + +import org.eclipse.equinox.internal.p2.engine.TouchpointManager; +import org.eclipse.equinox.internal.provisional.p2.metadata.TouchpointType; +import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; + +/** + * Simple test of the engine API. + */ +public class TouchpointManagerTest extends AbstractProvisioningTest { + + public TouchpointManagerTest(String name) { + super(name); + } + + public TouchpointManagerTest() { + super(""); + } + + protected void setUp() throws Exception { + } + + protected void tearDown() throws Exception { + } + + public void testGetTouchpointByType() { + TouchpointManager manager = TouchpointManager.getInstance(); + assertNotNull(manager.getTouchpoint(TouchpointType.NONE)); + } + + public void testGetTouchpointByIdWithVersion() { + TouchpointManager manager = TouchpointManager.getInstance(); + assertNotNull(manager.getTouchpoint("phaseTest", "1.0.0")); + } + + public void testGetTouchpointByIdWithNullVersion() { + TouchpointManager manager = TouchpointManager.getInstance(); + assertNotNull(manager.getTouchpoint("phaseTest", null)); + } +} diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/TouchpointTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/TouchpointTest.java index 34bed86b2..a0b4a70c8 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/TouchpointTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/TouchpointTest.java @@ -38,9 +38,9 @@ public class TouchpointTest extends AbstractProvisioningTest { testTouchpoint = this; } - public IStatus completeOperand(IProfile profile, String phaseId, InstallableUnitOperand operand, Map parameters) { + public IStatus completeOperand(IProfile profile, Operand operand, Map parameters) { completeOperand++; - return super.completeOperand(profile, phaseId, operand, parameters); + return super.completeOperand(profile, operand, parameters); } public IStatus completePhase(IProgressMonitor monitor, IProfile profile, String phaseId, Map touchpointParameters) { @@ -48,9 +48,9 @@ public class TouchpointTest extends AbstractProvisioningTest { return super.completePhase(monitor, profile, phaseId, touchpointParameters); } - public IStatus initializeOperand(IProfile profile, String phaseId, InstallableUnitOperand operand, Map parameters) { + public IStatus initializeOperand(IProfile profile, Operand operand, Map parameters) { initializeOperand++; - return super.initializeOperand(profile, phaseId, operand, parameters); + return super.initializeOperand(profile, operand, parameters); } public IStatus initializePhase(IProgressMonitor monitor, IProfile profile, String phaseId, Map touchpointParameters) { @@ -58,29 +58,25 @@ public class TouchpointTest extends AbstractProvisioningTest { return super.initializePhase(monitor, profile, phaseId, touchpointParameters); } - public ProvisioningAction getAction(String actionId) { - return null; - } - public TouchpointType getTouchpointType() { return MetadataFactory.createTouchpointType("test", new Version("1.0.0")); } } public static class OperandTestTouchpoint extends TestTouchpoint { - public IStatus completeOperand(IProfile profile, String phaseId, InstallableUnitOperand operand, Map parameters) { + public IStatus completeOperand(IProfile profile, Operand operand, Map parameters) { assertEquals(1, initializeOperand); assertEquals(0, completeOperand); - super.completeOperand(profile, phaseId, operand, parameters); + super.completeOperand(profile, operand, parameters); assertEquals(1, initializeOperand); assertEquals(1, completeOperand); return null; } - public IStatus initializeOperand(IProfile profile, String phaseId, InstallableUnitOperand operand, Map parameters) { + public IStatus initializeOperand(IProfile profile, Operand operand, Map parameters) { assertEquals(0, initializeOperand); assertEquals(0, completeOperand); - super.initializeOperand(profile, phaseId, operand, parameters); + super.initializeOperand(profile, operand, parameters); assertEquals(1, initializeOperand); assertEquals(0, completeOperand); return null; 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 d474f80f5..5af3f5882 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 @@ -78,7 +78,7 @@ public class FeaturesActionTest extends ActionTest { assertTrue(foo.getTouchpointType().getVersion().equals(fooVersion)); //zipped=true - String fooValue = (String) foo.getTouchpointData()[0].getInstructions().get("zipped"); //$NON-NLS-1$ + String fooValue = (String) ((TouchpointInstruction) foo.getTouchpointData()[0].getInstructions().get("zipped")).getBody(); //$NON-NLS-1$ assertTrue(fooValue.equalsIgnoreCase("true")); //$NON-NLS-1$ RequiredCapability[] fooRequiredCapabilities = foo.getRequiredCapabilities(); @@ -105,7 +105,7 @@ public class FeaturesActionTest extends ActionTest { assertTrue(bar.isSingleton()); //check zipped=true in touchpointData - String barValue = (String) bar.getTouchpointData()[0].getInstructions().get("zipped"); //$NON-NLS-1$ + String barValue = (String) ((TouchpointInstruction) bar.getTouchpointData()[0].getInstructions().get("zipped")).getBody(); //$NON-NLS-1$ assertTrue(barValue.equalsIgnoreCase("true")); //$NON-NLS-1$ //check touchpointType diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/JREActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/JREActionTest.java index 2f59e55ce..8c39e0d53 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/JREActionTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/JREActionTest.java @@ -90,8 +90,8 @@ public class JREActionTest extends ActionTest { IInstallableUnit bar = (IInstallableUnit) barIUs.get(0); Map instructions = bar.getTouchpointData()[0].getInstructions(); - assertTrue(instructions.get("install").equals("unzip(source:@artifact, target:${installFolder});")); //$NON-NLS-1$//$NON-NLS-2$ - assertTrue(instructions.get("uninstall").equals("cleanupzip(source:@artifact, target:${installFolder});")); //$NON-NLS-1$ //$NON-NLS-2$ + assertTrue(((TouchpointInstruction) instructions.get("install")).getBody().equals("unzip(source:@artifact, target:${installFolder});")); //$NON-NLS-1$//$NON-NLS-2$ + assertTrue(((TouchpointInstruction) instructions.get("uninstall")).getBody().equals("cleanupzip(source:@artifact, target:${installFolder});")); //$NON-NLS-1$ //$NON-NLS-2$ RequiredCapability[] requiredCapability = bar.getRequiredCapabilities(); verifyRequiredCapability(requiredCapability, IInstallableUnit.NAMESPACE_IU_ID, "a.jre", new VersionRange(JREVersion, true, new Version(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE), true)); //$NON-NLS-1$ 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 f60a778cf..6ee13c6b9 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 @@ -474,7 +474,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest { assertEquals("1.1", 1, data.length); Map instructions = data[0].getInstructions(); assertEquals("1.2", 1, instructions.size()); - assertEquals("1.3", "true", instructions.get("zipped")); + assertEquals("1.3", "true", ((TouchpointInstruction) instructions.get("zipped")).getBody()); } public void testMirrors() { |