|
Lines 19-28
Link Here
|
| 19 |
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability; |
19 |
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability; |
| 20 |
import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository; |
20 |
import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository; |
| 21 |
import org.eclipse.equinox.internal.provisional.p2.metadata.*; |
21 |
import org.eclipse.equinox.internal.provisional.p2.metadata.*; |
| 22 |
import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector; |
|
|
| 23 |
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery; |
22 |
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery; |
| 24 |
import org.eclipse.equinox.p2.internal.repository.tools.RepositoryUtilities; |
23 |
import org.eclipse.equinox.p2.internal.repository.tools.RepositoryUtilities; |
| 25 |
import org.eclipse.equinox.p2.metadata.*; |
24 |
import org.eclipse.equinox.p2.metadata.*; |
|
|
25 |
import org.eclipse.equinox.p2.metadata.query.IQueryResult; |
| 26 |
import org.eclipse.equinox.p2.repository.artifact.*; |
26 |
import org.eclipse.equinox.p2.repository.artifact.*; |
| 27 |
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; |
27 |
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; |
| 28 |
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager; |
28 |
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager; |
|
Lines 153-165
Link Here
|
| 153 |
} |
153 |
} |
| 154 |
|
154 |
|
| 155 |
public IInstallableUnit getIU(IMetadataRepository repository, String name, boolean assertNotNull) { |
155 |
public IInstallableUnit getIU(IMetadataRepository repository, String name, boolean assertNotNull) { |
| 156 |
Collector collector = repository.query(new InstallableUnitQuery(name), null); |
156 |
IQueryResult queryResult = repository.query(new InstallableUnitQuery(name), null); |
| 157 |
|
157 |
|
| 158 |
IInstallableUnit unit = null; |
158 |
IInstallableUnit unit = null; |
| 159 |
if (collector.size() > 0) |
159 |
if (queryResult.size() > 0) |
| 160 |
unit = (IInstallableUnit) collector.iterator().next(); |
160 |
unit = (IInstallableUnit) queryResult.iterator().next(); |
| 161 |
if (assertNotNull) { |
161 |
if (assertNotNull) { |
| 162 |
assertEquals(collector.size(), 1); |
162 |
assertEquals(queryResult.size(), 1); |
| 163 |
assertNotNull(unit); |
163 |
assertNotNull(unit); |
| 164 |
} |
164 |
} |
| 165 |
return unit; |
165 |
return unit; |