Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/LatestIUVersionElementWrapperTest.java')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/LatestIUVersionElementWrapperTest.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/LatestIUVersionElementWrapperTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/LatestIUVersionElementWrapperTest.java
index 9023e4c48..ff122e2e4 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/LatestIUVersionElementWrapperTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/LatestIUVersionElementWrapperTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 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
@@ -27,6 +27,7 @@ public class LatestIUVersionElementWrapperTest extends AvailableIUWrapperTest {
/**
* Returns the IU corresponding to the collected element.
*/
+ @Override
protected IInstallableUnit getIU(Object collected) {
if (collected instanceof IInstallableUnit)
return (IInstallableUnit) collected;
@@ -37,20 +38,20 @@ public class LatestIUVersionElementWrapperTest extends AvailableIUWrapperTest {
* Tests that only the latest version is collected.
*/
public void testCollectLatestIU() {
- IQuery latestIuVersionElementQuery = QueryUtil.createLatestIUQuery();
+ IQuery<IInstallableUnit> latestIuVersionElementQuery = QueryUtil.createLatestIUQuery();
IInstallableUnit unit1 = createIU("f1", Version.createOSGi(1, 0, 0));
IInstallableUnit unit2 = createIU("f1", Version.createOSGi(1, 0, 1));
- List listOfIUs = new ArrayList();
+ List<IInstallableUnit> listOfIUs = new ArrayList<>();
listOfIUs.add(unit1);
listOfIUs.add(unit2);
- IQueryResult collector = latestIuVersionElementQuery.perform(listOfIUs.iterator());
+ IQueryResult<IInstallableUnit> collector = latestIuVersionElementQuery.perform(listOfIUs.iterator());
assertEquals("1.0", 1, queryResultSize(collector));
IInstallableUnit collectedIU = getIU(collector.iterator().next());
assertEquals("1.1", unit2, collectedIU);
}
public void testMultipleIUsAndVersions() {
- IQuery latestIuVersionElementQuery = QueryUtil.createLatestIUQuery();
+ IQuery<IInstallableUnit> latestIuVersionElementQuery = QueryUtil.createLatestIUQuery();
IInstallableUnit unit1 = createIU("A", Version.createOSGi(1, 0, 0));
IInstallableUnit unit2 = createIU("A", Version.createOSGi(1, 0, 1));
IInstallableUnit unit3 = createIU("B", Version.createOSGi(1, 0, 1));
@@ -58,13 +59,13 @@ public class LatestIUVersionElementWrapperTest extends AvailableIUWrapperTest {
IInstallableUnit unit5 = createIU("C", Version.createOSGi(0, 1, 1));
// We should get unit 2, unit 3 and unit 5
- List listOfIUs = new ArrayList();
+ List<IInstallableUnit> listOfIUs = new ArrayList<>();
listOfIUs.add(unit1);
listOfIUs.add(unit2);
listOfIUs.add(unit3);
listOfIUs.add(unit4);
listOfIUs.add(unit5);
- IQueryResult collector = latestIuVersionElementQuery.perform(listOfIUs.iterator());
+ IQueryResult<IInstallableUnit> collector = latestIuVersionElementQuery.perform(listOfIUs.iterator());
// Should be 3 units
assertEquals("1.0", 3, queryResultSize(collector));

Back to the top