Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hallgren2010-02-26 15:09:10 +0000
committerThomas Hallgren2010-02-26 15:09:10 +0000
commite71a591de427fe7be2b7defb34dc3b683c8d6163 (patch)
tree93e78202c73d19ae45ff599a2225bdc3c5ed6809 /bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher
parenteaa7cbe6e5818394bc1673a8babc7d4ebd30ed13 (diff)
downloadrt.equinox.p2-e71a591de427fe7be2b7defb34dc3b683c8d6163.tar.gz
rt.equinox.p2-e71a591de427fe7be2b7defb34dc3b683c8d6163.tar.xz
rt.equinox.p2-e71a591de427fe7be2b7defb34dc3b683c8d6163.zip
302193 : Return type inconsistency on IInstallableUnit's getters
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/AdviceFileParserTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/FeaturesActionTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/JREActionTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalUpdateSiteActionTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionWithAdviceFileTest.java7
6 files changed, 19 insertions, 18 deletions
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 16efaa492..8ecfcd55f 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
@@ -350,11 +350,11 @@ public class AdviceFileParserTest extends TestCase {
assertEquals(1, metaReq1.getMin());
assertEquals(1, iu1.getTouchpointData().size());
- ITouchpointInstruction configure = iu1.getTouchpointData().get(0).getInstruction("configure");
+ ITouchpointInstruction configure = iu1.getTouchpointData().iterator().next().getInstruction("configure");
assertEquals(null, configure.getImportAttribute());
assertEquals("addProgramArg(programArg:-startup); addProgramArg(programArg:@artifact);", configure.getBody());
- ITouchpointInstruction unconfigure = iu1.getTouchpointData().get(0).getInstruction("unconfigure");
+ ITouchpointInstruction unconfigure = iu1.getTouchpointData().iterator().next().getInstruction("unconfigure");
assertEquals("some.removeProgramArg", unconfigure.getImportAttribute());
assertEquals("removeProgramArg(programArg:-startup); removeProgramArg(programArg:@artifact);)", unconfigure.getBody());
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 35d271c67..c5eb6e00a 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
@@ -201,10 +201,10 @@ public class BundlesActionTest extends ActionTest {
verifyProvidedCapability(providedCapabilities, PublisherHelper.NAMESPACE_ECLIPSE_TYPE, "source", Version.create("1.0.0"));//$NON-NLS-1$//$NON-NLS-2$
assertEquals("2.1", 4, providedCapabilities.size());
- List<ITouchpointData> data = bundle1IU.getTouchpointData();
+ Collection<ITouchpointData> data = bundle1IU.getTouchpointData();
boolean found = false;
- for (int i = 0; i < data.size(); i++) {
- ITouchpointInstruction configure = data.get(i).getInstruction("configure");
+ for (ITouchpointData td : data) {
+ ITouchpointInstruction configure = td.getInstruction("configure");
if (configure == null)
continue;
String body = configure.getBody();
@@ -245,10 +245,10 @@ public class BundlesActionTest extends ActionTest {
assertTrue(prop.get("org.eclipse.equinox.p2.name").toString().equalsIgnoreCase("%bundleName"));//$NON-NLS-1$//$NON-NLS-2$
assertTrue(prop.get("org.eclipse.equinox.p2.provider").toString().equalsIgnoreCase("%providerName"));//$NON-NLS-1$//$NON-NLS-2$
- List<ITouchpointData> data = bundle2IU.getTouchpointData();
+ Collection<ITouchpointData> data = bundle2IU.getTouchpointData();
boolean found = false;
- for (int i = 0; i < data.size(); i++) {
- ITouchpointInstruction configure = data.get(i).getInstruction("configure");
+ for (ITouchpointData td : data) {
+ ITouchpointInstruction configure = td.getInstruction("configure");
if (configure == null)
continue;
String body = configure.getBody();
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 c858c0115..3338cd685 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
@@ -128,8 +128,8 @@ public class FeaturesActionTest extends ActionTest {
assertTrue(foo.getTouchpointType().getVersion().equals(fooVersion));
//zipped=true
- List<ITouchpointData> tpData = foo.getTouchpointData();
- String fooValue = tpData.get(0).getInstructions().get("zipped").getBody(); //$NON-NLS-1$
+ Collection<ITouchpointData> tpData = foo.getTouchpointData();
+ String fooValue = tpData.iterator().next().getInstructions().get("zipped").getBody(); //$NON-NLS-1$
assertTrue(fooValue.equalsIgnoreCase("true")); //$NON-NLS-1$
Collection<IRequirement> fooRequiredCapabilities = foo.getRequiredCapabilities();
@@ -147,7 +147,7 @@ public class FeaturesActionTest extends ActionTest {
IInstallableUnit fooGroup = (IInstallableUnit) fooIUs.get(0);
tpData = fooGroup.getTouchpointData();
assertEquals(1, tpData.size());
- ITouchpointInstruction instruction = tpData.get(0).getInstruction("install");
+ ITouchpointInstruction instruction = tpData.iterator().next().getInstruction("install");
assertNotNull(instruction);
assertEquals("ln(targetDir:@artifact,linkTarget:foo/lib.1.so,linkName:lib.so);chmod(targetDir:@artifact,targetFile:lib/lib.so,permissions:755);", instruction.getBody());
System.out.println(fooGroup.getFilter());
@@ -177,7 +177,7 @@ public class FeaturesActionTest extends ActionTest {
assertTrue(barGroup.getFilter().equals(ExpressionUtil.parseLDAP("(&(|(osgi.os=macosx)(osgi.os=win32))(|(osgi.ws=carbon)(osgi.ws=win32))(|(osgi.arch=ppc)(osgi.arch=x86))(osgi.nl=en))")));
//check zipped=true in touchpointData
- String barValue = bar.getTouchpointData().get(0).getInstructions().get("zipped").getBody(); //$NON-NLS-1$
+ String barValue = bar.getTouchpointData().iterator().next().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 bbca48dd7..94a0eac75 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
@@ -88,7 +88,7 @@ public class JREActionTest extends ActionTest {
IInstallableUnit bar = (IInstallableUnit) barIUs.get(0);
if (testInstructions) {
- Map instructions = bar.getTouchpointData().get(0).getInstructions();
+ Map instructions = bar.getTouchpointData().iterator().next().getInstructions();
assertTrue(((ITouchpointInstruction) instructions.get("install")).getBody().equals("unzip(source:@artifact, target:${installFolder});")); //$NON-NLS-1$//$NON-NLS-2$
assertTrue(((ITouchpointInstruction) instructions.get("uninstall")).getBody().equals("cleanupzip(source:@artifact, target:${installFolder});")); //$NON-NLS-1$ //$NON-NLS-2$
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalUpdateSiteActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalUpdateSiteActionTest.java
index 3933099a0..f70f52e56 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalUpdateSiteActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalUpdateSiteActionTest.java
@@ -56,9 +56,9 @@ public class LocalUpdateSiteActionTest extends ActionTest {
Collection ius = publisherResult.getIUs("test.feature.feature.jar", null);
assertEquals("1.0", 1, ius.size());
IInstallableUnit iu = (IInstallableUnit) ius.iterator().next();
- List<ITouchpointData> touchpointData = iu.getTouchpointData();
+ Collection<ITouchpointData> touchpointData = iu.getTouchpointData();
assertEquals("1.1", 1, touchpointData.size());
- Map instructions = touchpointData.get(0).getInstructions();
+ Map instructions = touchpointData.iterator().next().getInstructions();
Set keys = instructions.keySet();
assertEquals("1.2", 1, keys.size());
String unzip = (String) keys.iterator().next();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionWithAdviceFileTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionWithAdviceFileTest.java
index 076a41dc9..9c51eb546 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionWithAdviceFileTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionWithAdviceFileTest.java
@@ -12,7 +12,8 @@ package org.eclipse.equinox.p2.tests.publisher.actions;
import java.io.File;
import java.net.URI;
-import java.util.*;
+import java.util.Collection;
+import java.util.Iterator;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.p2.metadata.query.MatchQuery;
@@ -106,9 +107,9 @@ public class ProductActionWithAdviceFileTest extends ActionTest {
Collection productIUs = publisherResult.getIUs("productWithAdvice.product", IPublisherResult.NON_ROOT);
assertEquals("1.0", 1, productIUs.size());
IInstallableUnit product = (IInstallableUnit) productIUs.iterator().next();
- List<ITouchpointData> data = product.getTouchpointData();
+ Collection<ITouchpointData> data = product.getTouchpointData();
assertEquals("1.1", 1, data.size());
- String configure = data.get(0).getInstruction("configure").getBody();
+ String configure = data.iterator().next().getInstruction("configure").getBody();
assertEquals("1.2", "addRepository(type:0,location:http${#58}//download.eclipse.org/releases/fred);addRepository(type:1,location:http${#58}//download.eclipse.org/releases/fred);", configure);
}

Back to the top