Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/ApplicablePatchQuery.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/AttachmentHelper.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OperationGenerator.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java24
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/rollback/FormerState.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileWriter.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Configure.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Install.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Unconfigure.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Uninstall.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/query/IUProfilePropertyQuery.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/CoreGarbageCollector.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.installer/src/org/eclipse/equinox/internal/p2/installer/InstallUpdateProductOperation.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/IUMap.java35
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TranslationSupport.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/IMatchQuery.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/IUPropertyQuery.java50
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/LatestIUVersionQuery.java45
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/MatchQuery.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/UpdateQuery.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/CategoryMemberQuery.java41
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/CategoryQuery.java39
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/FragmentQuery.java36
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/GroupQuery.java39
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/InstallableUnitQuery.java98
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/PatchQuery.java39
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQuery.java123
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQueryable.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/ExpressionMatchQuery.java (renamed from bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/ExpressionQuery.java)34
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/ExpressionQuery.java (renamed from bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/ExpressionContextQuery.java)38
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/LimitQuery.java33
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/PipedQuery.java63
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/QueryUtil.java520
-rw-r--r--bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/InstallOperation.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/UpdateOperation.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherApplication.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/QueryableFilterAdvice.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ApplicationLauncherAction.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src_ant/org/eclipse/equinox/internal/p2/publisher/ant/AbstractPublishTask.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/MirrorApplication.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/HostCheckAnalyzer.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/repository/tools/analyzer/RepositoryAnalyzer.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactDescriptorQuery.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactKeyQuery.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/IUPropertyPagesTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/planning/UpdatePlanning.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AnyRequiredCapabilityTest.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AvailableIUWrapperTest.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/CategoryElementWrapperTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/LatestIUVersionElementWrapperTest.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableMetadataRepositoryManagerTest.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/TranslationSupportTests.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java53
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/Repo2RunnableTaskTests.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryMissingSizeData.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug265577.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java91
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java53
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/ContextQuery.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/QueryTest.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/ReplacePlanTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/RollbackTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/UpdateTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/TestRepositoryWatcher.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/EngineTest.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/PhaseTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileMetadataRepositoryTest.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileRegistryTest.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java25
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/SurrogateProfileHandlerTest.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/DirectorTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/End2EndTest.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/RepoValidator.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/EclipseSDK33Test.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/PatchIUGeneration.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/FragmentTest.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/LatestIUTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/MultipleIUAndFragmentTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java19
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLMetadataRepositoryTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationMetadataTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/MetadataRepositoryPerformanceTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/PublisherPerformanceTest.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AbsolutePlanTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AbstractPlannerTest.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ActualChangeRequestTest.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ActualChangeRequestTest2.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AddIUProperty.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AdditionalConstraints.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstance.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstanceForCohostedMode.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInRunningInstance.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AllOptional.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AllOrbit.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AnotherSingleton.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug207319.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug249605.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252638.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252682.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet1.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet2.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug255984.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug262580.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug270656.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug270683.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271067.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271954.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug272251.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug278668.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug300104.java24
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302580.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302582.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302582c.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302582d.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/DependencyOnSelf.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/DisabledExplanation.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/DropinsScenario.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationDeepConflict.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationForOptionalDependencies.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationForPartialInstallation.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationLargeConflict.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationSeveralConflictingRoots.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/FindingPatchesThroughUpdates.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/GreedyRequirement.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUWithFilter.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUWithFilter2.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/InclusionRuleTest.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/InclusionRuleTest2.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MinimalInstall.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingDependency.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingDependency2.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingDependency3.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingNonGreedyRequirement.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingNonGreedyRequirement2.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptional.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalNonGreedyRequirement.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalWithDependencies.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalWithDependencies2.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalWithDependencies3.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MultipleProvider.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MultipleSingleton.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NegationTesting.java46
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NoRequirements.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState2.java17
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PP2ShouldFailToInstall.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchFailingToInstall.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest1.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest10.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest11.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest12.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest13.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest1b.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest1c.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest2.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest3.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest4.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest5.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest6.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest7.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest7b.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest8.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest9.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestMultiplePatch.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestMultiplePatch2.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestMultiplePatch3.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestOptional.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestOptional2.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestOptional3.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUninstall.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate2.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate3.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate4.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate5.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java60
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ProvisioningPlanQueryTest.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SDKPatchingTest1.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SDKPatchingTest2.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SWTFragment.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies2.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies3.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies4.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies5.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest2.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest3.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest4.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest5.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleSingleton.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimulatedSharedInstallTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SingletonOptionallyInstalled.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SingletonOptionallyInstalled2.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/TwoVersionsOfWSDL.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/UninstallEverything.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceFileParserTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalizationTests.java40
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionTest.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionWithAdviceFileTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/EvaluatorTest.java48
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/TestIndexes.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/TestQueryReimplementation.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddJVMArgumentActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddProgramArgumentActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddSourceBundleActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/CheckTrustActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/ChmodActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/CollectActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/EclipseTouchpointTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallBundleActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallFeatureActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/JVMArgumentActionLogicTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/LinkActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/MarkStartedActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveJVMArgumentActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveProgramArgumentActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveSourceBundleActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkDependentPropertyActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkIndependentPropertyActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetLauncherNameActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetProgramPropertyActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetStartLevelActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallBundleActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallFeatureActionTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatechecker/UpdateCheckerTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/CategoryIUXMLActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/CategoryXMLActionTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/LocalUpdatesiteTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AggregatedBundleRepository.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseMarkSetProvider.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/CheckTrustAction.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/InstallBundleAction.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/UninstallBundleAction.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/p2/touchpoint/eclipse/query/OSGiBundleQuery.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/operations/DiscoveryInstallOperation.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/repository/RepositoryDiscoveryStrategy.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/SDKPolicy.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUI.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryProvider.java28
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryableRepositoryManager.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/RepositoryLocationQuery.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/UpdateManagerCompatibility.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ExistingIUInProfileAction.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/AvailableIUWrapper.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/RequiredIUsQuery.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/AcceptLicensesWizardPage.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/Policy.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java16
292 files changed, 1578 insertions, 1949 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
index 7e2820a80..d3aba9d0f 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
@@ -549,7 +549,7 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
if (info.isGood())
repos.add(info.repo);
}
- CompoundQueryable<IArtifactKey> queryable = new CompoundQueryable<IArtifactKey>(repos);
+ IQueryable<IArtifactKey> queryable = QueryUtil.compoundQueryable(repos);
return queryable.query(query, monitor);
}
@@ -560,8 +560,7 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
if (info.isGood())
repos.add(info.repo.descriptorQueryable());
}
- CompoundQueryable<IArtifactDescriptor> queryable = new CompoundQueryable<IArtifactDescriptor>(repos);
- return queryable;
+ return QueryUtil.compoundQueryable(repos);
}
public IStatus executeBatch(Runnable runnable) {
diff --git a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java
index 912d92a15..3b105b1fa 100644
--- a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java
+++ b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java
@@ -22,10 +22,7 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.GroupQuery;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
-import org.eclipse.equinox.p2.query.IQueryResult;
-import org.eclipse.equinox.p2.query.IQueryable;
+import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.osgi.framework.console.CommandInterpreter;
@@ -234,7 +231,7 @@ public class ProvCommandProvider implements CommandProvider {
URI repoURL = null;
if (urlString != null && !urlString.equals(WILDCARD_ANY))
repoURL = toURI(interpreter, urlString);
- IInstallableUnit[] units = sort(ProvisioningHelper.getInstallableUnits(agent, repoURL, new InstallableUnitQuery(id, new VersionRange(version)), null));
+ IInstallableUnit[] units = sort(ProvisioningHelper.getInstallableUnits(agent, repoURL, QueryUtil.createIUQuery(id, new VersionRange(version)), null));
for (int i = 0; i < units.length; i++)
println(interpreter, units[i]);
}
@@ -259,7 +256,7 @@ public class ProvCommandProvider implements CommandProvider {
URI repoLocation = toURI(interpreter, urlString);
if (repoLocation == null)
return;
- IInstallableUnit[] units = sort(ProvisioningHelper.getInstallableUnits(agent, repoLocation, new InstallableUnitQuery(id, new VersionRange(version)), null));
+ IInstallableUnit[] units = sort(ProvisioningHelper.getInstallableUnits(agent, repoLocation, QueryUtil.createIUQuery(id, new VersionRange(version)), null));
for (int i = 0; i < units.length; i++)
println(interpreter, units[i]);
}
@@ -285,7 +282,7 @@ public class ProvCommandProvider implements CommandProvider {
if (queryable == null)
return;
}
- IInstallableUnit[] units = sort(queryable.query(new GroupQuery(), null));
+ IInstallableUnit[] units = sort(queryable.query(QueryUtil.createIUGroupQuery(), null));
for (int i = 0; i < units.length; i++)
println(interpreter, units[i]);
}
@@ -380,7 +377,7 @@ public class ProvCommandProvider implements CommandProvider {
return;
// list the profile contents
- IInstallableUnit[] result = sort(target.query(new InstallableUnitQuery(id, new VersionRange(range)), null));
+ IInstallableUnit[] result = sort(target.query(QueryUtil.createIUQuery(id, new VersionRange(range)), null));
for (int i = 0; i < result.length; i++)
interpreter.println(result[i]);
}
@@ -473,7 +470,7 @@ public class ProvCommandProvider implements CommandProvider {
interpreter.println("Profile " + profileId + " not found");
return;
}
- IInstallableUnit[] units = sort(profile.query(new GroupQuery(), new NullProgressMonitor()));
+ IInstallableUnit[] units = sort(profile.query(QueryUtil.createIUGroupQuery(), new NullProgressMonitor()));
// Now print out results
for (int i = 0; i < units.length; i++)
println(interpreter, units[i]);
diff --git a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
index e9c974ffb..c5350dd35 100644
--- a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
+++ b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
@@ -23,7 +23,6 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.IRepositoryManager;
@@ -179,7 +178,7 @@ public class ProvisioningHelper {
public static IStatus install(IProvisioningAgent agent, String unitId, String version, IProfile profile, IProgressMonitor progress) throws ProvisionException {
if (profile == null)
return null;
- IQueryResult<IInstallableUnit> units = getInstallableUnits(agent, (URI) null, new InstallableUnitQuery(unitId, Version.create(version)), progress);
+ IQueryResult<IInstallableUnit> units = getInstallableUnits(agent, (URI) null, QueryUtil.createIUQuery(unitId, Version.create(version)), progress);
if (units.isEmpty()) {
StringBuffer error = new StringBuffer();
error.append("Installable unit not found: " + unitId + ' ' + version + '\n');
@@ -278,7 +277,7 @@ public class ProvisioningHelper {
public static IStatus uninstall(IProvisioningAgent agent, String unitId, String version, IProfile profile, IProgressMonitor progress) throws ProvisionException {
if (profile == null)
return null;
- IQueryResult<IInstallableUnit> units = profile.query(new InstallableUnitQuery(unitId, Version.create(version)), progress);
+ IQueryResult<IInstallableUnit> units = profile.query(QueryUtil.createIUQuery(unitId, Version.create(version)), progress);
if (units.isEmpty()) {
StringBuffer error = new StringBuffer();
error.append("Installable unit not found: " + unitId + ' ' + version + '\n');
diff --git a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java
index 733b13b4e..f4b7230b9 100644
--- a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java
+++ b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java
@@ -23,12 +23,10 @@ import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.equinox.internal.p2.console.ProvisioningHelper;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
-import org.eclipse.equinox.internal.p2.metadata.query.LatestIUVersionQuery;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.p2.core.*;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
import org.eclipse.equinox.p2.query.*;
@@ -377,7 +375,7 @@ public class Application implements IApplication {
processArguments(args);
IStatus operationStatus = Status.OK_STATUS;
- InstallableUnitQuery query;
+ IQuery<IInstallableUnit> query;
IQueryResult<IInstallableUnit> roots;
try {
initializeRepositories(command == COMMAND_INSTALL);
@@ -386,8 +384,8 @@ public class Application implements IApplication {
case COMMAND_UNINSTALL :
IProfile profile = initializeProfile();
- query = new InstallableUnitQuery(root, version == null ? VersionRange.emptyRange : new VersionRange(version, true, version, true));
- roots = collectRootIUs(metadataRepositoryLocations, new LatestIUVersionQuery<IInstallableUnit>(query));
+ query = QueryUtil.createIUQuery(root, version == null ? VersionRange.emptyRange : new VersionRange(version, true, version, true));
+ roots = collectRootIUs(metadataRepositoryLocations, QueryUtil.createLatestQuery(query));
if (roots.isEmpty())
roots = profile.query(query, new NullProgressMonitor());
if (roots.isEmpty()) {
@@ -419,7 +417,7 @@ public class Application implements IApplication {
}
break;
case COMMAND_LIST :
- query = new InstallableUnitQuery(null, VersionRange.emptyRange);
+ query = QueryUtil.createIUQuery(null, VersionRange.emptyRange);
if (metadataRepositoryLocations == null)
missingArgument("metadataRepository"); //$NON-NLS-1$
@@ -480,7 +478,7 @@ public class Application implements IApplication {
List<IQueryable<IInstallableUnit>> locationQueryables = new ArrayList<IQueryable<IInstallableUnit>>(locations.length);
for (int i = 0; i < locations.length; i++)
locationQueryables.add(new LocationQueryable(locations[i]));
- return new CompoundQueryable<IInstallableUnit>(locationQueryables).query(query, nullMonitor);
+ return QueryUtil.compoundQueryable(locationQueryables).query(query, nullMonitor);
}
public Object start(IApplicationContext context) throws Exception {
diff --git a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java
index 99ac9a5e6..55ee391e0 100644
--- a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java
+++ b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java
@@ -23,13 +23,11 @@ import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.equinox.internal.p2.core.helpers.*;
import org.eclipse.equinox.internal.p2.metadata.VersionedId;
-import org.eclipse.equinox.internal.p2.metadata.query.LatestIUVersionQuery;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.p2.core.*;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
import org.eclipse.equinox.p2.query.*;
@@ -242,7 +240,7 @@ public class DirectorApplication implements IApplication {
List<IQueryable<IInstallableUnit>> locationQueryables = new ArrayList<IQueryable<IInstallableUnit>>(top);
for (int i = 0; i < top; i++)
locationQueryables.add(new LocationQueryable(metadataRepositoryLocations.get(i)));
- return new CompoundQueryable<IInstallableUnit>(locationQueryables).query(query, nullMonitor);
+ return QueryUtil.compoundQueryable(locationQueryables).query(query, nullMonitor);
}
private Collection<IInstallableUnit> collectRoots(IProfile profile, List<IVersionedId> rootNames, boolean forInstall) throws CoreException {
@@ -251,10 +249,10 @@ public class DirectorApplication implements IApplication {
for (int i = 0; i < top; ++i) {
IVersionedId rootName = rootNames.get(i);
Version v = rootName.getVersion();
- IQuery<IInstallableUnit> query = new InstallableUnitQuery(rootName.getId(), Version.emptyVersion.equals(v) ? VersionRange.emptyRange : new VersionRange(v, true, v, true));
+ IQuery<IInstallableUnit> query = QueryUtil.createIUQuery(rootName.getId(), Version.emptyVersion.equals(v) ? VersionRange.emptyRange : new VersionRange(v, true, v, true));
IQueryResult<IInstallableUnit> roots = null;
if (forInstall)
- roots = collectRootIUs(new LatestIUVersionQuery<IInstallableUnit>(query));
+ roots = collectRootIUs(QueryUtil.createLatestQuery(query));
if (roots == null || roots.isEmpty())
roots = profile.query(query, new NullProgressMonitor());
@@ -485,13 +483,13 @@ public class DirectorApplication implements IApplication {
ArrayList<IInstallableUnit> allRoots = new ArrayList<IInstallableUnit>();
if (rootsToList.size() == 0) {
- Iterator<IInstallableUnit> roots = collectRootIUs(InstallableUnitQuery.ANY).iterator();
+ Iterator<IInstallableUnit> roots = collectRootIUs(QueryUtil.createIUAnyQuery()).iterator();
while (roots.hasNext())
allRoots.add(roots.next());
} else {
for (IVersionedId rootName : rootsToList) {
Version v = rootName.getVersion();
- IQuery<IInstallableUnit> query = new InstallableUnitQuery(rootName.getId(), Version.emptyVersion.equals(v) ? VersionRange.emptyRange : new VersionRange(v, true, v, true));
+ IQuery<IInstallableUnit> query = QueryUtil.createIUQuery(rootName.getId(), Version.emptyVersion.equals(v) ? VersionRange.emptyRange : new VersionRange(v, true, v, true));
Iterator<IInstallableUnit> roots = collectRootIUs(query).iterator();
while (roots.hasNext())
allRoots.add(roots.next());
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/ApplicablePatchQuery.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/ApplicablePatchQuery.java
index 37b347b7d..bebb503a6 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/ApplicablePatchQuery.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/ApplicablePatchQuery.java
@@ -11,16 +11,17 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.director;
+import org.eclipse.equinox.p2.query.ExpressionMatchQuery;
+
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IInstallableUnitPatch;
import org.eclipse.equinox.p2.metadata.expression.ExpressionUtil;
import org.eclipse.equinox.p2.metadata.expression.IExpression;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
/**
* A query that accepts any patch that applies to a given installable unit.
*/
-public class ApplicablePatchQuery extends ExpressionQuery<IInstallableUnit> {
+public class ApplicablePatchQuery extends ExpressionMatchQuery<IInstallableUnit> {
private static final IExpression applicablePatches = ExpressionUtil.parse(//
"applicabilityScope.empty || applicabilityScope.exists(rqArr | rqArr.all(rq | $0 ~= rq))"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/AttachmentHelper.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/AttachmentHelper.java
index 547aca422..2602a002c 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/AttachmentHelper.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/AttachmentHelper.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.director;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import org.eclipse.equinox.p2.metadata.IInstallableUnitFragment;
import java.util.*;
@@ -17,7 +19,6 @@ import java.util.Map.Entry;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IRequirement;
-import org.eclipse.equinox.p2.metadata.query.FragmentQuery;
public class AttachmentHelper {
private static final IInstallableUnitFragment[] NO_FRAGMENTS = new IInstallableUnitFragment[0];
@@ -85,7 +86,7 @@ public class AttachmentHelper {
if (iu == null)
continue;
//just return fragments as they are
- if (FragmentQuery.isFragment(iu)) {
+ if (QueryUtil.isFragment(iu)) {
result.add(iu);
continue;
}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OperationGenerator.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OperationGenerator.java
index fee06b841..d2371dacb 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OperationGenerator.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OperationGenerator.java
@@ -16,7 +16,8 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.Inst
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IInstallableUnitFragment;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.query.IQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
public class OperationGenerator {
private static final IInstallableUnit NULL_IU = MetadataFactory.createResolvedInstallableUnit(MetadataFactory.createInstallableUnit(new InstallableUnitDescription()), new IInstallableUnitFragment[0]);
@@ -135,7 +136,7 @@ public class OperationGenerator {
continue;
//when the ui we update from is in the new state, skip (for example FROM is A, C, B & TO is C (update of
- InstallableUnitQuery updateQuery = new InstallableUnitQuery(iuTo.getUpdateDescriptor().getId(), iuTo.getUpdateDescriptor().getRange());
+ IQuery<IInstallableUnit> updateQuery = QueryUtil.createIUQuery(iuTo.getUpdateDescriptor().getId(), iuTo.getUpdateDescriptor().getRange());
Iterator<IInstallableUnit> updates = updateQuery.perform(fromIdIndexList.iterator()).iterator();
if (!updates.hasNext()) { //Nothing to update from.
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java
index fb568a9ca..41bcc1b71 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java
@@ -21,7 +21,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.internal.p2.core.helpers.Tracing;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.*;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.Filter;
@@ -139,7 +138,7 @@ public class Projector {
}
protected boolean isInstalled(IInstallableUnit iu) {
- return !lastState.query(new InstallableUnitQuery(iu), null).isEmpty();
+ return !lastState.query(QueryUtil.createIUQuery(iu), null).isEmpty();
}
public void encode(IInstallableUnit entryPointIU, IInstallableUnit[] alreadyExistingRoots, IQueryable<IInstallableUnit> installedIUs, Collection<IInstallableUnit> newRoots, IProgressMonitor monitor) {
@@ -160,7 +159,7 @@ public class Projector {
solver = SolverFactory.newEclipseP2();
}
solver.setTimeoutOnConflicts(1000);
- IQueryResult<IInstallableUnit> queryResult = picker.query(InstallableUnitQuery.ANY, null);
+ IQueryResult<IInstallableUnit> queryResult = picker.query(QueryUtil.createIUAnyQuery(), null);
if (DEBUG_ENCODING) {
dependencyHelper = new DependencyHelper<Object, Explanation>(solver, false);
} else {
@@ -206,7 +205,7 @@ public class Projector {
* Efficiently compute the size of a queryable
*/
private int sizeOf(IQueryable<IInstallableUnit> installedIUs) {
- IQueryResult<IInstallableUnit> qr = installedIUs.query(InstallableUnitQuery.ANY, null);
+ IQueryResult<IInstallableUnit> qr = installedIUs.query(QueryUtil.createIUAnyQuery(), null);
if (qr instanceof Collector<?>)
return ((Collector<?>) qr).size();
return qr.unmodifiableSet().size();
@@ -268,7 +267,7 @@ public class Projector {
for (IRequirement req : reqs) {
if (req.getMin() > 0)
continue;
- IQueryResult<IInstallableUnit> matches = picker.query(ExpressionQuery.create(req.getMatches()), null);
+ IQueryResult<IInstallableUnit> matches = picker.query(QueryUtil.createMatchQuery(req.getMatches()), null);
for (Iterator<IInstallableUnit> iterator = matches.iterator(); iterator.hasNext();) {
IInstallableUnit match = iterator.next();
if (match instanceof IInstallableUnitPatch) {
@@ -654,7 +653,7 @@ public class Projector {
*/
private List<IInstallableUnit> getApplicableMatches(IRequirement req) {
List<IInstallableUnit> target = new ArrayList<IInstallableUnit>();
- IQueryResult<IInstallableUnit> matches = picker.query(ExpressionQuery.create(req.getMatches()), null);
+ IQueryResult<IInstallableUnit> matches = picker.query(QueryUtil.createMatchQuery(req.getMatches()), null);
for (Iterator<IInstallableUnit> iterator = matches.iterator(); iterator.hasNext();) {
IInstallableUnit match = iterator.next();
if (isApplicable(match)) {
@@ -744,7 +743,7 @@ public class Projector {
//Return IUPatches that are applicable for the given iu
private IQueryResult<IInstallableUnit> getApplicablePatches(IInstallableUnit iu) {
if (patches == null)
- patches = new QueryableArray(picker.query(new PatchQuery(), null).toArray(IInstallableUnit.class));
+ patches = new QueryableArray(picker.query(QueryUtil.createIUPatchQuery(), null).toArray(IInstallableUnit.class));
return patches.query(new ApplicablePatchQuery(iu), null);
}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java
index 0c45a6d4c..f49fbef9b 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java
@@ -11,6 +11,8 @@
******************************************************************************/
package org.eclipse.equinox.internal.p2.director;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.lang.reflect.Method;
import java.net.URI;
import java.util.*;
@@ -28,8 +30,6 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
import org.eclipse.equinox.p2.query.*;
@@ -197,7 +197,7 @@ public class SimplePlanner implements IPlanner {
ProvisioningContext context = new ProvisioningContext(new URI[0]);
if (context.getProperty(INCLUDE_PROFILE_IUS) == null)
context.setProperty(INCLUDE_PROFILE_IUS, Boolean.FALSE.toString());
- context.setExtraIUs(Arrays.asList(targetProfile.available(InstallableUnitQuery.ANY, null).toArray(IInstallableUnit.class)));
+ context.setExtraIUs(Arrays.asList(targetProfile.available(QueryUtil.createIUAnyQuery(), null).toArray(IInstallableUnit.class)));
return getProvisioningPlan(profileChangeRequest, context, sub.newChild(ExpandWork / 2));
} finally {
sub.done();
@@ -249,7 +249,7 @@ public class SimplePlanner implements IPlanner {
throw new OperationCanceledException();
IMetadataRepository repository = repoManager.loadRepository(repositories[i], sub.newChild(100));
- IQueryResult<IInstallableUnit> matches = repository.query(new InstallableUnitQuery(null, VersionRange.emptyRange), sub.newChild(100));
+ IQueryResult<IInstallableUnit> matches = repository.query(QueryUtil.createIUQuery(null, VersionRange.emptyRange), sub.newChild(100));
for (Iterator<IInstallableUnit> it = matches.iterator(); it.hasNext();) {
IInstallableUnit iu = it.next();
String key = iu.getId() + "_" + iu.getVersion().toString(); //$NON-NLS-1$
@@ -308,7 +308,7 @@ public class SimplePlanner implements IPlanner {
List<IInstallableUnit> extraIUs = new ArrayList<IInstallableUnit>(profileChangeRequest.getAdditions());
extraIUs.addAll(profileChangeRequest.getRemovals());
if (context == null || context.getProperty(INCLUDE_PROFILE_IUS) == null || context.getProperty(INCLUDE_PROFILE_IUS).equalsIgnoreCase(Boolean.TRUE.toString())) {
- Iterator<IInstallableUnit> itor = profile.available(InstallableUnitQuery.ANY, null).iterator();
+ Iterator<IInstallableUnit> itor = profile.available(QueryUtil.createIUAnyQuery(), null).iterator();
while (itor.hasNext())
extraIUs.add(itor.next());
}
@@ -393,7 +393,7 @@ public class SimplePlanner implements IPlanner {
}
private IProvisioningPlan generateAbsoluteProvisioningPlan(ProfileChangeRequest profileChangeRequest, ProvisioningContext context, IProgressMonitor monitor) {
- Set<IInstallableUnit> toState = profileChangeRequest.getProfile().query(InstallableUnitQuery.ANY, null).toSet();
+ Set<IInstallableUnit> toState = profileChangeRequest.getProfile().query(QueryUtil.createIUAnyQuery(), null).toSet();
HashSet<IInstallableUnit> fromState = new HashSet<IInstallableUnit>(toState);
toState.removeAll(profileChangeRequest.getRemovals());
toState.addAll(profileChangeRequest.getAdditions());
@@ -427,7 +427,7 @@ public class SimplePlanner implements IPlanner {
private Collection<IRequirement> areMetaRequirementsSatisfied(IProfile oldProfile, Collection<IInstallableUnit> newProfile, IProvisioningPlan initialPlan) {
Collection<IRequirement> allMetaRequirements = extractMetaRequirements(newProfile, initialPlan);
for (IRequirement requirement : allMetaRequirements) {
- if (oldProfile.query(new LimitQuery<IInstallableUnit>(ExpressionQuery.create(requirement.getMatches()), 1), null).isEmpty())
+ if (oldProfile.query(QueryUtil.createLimitQuery(QueryUtil.createMatchQuery(requirement.getMatches()), 1), null).isEmpty())
return allMetaRequirements;
}
return null;
@@ -439,7 +439,7 @@ public class SimplePlanner implements IPlanner {
for (IInstallableUnit iu : ius) {
allMetaRequirements.addAll(iu.getMetaRequiredCapabilities());
}
- IQueryResult<IInstallableUnit> queryResult = plan.getRemovals().query(InstallableUnitQuery.ANY, null);
+ IQueryResult<IInstallableUnit> queryResult = plan.getRemovals().query(QueryUtil.createIUAnyQuery(), null);
for (Iterator<IInstallableUnit> iterator = queryResult.iterator(); iterator.hasNext();) {
IInstallableUnit iu = iterator.next();
allMetaRequirements.addAll(iu.getMetaRequiredCapabilities());
@@ -572,7 +572,7 @@ public class SimplePlanner implements IPlanner {
LogHelper.log(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, "The resolution of the previous state contained in profile " + initialRequest.getProfile().getProfileId() + " version " + initialRequest.getProfile().getTimestamp() + " failed.")); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
return (IProvisioningPlan) initialSolution;
}
- Iterator<IInstallableUnit> profileState = initialRequest.getProfile().query(InstallableUnitQuery.ANY, null).iterator();
+ Iterator<IInstallableUnit> profileState = initialRequest.getProfile().query(QueryUtil.createIUAnyQuery(), null).iterator();
Collection<IInstallableUnit> initialState = AttachmentHelper.attachFragments(profileState, ((Projector) initialSolution).getFragmentAssociation());
IProvisioningPlan agentPlan = generateProvisioningPlan(initialState, agentState, initialRequest, null, initialContext);
@@ -596,7 +596,7 @@ public class SimplePlanner implements IPlanner {
LogHelper.log(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, "The resolution of the previous state contained in profile " + request.getProfile().getProfileId() + " version " + request.getProfile().getTimestamp() + " failed.")); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
return (IProvisioningPlan) initialSolution;
}
- Iterator<IInstallableUnit> profileState = request.getProfile().query(InstallableUnitQuery.ANY, null).iterator();
+ Iterator<IInstallableUnit> profileState = request.getProfile().query(QueryUtil.createIUAnyQuery(), null).iterator();
Collection<IInstallableUnit> initialState = AttachmentHelper.attachFragments(profileState, ((Projector) initialSolution).getFragmentAssociation());
//Generate the plan
@@ -607,12 +607,12 @@ public class SimplePlanner implements IPlanner {
ProvisioningContext noRepoContext = new ProvisioningContext(new URI[0]);
noRepoContext.setArtifactRepositories(new URI[0]);
noRepoContext.setProperty(INCLUDE_PROFILE_IUS, Boolean.FALSE.toString());
- noRepoContext.setExtraIUs(new ArrayList<IInstallableUnit>(request.getProfile().query(InstallableUnitQuery.ANY, new NullProgressMonitor()).unmodifiableSet()));
+ noRepoContext.setExtraIUs(new ArrayList<IInstallableUnit>(request.getProfile().query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()).unmodifiableSet()));
return noRepoContext;
}
private IInstallableUnit getPreviousIUForMetaRequirements(IProfile profile, String iuId, IProgressMonitor monitor) {
- IQueryResult<IInstallableUnit> c = profile.query(new InstallableUnitQuery(iuId), monitor);
+ IQueryResult<IInstallableUnit> c = profile.query(QueryUtil.createIUQuery(iuId), monitor);
if (c.isEmpty())
return null;
return c.iterator().next();
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java
index 7462c8c77..7672190f0 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java
@@ -10,12 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.director;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.p2.core.helpers.Tracing;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.query.IQueryable;
import org.eclipse.osgi.util.NLS;
@@ -159,7 +160,7 @@ public class Slicer {
private void expandRequirement(IInstallableUnit iu, IRequirement req) {
if (req.getMax() == 0)
return;
- IQueryResult<IInstallableUnit> matches = possibilites.query(ExpressionQuery.create(req.getMatches()), null);
+ IQueryResult<IInstallableUnit> matches = possibilites.query(QueryUtil.createMatchQuery(req.getMatches()), null);
int validMatches = 0;
for (Iterator<IInstallableUnit> iterator = matches.iterator(); iterator.hasNext();) {
IInstallableUnit match = iterator.next();
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/rollback/FormerState.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/rollback/FormerState.java
index c5bc38cf4..39b476e95 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/rollback/FormerState.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/rollback/FormerState.java
@@ -11,13 +11,14 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.rollback;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.util.*;
import java.util.Map.Entry;
import org.eclipse.equinox.internal.p2.director.SimplePlanner;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
public class FormerState {
@@ -33,8 +34,8 @@ public class FormerState {
}
private static void synchronizeAllIUProperties(IProfileChangeRequest request, IProfile current, IProfile target) {
- Set<IInstallableUnit> currentIUset = current.query(InstallableUnitQuery.ANY, null).unmodifiableSet();
- Iterator<IInstallableUnit> targetIUs = target.query(InstallableUnitQuery.ANY, null).iterator();
+ Set<IInstallableUnit> currentIUset = current.query(QueryUtil.createIUAnyQuery(), null).unmodifiableSet();
+ Iterator<IInstallableUnit> targetIUs = target.query(QueryUtil.createIUAnyQuery(), null).iterator();
List<IInstallableUnit> iusToAdd = new ArrayList<IInstallableUnit>();
List<IInstallableUnit> iusToUpdate = new ArrayList<IInstallableUnit>();
while (targetIUs.hasNext()) {
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java
index ac8a55a41..692f692f8 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java
@@ -248,7 +248,7 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
}
};
- return new CompoundQueryable<IArtifactDescriptor>(cached, innerRepo.descriptorQueryable());
+ return QueryUtil.compoundQueryable(cached, innerRepo.descriptorQueryable());
}
public IQueryResult<IArtifactKey> query(IQuery<IArtifactKey> query, IProgressMonitor monitor) {
@@ -259,7 +259,7 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
}
};
- CompoundQueryable<IArtifactKey> compound = new CompoundQueryable<IArtifactKey>(cached, innerRepo);
+ IQueryable<IArtifactKey> compound = QueryUtil.compoundQueryable(cached, innerRepo);
return compound.query(query, monitor);
}
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
index 7abea5696..d2fc576b8 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
@@ -11,6 +11,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.provisional.p2.directorywatcher;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.File;
import java.net.URI;
import java.util.*;
@@ -20,8 +22,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.p2.update.Site;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.publisher.*;
import org.eclipse.equinox.p2.publisher.eclipse.BundlesAction;
import org.eclipse.equinox.p2.publisher.eclipse.FeaturesAction;
@@ -217,7 +217,7 @@ public class RepositoryListener extends DirectoryChangeListener {
// create a query that will identify all ius related to removed files.
// It's safe to compare a String with a File since the auto coercion will
// first convert the String into a File.
- IQuery<IInstallableUnit> removeQuery = ExpressionQuery.create( //
+ IQuery<IInstallableUnit> removeQuery = QueryUtil.createMatchQuery( //
"$1.exists(x | properties[$0] == x)", FILE_NAME, removedFiles); //$NON-NLS-1$
IQueryResult<IInstallableUnit> toRemove = metadataRepository.query(removeQuery, null);
metadataRepository.removeInstallableUnits(toRemove.toSet());
@@ -262,7 +262,7 @@ public class RepositoryListener extends DirectoryChangeListener {
private void synchronizeCurrentFiles() {
currentFiles.clear();
if (metadataRepository != null) {
- IQueryResult<IInstallableUnit> ius = metadataRepository.query(InstallableUnitQuery.ANY, null);
+ IQueryResult<IInstallableUnit> ius = metadataRepository.query(QueryUtil.createIUAnyQuery(), null);
for (Iterator<IInstallableUnit> it = ius.iterator(); it.hasNext();) {
IInstallableUnit iu = it.next();
String filename = iu.getProperty(FILE_NAME);
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileWriter.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileWriter.java
index 1af6717c4..747d4edd9 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileWriter.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileWriter.java
@@ -10,13 +10,14 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.engine;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.IOException;
import java.io.OutputStream;
import java.util.*;
import org.eclipse.equinox.internal.p2.metadata.repository.io.MetadataWriter;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
public class ProfileWriter extends MetadataWriter implements ProfileXMLConstants {
@@ -29,7 +30,7 @@ public class ProfileWriter extends MetadataWriter implements ProfileXMLConstants
attribute(ID_ATTRIBUTE, profile.getProfileId());
attribute(TIMESTAMP_ATTRIBUTE, Long.toString(profile.getTimestamp()));
writeProperties(profile.getProperties());
- ArrayList<IInstallableUnit> ius = new ArrayList<IInstallableUnit>(profile.query(InstallableUnitQuery.ANY, null).unmodifiableSet());
+ ArrayList<IInstallableUnit> ius = new ArrayList<IInstallableUnit>(profile.query(QueryUtil.createIUAnyQuery(), null).unmodifiableSet());
Collections.sort(ius, new Comparator<IInstallableUnit>() {
public int compare(IInstallableUnit iu1, IInstallableUnit iu2) {
int IdCompare = iu1.getId().compareTo(iu2.getId());
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java
index 651a7c648..e067d1042 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java
@@ -27,8 +27,8 @@ import org.eclipse.equinox.p2.core.*;
import org.eclipse.equinox.p2.core.spi.IAgentService;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.BundleContext;
@@ -294,7 +294,7 @@ public class SimpleProfileRegistry implements IProfileRegistry, IAgentService {
current.clearInstallableUnits();
current.addProperties(profile.getLocalProperties());
- IQueryResult<IInstallableUnit> queryResult = profile.query(InstallableUnitQuery.ANY, null);
+ IQueryResult<IInstallableUnit> queryResult = profile.query(QueryUtil.createIUAnyQuery(), null);
for (Iterator<IInstallableUnit> queryResultIt = queryResult.iterator(); queryResultIt.hasNext();) {
IInstallableUnit iu = queryResultIt.next();
current.addInstallableUnit(iu);
@@ -523,7 +523,7 @@ public class SimpleProfileRegistry implements IProfileRegistry, IAgentService {
return false;
//check whether the profile contains the p2 engine from 3.5.0 or earlier
- return profile.available(new InstallableUnitQuery("org.eclipse.equinox.p2.engine", new VersionRange("[0.0.0, 1.0.101)")), null).isEmpty(); //$NON-NLS-1$//$NON-NLS-2$
+ return profile.available(QueryUtil.createIUQuery("org.eclipse.equinox.p2.engine", new VersionRange("[0.0.0, 1.0.101)")), null).isEmpty(); //$NON-NLS-1$//$NON-NLS-2$
}
private void deleteProfile(String profileId) {
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java
index c7a695ea9..af263bdec 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.engine;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.File;
import java.lang.ref.SoftReference;
import java.net.MalformedURLException;
@@ -22,8 +24,6 @@ import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery;
import org.eclipse.equinox.p2.engine.query.UserVisibleRootQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.osgi.util.NLS;
@@ -49,7 +49,7 @@ public class SurrogateProfileHandler implements ISurrogateProfileHandler {
private SoftReference<IProfile> cachedProfile;
private static void addSharedProfileBaseIUs(final IProfile sharedProfile, final Profile userProfile) {
- IQuery<IInstallableUnit> rootIUQuery = ExpressionQuery.create( //
+ IQuery<IInstallableUnit> rootIUQuery = QueryUtil.createMatchQuery( //
"profileProperties[$0] == 'true' || touchpointType.id == $1",//$NON-NLS-1$
IProfile.PROP_PROFILE_ROOT_IU, NATIVE_TOUCHPOINT_TYPE);
IQueryResult<IInstallableUnit> rootIUs = sharedProfile.query(rootIUQuery, null);
@@ -202,7 +202,7 @@ public class SurrogateProfileHandler implements ISurrogateProfileHandler {
Profile writableUserProfile = (Profile) userProfile;
updateProperties(sharedProfile, writableUserProfile);
removeUserProfileBaseIUs(writableUserProfile);
- if (!userProfile.query(InstallableUnitQuery.ANY, null).isEmpty()) {
+ if (!userProfile.query(QueryUtil.createIUAnyQuery(), null).isEmpty()) {
writableUserProfile.setProperty(PROP_RESOLVE, Boolean.TRUE.toString());
markRootsOptional(writableUserProfile);
}
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Configure.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Configure.java
index 9a535be81..1acf55f8c 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Configure.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Configure.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.engine.phases;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.engine.*;
@@ -18,7 +20,6 @@ import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.FragmentQuery;
import org.eclipse.osgi.util.NLS;
public class Configure extends InstallableUnitPhase {
@@ -33,7 +34,7 @@ public class Configure extends InstallableUnitPhase {
protected List<ProvisioningAction> getActions(InstallableUnitOperand currentOperand) {
IInstallableUnit unit = currentOperand.second();
- if (FragmentQuery.isFragment(unit))
+ if (QueryUtil.isFragment(unit))
return null;
return getActions(unit, phaseId);
}
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Install.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Install.java
index 6c33b0ad6..ae9eff003 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Install.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Install.java
@@ -10,19 +10,18 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.engine.phases;
-import org.eclipse.equinox.internal.p2.engine.InstallableUnitEvent;
-
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.engine.*;
import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
-import org.eclipse.equinox.p2.engine.*;
+import org.eclipse.equinox.p2.engine.DefaultPhaseSet;
+import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.engine.spi.Touchpoint;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.FragmentQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.osgi.util.NLS;
public class Install extends InstallableUnitPhase {
@@ -95,7 +94,7 @@ public class Install extends InstallableUnitPhase {
ArrayList<ProvisioningAction> actions = new ArrayList<ProvisioningAction>();
actions.add(beforeAction);
- if (FragmentQuery.isFragment(unit)) {
+ if (QueryUtil.isFragment(unit)) {
actions.add(afterAction);
return actions;
}
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Unconfigure.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Unconfigure.java
index 6378c22d2..1e48ccdf5 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Unconfigure.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Unconfigure.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.engine.phases;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.engine.*;
@@ -18,7 +20,6 @@ import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.FragmentQuery;
public class Unconfigure extends InstallableUnitPhase {
@@ -38,7 +39,7 @@ public class Unconfigure extends InstallableUnitPhase {
//TODO: monitor.subTask(NLS.bind(Messages.Engine_Unconfiguring_IU, unit.getId()));
IInstallableUnit unit = currentOperand.first();
- if (FragmentQuery.isFragment(unit))
+ if (QueryUtil.isFragment(unit))
return null;
return getActions(unit, phaseId);
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Uninstall.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Uninstall.java
index f022c45ea..5a7690638 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Uninstall.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Uninstall.java
@@ -10,19 +10,18 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.engine.phases;
-import org.eclipse.equinox.internal.p2.engine.InstallableUnitEvent;
-
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.engine.*;
import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
-import org.eclipse.equinox.p2.engine.*;
+import org.eclipse.equinox.p2.engine.DefaultPhaseSet;
+import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.engine.spi.Touchpoint;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.FragmentQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
public class Uninstall extends InstallableUnitPhase {
@@ -96,7 +95,7 @@ public class Uninstall extends InstallableUnitPhase {
ArrayList<ProvisioningAction> actions = new ArrayList<ProvisioningAction>();
actions.add(beforeAction);
- if (FragmentQuery.isFragment(unit)) {
+ if (QueryUtil.isFragment(unit)) {
actions.add(afterAction);
return actions;
}
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/query/IUProfilePropertyQuery.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/query/IUProfilePropertyQuery.java
index 485094bf2..be1a5fa68 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/query/IUProfilePropertyQuery.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/query/IUProfilePropertyQuery.java
@@ -11,16 +11,17 @@
*******************************************************************************/
package org.eclipse.equinox.p2.engine.query;
+import org.eclipse.equinox.p2.query.ExpressionMatchQuery;
+
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.expression.*;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
/**
* A query that searches for {@link IInstallableUnit} instances that have
* a property associated with the specified profile, whose value matches the provided value.
* @since 2.0
*/
-public class IUProfilePropertyQuery extends ExpressionQuery<IInstallableUnit> {
+public class IUProfilePropertyQuery extends ExpressionMatchQuery<IInstallableUnit> {
public static final String ANY = "*"; //$NON-NLS-1$
private static final IExpression matchValue = ExpressionUtil.parse("profileProperties[$0] == $1"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/CoreGarbageCollector.java b/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/CoreGarbageCollector.java
index 8b2eda0de..81b942de7 100644
--- a/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/CoreGarbageCollector.java
+++ b/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/CoreGarbageCollector.java
@@ -10,10 +10,11 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.garbagecollector;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.util.*;
import org.eclipse.equinox.internal.p2.core.helpers.Tracing;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
-import org.eclipse.equinox.p2.metadata.query.ExpressionContextQuery;
import org.eclipse.equinox.p2.query.IQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
@@ -36,7 +37,7 @@ public class CoreGarbageCollector {
public synchronized void clean(IArtifactKey[] markSet, final IArtifactRepository aRepository) {
Set<IArtifactKey> set = new HashSet<IArtifactKey>(Arrays.asList(markSet));
//this query will match all artifact keys that are not in the given set
- IQuery<IArtifactKey> query = ExpressionContextQuery.createQuery(IArtifactKey.class, "unique($0)", set); //$NON-NLS-1$
+ IQuery<IArtifactKey> query = QueryUtil.createQuery(IArtifactKey.class, "unique($0)", set); //$NON-NLS-1$
final IQueryResult<IArtifactKey> inactive = aRepository.query(query, null);
aRepository.executeBatch(new Runnable() {
public void run() {
diff --git a/bundles/org.eclipse.equinox.p2.installer/src/org/eclipse/equinox/internal/p2/installer/InstallUpdateProductOperation.java b/bundles/org.eclipse.equinox.p2.installer/src/org/eclipse/equinox/internal/p2/installer/InstallUpdateProductOperation.java
index ec638b62d..ddce58730 100644
--- a/bundles/org.eclipse.equinox.p2.installer/src/org/eclipse/equinox/internal/p2/installer/InstallUpdateProductOperation.java
+++ b/bundles/org.eclipse.equinox.p2.installer/src/org/eclipse/equinox/internal/p2/installer/InstallUpdateProductOperation.java
@@ -25,9 +25,7 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
-import org.eclipse.equinox.p2.query.IQuery;
-import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.osgi.service.environment.EnvironmentInfo;
@@ -71,7 +69,7 @@ public class InstallUpdateProductOperation implements IInstallOperation {
* This profile is being updated; return the units to uninstall from the profile.
*/
private IQueryResult<IInstallableUnit> computeUnitsToUninstall(IProfile p) {
- return p.query(InstallableUnitQuery.ANY, null);
+ return p.query(QueryUtil.createIUAnyQuery(), null);
}
/**
@@ -148,7 +146,7 @@ public class InstallUpdateProductOperation implements IInstallOperation {
VersionRange range = VersionRange.emptyRange;
if (version != null && !version.equals(Version.emptyVersion))
range = new VersionRange(version, true, version, true);
- IQuery<IInstallableUnit> query = new InstallableUnitQuery(id, range);
+ IQuery<IInstallableUnit> query = QueryUtil.createIUQuery(id, range);
Iterator<IInstallableUnit> matches = metadataRepoMan.query(query, null).iterator();
// pick the newest match
IInstallableUnit newest = null;
diff --git a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java
index bd01ab034..0bda33b6e 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java
@@ -23,7 +23,6 @@ import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
import org.eclipse.equinox.internal.p2.metadata.generator.*;
import org.eclipse.equinox.internal.p2.metadata.generator.Messages;
import org.eclipse.equinox.internal.p2.metadata.generator.features.*;
-import org.eclipse.equinox.internal.p2.metadata.query.LatestIUVersionQuery;
import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
@@ -32,9 +31,7 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.VersionRange;
import org.eclipse.equinox.p2.metadata.expression.ExpressionUtil;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
-import org.eclipse.equinox.p2.query.IQuery;
-import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
@@ -190,7 +187,7 @@ public class Generator {
GeneratorResult productContents = new GeneratorResult();
ProductQuery productQuery = new ProductQuery(productFile, info.getFlavor(), result.configurationIUs, info.getVersionAdvice());
- IQuery query = new LatestIUVersionQuery(productQuery);
+ IQuery query = QueryUtil.createLatestQuery(productQuery);
IQueryResult queryResult = info.getMetadataRepository().query(query, null);
for (Iterator iterator = queryResult.iterator(); iterator.hasNext();) {
productContents.rootIUs.add(iterator.next());
@@ -528,7 +525,7 @@ public class Generator {
}
//Query the repo
- IQuery query = new InstallableUnitQuery(name);
+ IQuery query = QueryUtil.createIUQuery(name);
Iterator matches = info.getMetadataRepository().query(query, null).iterator();
//pick the newest match
IInstallableUnit newest = null;
@@ -642,7 +639,7 @@ public class Generator {
if (configuredIU == null) {
if (!generateRootIU && data == null)
continue;
- IQuery query = new InstallableUnitQuery(bundle.getSymbolicName());
+ IQuery query = QueryUtil.createIUQuery(bundle.getSymbolicName());
IMetadataRepository metadataRepository = info.getMetadataRepository();
if (metadataRepository == null)
continue;
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java
index 1d99055a5..8765d5258 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java
@@ -131,7 +131,7 @@ public class CompositeMetadataRepository extends AbstractMetadataRepository impl
monitor = new NullProgressMonitor();
try {
// Query all the all the repositories this composite repo contains
- CompoundQueryable<IInstallableUnit> queryable = new CompoundQueryable<IInstallableUnit>(loadedRepos);
+ IQueryable<IInstallableUnit> queryable = QueryUtil.compoundQueryable(loadedRepos);
return queryable.query(query, monitor);
} finally {
if (monitor != null)
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java
index 290338a5e..f6863fcc6 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java
@@ -11,6 +11,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.metadata.repository;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.*;
import java.lang.reflect.Constructor;
import java.net.MalformedURLException;
@@ -27,7 +29,6 @@ import org.eclipse.equinox.internal.p2.persistence.XMLWriter;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.spi.AbstractMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.spi.AbstractMetadataRepository.RepositoryState;
@@ -143,7 +144,7 @@ public class MetadataRepositoryIO {
writeRepositoryReferences(references.iterator(), references.size());
}
// The size attribute is a problematic since it forces the use of a collection.
- Set<IInstallableUnit> units = repository.query(InstallableUnitQuery.ANY, null).unmodifiableSet();
+ Set<IInstallableUnit> units = repository.query(QueryUtil.createIUAnyQuery(), null).unmodifiableSet();
writeInstallableUnits(units.iterator(), units.size());
end(REPOSITORY_ELEMENT);
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java
index 1a5801bb1..ee36b5897 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java
@@ -11,6 +11,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.metadata.repository.io;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
@@ -22,7 +24,6 @@ import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.p2.metadata.repository.Activator;
import org.eclipse.equinox.internal.p2.persistence.XMLWriter;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.FragmentQuery;
public abstract class MetadataWriter extends XMLWriter implements XMLConstants {
@@ -56,7 +57,7 @@ public abstract class MetadataWriter extends XMLWriter implements XMLConstants {
attribute(SINGLETON_ATTRIBUTE, iu.isSingleton(), true);
// attribute(FRAGMENT_ATTRIBUTE, iu.isFragment(), false);
- if (FragmentQuery.isFragment(iu) && iu instanceof IInstallableUnitFragment) {
+ if (QueryUtil.isFragment(iu) && iu instanceof IInstallableUnitFragment) {
IInstallableUnitFragment fragment = (IInstallableUnitFragment) iu;
writeHostRequiredCapabilities(fragment.getHost());
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/IUMap.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/IUMap.java
index 32715828f..ec1fb81d3 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/IUMap.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/IUMap.java
@@ -15,8 +15,7 @@ import java.util.*;
import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
-import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.*;
/**
* A map that stores {@link IInstallableUnit} instances in a way that is efficient to query
@@ -136,19 +135,8 @@ public class IUMap {
return new MapIterator();
}
- public IQueryResult<IInstallableUnit> query(InstallableUnitQuery query) {
- //iterate over the entire map, or just the IU's with the given id
- Iterator<IInstallableUnit> candidates;
- if (query.getId() == null)
- candidates = iterator();
- else
- candidates = getUnits(query.getId()).iterator();
- return query.perform(candidates);
-
- }
-
public boolean contains(IInstallableUnit unit) {
- return get(unit.getId(), unit.getVersion()) != null;
+ return !internalGet(unit.getId(), unit.getVersion()).isEmpty();
}
/**
@@ -168,18 +156,15 @@ public class IUMap {
}
private IQueryResult<IInstallableUnit> internalGet(String id, Version version) {
- // TODO can probably optimize this
- InstallableUnitQuery query = null;
- if (version == null) {
- if (id == null) {
- query = InstallableUnitQuery.ANY;
- } else {
- query = new InstallableUnitQuery(id);
- }
- } else {
- query = new InstallableUnitQuery(id, version);
+ if (id == null) {
+ IQuery<IInstallableUnit> query = version == null ? QueryUtil.createIUAnyQuery() : QueryUtil.createIUQuery(null, version);
+ return query.perform(iterator());
}
- return query(query);
+
+ Collection<IInstallableUnit> idUnits = getUnits(id);
+ if (idUnits.isEmpty())
+ return Collector.emptyCollector();
+ return version == null ? new CollectionResult<IInstallableUnit>(idUnits) : QueryUtil.createIUQuery(id, version).perform(idUnits.iterator());
}
public IInstallableUnit get(String id, Version version) {
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TranslationSupport.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TranslationSupport.java
index aa1402497..cc0bbd0e3 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TranslationSupport.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TranslationSupport.java
@@ -12,6 +12,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.metadata;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.lang.ref.SoftReference;
import java.util.*;
import org.eclipse.core.runtime.IStatus;
@@ -20,7 +22,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.expression.*;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.osgi.service.localization.LocaleProvider;
@@ -221,7 +222,7 @@ public class TranslationSupport {
return cached;
}
- IQuery<IInstallableUnit> iuQuery = ExpressionQuery.<IInstallableUnit> create(IInstallableUnitFragment.class, capabilityMatch, NAMESPACE_IU_LOCALIZATION, localeVariants);
+ IQuery<IInstallableUnit> iuQuery = QueryUtil.<IInstallableUnit> createMatchQuery(IInstallableUnitFragment.class, capabilityMatch, NAMESPACE_IU_LOCALIZATION, localeVariants);
IQueryResult<IInstallableUnit> collected = fragmentSource.query(iuQuery, null);
localeCollectorCache.put(locale, new SoftReference<IQueryResult<IInstallableUnit>>(collected));
return collected;
@@ -246,7 +247,7 @@ public class TranslationSupport {
IQueryResult<IInstallableUnit> localizationFragments = getLocalizationFragments(locales, locale);
IExpressionFactory factory = ExpressionUtil.getFactory();
- IQuery<IInstallableUnit> iuQuery = ExpressionQuery.<IInstallableUnit> create(IInstallableUnitFragment.class, factory.matchExpression(haveHostMatch, theUnit));
+ IQuery<IInstallableUnit> iuQuery = QueryUtil.<IInstallableUnit> createMatchQuery(IInstallableUnitFragment.class, factory.matchExpression(haveHostMatch, theUnit));
IQueryResult<IInstallableUnit> collected = iuQuery.perform(localizationFragments.iterator());
if (!collected.isEmpty()) {
String translation = null;
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/IMatchQuery.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/IMatchQuery.java
index 205b06ced..f25b62d19 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/IMatchQuery.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/IMatchQuery.java
@@ -9,9 +9,10 @@
******************************************************************************/
package org.eclipse.equinox.internal.p2.metadata.query;
+import org.eclipse.equinox.p2.query.ExpressionMatchQuery;
+
import org.eclipse.equinox.p2.query.IQuery;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
/**
* A query in which the elements can be evaluated by calling isMatch on. Each
@@ -20,7 +21,7 @@ import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
* exclusive from all other calls. <P>
*
* @noimplement This interface is not intended to be implemented by clients. Clients
- * creating custom queries must extend {@link ExpressionQuery} instead.
+ * creating custom queries must extend {@link ExpressionMatchQuery} instead.
* @since 2.0
*/
public interface IMatchQuery<T> extends IQuery<T> {
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/IUPropertyQuery.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/IUPropertyQuery.java
deleted file mode 100644
index 3ef709fa2..000000000
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/IUPropertyQuery.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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
- * Cloudsmith Inc. - converted into expression based query
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.metadata.query;
-
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.expression.*;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
-
-/**
- * A query that searches for {@link IInstallableUnit} instances that have
- * a property whose value matches the provided value. If no property name is
- * specified, then all {@link IInstallableUnit} instances are accepted.
- */
-public final class IUPropertyQuery extends ExpressionQuery<IInstallableUnit> {
- public static final String ANY = "*"; //$NON-NLS-1$
-
- private static final IExpression matchTrueExpression = ExpressionUtil.parse("properties[$0] == true"); //$NON-NLS-1$
- private static final IExpression matchNullExpression = ExpressionUtil.parse("properties[$0] == null"); //$NON-NLS-1$
- private static final IExpression matchAnyExpression = ExpressionUtil.parse("properties[$0] != null"); //$NON-NLS-1$
- private static final IExpression matchValueExpression = ExpressionUtil.parse("properties[$0] == $1"); //$NON-NLS-1$
-
- public static IMatchExpression<IInstallableUnit> createMatchExpression(String propertyName, String propertyValue) {
- IExpressionFactory factory = ExpressionUtil.getFactory();
- if (propertyName == null)
- return ExpressionQuery.matchAll();
- if (propertyValue == null)
- return factory.<IInstallableUnit> matchExpression(matchNullExpression, propertyName);
- if (ANY.equals(propertyValue))
- return factory.<IInstallableUnit> matchExpression(matchAnyExpression, propertyName);
- if (Boolean.valueOf(propertyValue).booleanValue())
- return factory.<IInstallableUnit> matchExpression(matchTrueExpression, propertyName);
- return factory.<IInstallableUnit> matchExpression(matchValueExpression, propertyName, propertyValue);
- }
-
- /**
- * Creates a new query on the given property name and value.
- */
- public IUPropertyQuery(String propertyName, String propertyValue) {
- super(IInstallableUnit.class, createMatchExpression(propertyName, propertyValue));
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/LatestIUVersionQuery.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/LatestIUVersionQuery.java
deleted file mode 100644
index 2e9b4b0c2..000000000
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/LatestIUVersionQuery.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 EclipseSource 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:
-* EclipseSource - initial API and implementation
- * Cloudsmith Inc. - converted into expression based query
-******************************************************************************/
-package org.eclipse.equinox.internal.p2.metadata.query;
-
-import org.eclipse.equinox.internal.p2.metadata.expression.ContextExpression;
-import org.eclipse.equinox.internal.p2.metadata.expression.ExpressionFactory;
-import org.eclipse.equinox.p2.metadata.IVersionedId;
-import org.eclipse.equinox.p2.metadata.expression.*;
-import org.eclipse.equinox.p2.metadata.query.ExpressionContextQuery;
-import org.eclipse.equinox.p2.query.IQuery;
-
-/**
- * This query returns the latest version for each unique VersionedID.
- * All other elements are discarded.
- */
-public class LatestIUVersionQuery<T extends IVersionedId> extends ExpressionContextQuery<T> {
-
- private static <T> IContextExpression<T> createLatestExpression(IQuery<T> query) {
- ContextExpression<T> ctxExpr = (ContextExpression<T>) createExpression(query);
- IExpressionFactory factory = ExpressionUtil.getFactory();
- return factory.contextExpression(factory.latest(ctxExpr.operand), ctxExpr.getParameters());
- }
-
- private static IContextExpression<?> createLatestExpression() {
- IExpressionFactory factory = ExpressionUtil.getFactory();
- return factory.contextExpression(factory.latest(ExpressionFactory.EVERYTHING));
- }
-
- @SuppressWarnings("unchecked")
- public LatestIUVersionQuery() {
- super((Class<? extends T>) IVersionedId.class, createLatestExpression());
- }
-
- public LatestIUVersionQuery(IQuery<T> query) {
- super(getElementClass(query), createLatestExpression(query));
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/MatchQuery.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/MatchQuery.java
index d995bd6a7..8f1c31764 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/MatchQuery.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/MatchQuery.java
@@ -10,9 +10,10 @@
******************************************************************************/
package org.eclipse.equinox.internal.p2.metadata.query;
+import org.eclipse.equinox.p2.query.ExpressionMatchQuery;
+
import java.util.Iterator;
import org.eclipse.equinox.p2.metadata.expression.IExpression;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
import org.eclipse.equinox.p2.query.*;
/**
@@ -27,7 +28,7 @@ import org.eclipse.equinox.p2.query.*;
* computation, to allow {@link IQueryable} implementations to optimize their
* execution of the query.
* @since 2.0
- * @deprecated Clients should use {@link ExpressionQuery} instead.
+ * @deprecated Clients should use {@link ExpressionMatchQuery} instead.
*/
public abstract class MatchQuery<T> implements IMatchQuery<T> {
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/UpdateQuery.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/UpdateQuery.java
index 1f5f1d46a..9ff724815 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/UpdateQuery.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/query/UpdateQuery.java
@@ -11,16 +11,17 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.metadata.query;
+import org.eclipse.equinox.p2.query.ExpressionMatchQuery;
+
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IInstallableUnitPatch;
import org.eclipse.equinox.p2.metadata.expression.*;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
/**
* A query that finds all IUs that are considered an "Update" of the
* specified IU.
*/
-public final class UpdateQuery extends ExpressionQuery<IInstallableUnit> {
+public final class UpdateQuery extends ExpressionMatchQuery<IInstallableUnit> {
private static final IExpression expr1;
private static final IExpression expr2;
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/CategoryMemberQuery.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/CategoryMemberQuery.java
deleted file mode 100644
index b936fbee6..000000000
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/CategoryMemberQuery.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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
- * Cloudsmith Inc. - converted into expression based query
- *******************************************************************************/
-package org.eclipse.equinox.p2.metadata.query;
-
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.expression.*;
-
-/**
- * A query matching every {@link IInstallableUnit} that is a member
- * of the specified category.
- *
- * @since 2.0
- */
-public final class CategoryMemberQuery extends ExpressionQuery<IInstallableUnit> {
- private static final IExpression expression = ExpressionUtil.parse("$0.exists(r | this ~= r)"); //$NON-NLS-1$
-
- private static IMatchExpression<IInstallableUnit> createExpression(IInstallableUnit category) {
- IExpressionFactory factory = ExpressionUtil.getFactory();
- return CategoryQuery.isCategory(category) ? factory.<IInstallableUnit> matchExpression(expression, category.getRequiredCapabilities()) : ExpressionQuery.<IInstallableUnit> matchNothing();
- }
-
- /**
- * Creates a new query that will return the members of the
- * given category. If the specified {@link IInstallableUnit}
- * is not a category, then no installable unit will satisfy the query.
- *
- * @param category The category
- */
- public CategoryMemberQuery(IInstallableUnit category) {
- super(IInstallableUnit.class, createExpression(category));
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/CategoryQuery.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/CategoryQuery.java
deleted file mode 100644
index 65f6f5f1e..000000000
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/CategoryQuery.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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
- * Cloudsmith Inc. - converted into expression based query
- *******************************************************************************/
-package org.eclipse.equinox.p2.metadata.query;
-
-import org.eclipse.equinox.internal.p2.metadata.query.IUPropertyQuery;
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-
-/**
- * A query matching every {@link IInstallableUnit} that is a category.
- * @since 2.0
- */
-public final class CategoryQuery extends ExpressionQuery<IInstallableUnit> {
- private static final String PROP_TYPE_CATEGORY = "org.eclipse.equinox.p2.type.category"; //$NON-NLS-1$
-
- public CategoryQuery() {
- super(IInstallableUnit.class, IUPropertyQuery.createMatchExpression(PROP_TYPE_CATEGORY, Boolean.TRUE.toString()));
- }
-
- /**
- * Test if the {@link IInstallableUnit} is a category.
- * @param iu the element being tested.
- * @return <tt>true</tt> if the parameter is a category.
- */
- public static boolean isCategory(IInstallableUnit iu) {
- String value = iu.getProperty(PROP_TYPE_CATEGORY);
- if (value != null && (value.equals(Boolean.TRUE.toString())))
- return true;
- return false;
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/FragmentQuery.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/FragmentQuery.java
deleted file mode 100644
index d3c00e9fc..000000000
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/FragmentQuery.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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
- * Cloudsmith Inc. - converted into expression based query
- *******************************************************************************/
-package org.eclipse.equinox.p2.metadata.query;
-
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.IInstallableUnitFragment;
-
-/**
- * A query matching every {@link IInstallableUnit} that is a category.
- * @since 2.0
- */
-public final class FragmentQuery extends ExpressionQuery<IInstallableUnit> {
- public FragmentQuery() {
- super(IInstallableUnitFragment.class, matchAll());
- }
-
- /**
- * Test if the {@link IInstallableUnit} is a fragment.
- * @param iu the element being tested.
- * @return <tt>true</tt> if the parameter is a fragment.
- */
- public static boolean isFragment(IInstallableUnit iu) {
- return iu instanceof IInstallableUnitFragment;
- // String value = iu.getProperty(PROP_TYPE_FRAGMENT);
- // return value != null && (value.equals(Boolean.TRUE.toString()));
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/GroupQuery.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/GroupQuery.java
deleted file mode 100644
index d1035cf20..000000000
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/GroupQuery.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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
- * Cloudsmith Inc. - converted into expression based query
- *******************************************************************************/
-package org.eclipse.equinox.p2.metadata.query;
-
-import org.eclipse.equinox.internal.p2.metadata.query.IUPropertyQuery;
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-
-/**
- * A query matching every {@link IInstallableUnit} that is a group.
- * @since 2.0
- */
-public final class GroupQuery extends ExpressionQuery<IInstallableUnit> {
- private static final String PROP_TYPE_GROUP = "org.eclipse.equinox.p2.type.group"; //$NON-NLS-1$
-
- public GroupQuery() {
- super(IInstallableUnit.class, IUPropertyQuery.createMatchExpression(PROP_TYPE_GROUP, Boolean.TRUE.toString()));
- }
-
- /**
- * Test if the {@link IInstallableUnit} is a group.
- * @param iu the element being tested.
- * @return <tt>true</tt> if the parameter is a group.
- */
- public static boolean isGroup(IInstallableUnit iu) {
- String value = iu.getProperty(PROP_TYPE_GROUP);
- if (value != null && (value.equals(Boolean.TRUE.toString())))
- return true;
- return false;
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/InstallableUnitQuery.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/InstallableUnitQuery.java
deleted file mode 100644
index 137cc88bd..000000000
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/InstallableUnitQuery.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 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
- * Cloudsmith Inc. - converted into expression based query
- *******************************************************************************/
-package org.eclipse.equinox.p2.metadata.query;
-
-import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.expression.*;
-
-/**
- * A query that matches on the id and version of an {@link IInstallableUnit}.
- * @since 2.0
- */
-public final class InstallableUnitQuery extends ExpressionQuery<IInstallableUnit> {
- /**
- * A convenience query that will match any {@link IInstallableUnit}
- * it encounters.
- */
- public static final InstallableUnitQuery ANY = new InstallableUnitQuery((String) null);
-
- private static final IExpression matchID = ExpressionUtil.parse("id == $0"); //$NON-NLS-1$
- private static final IExpression matchIDAndVersion = ExpressionUtil.parse("id == $0 && version == $1"); //$NON-NLS-1$
- private static final IExpression matchIDAndRange = ExpressionUtil.parse("id == $0 && version ~= $1"); //$NON-NLS-1$
-
- private static IMatchExpression<IInstallableUnit> createMatchExpression(String id) {
- return id == null ? ExpressionQuery.<IInstallableUnit> matchAll() : ExpressionUtil.getFactory().<IInstallableUnit> matchExpression(matchID, id);
- }
-
- private static IMatchExpression<IInstallableUnit> createMatchExpression(String id, VersionRange range) {
- if (range == null || range.equals(VersionRange.emptyRange))
- return createMatchExpression(id);
- if (range.getMinimum().equals(range.getMaximum()))
- return createMatchExpression(id, range.getMinimum());
- return id == null ? ExpressionQuery.<IInstallableUnit> matchAll() : ExpressionUtil.getFactory().<IInstallableUnit> matchExpression(matchIDAndRange, id, range);
- }
-
- private static IMatchExpression<IInstallableUnit> createMatchExpression(String id, Version version) {
- return version == null || version.equals(Version.emptyVersion) ? createMatchExpression(id) : ExpressionUtil.getFactory().<IInstallableUnit> matchExpression(matchIDAndVersion, id, version);
- }
-
- /**
- * Creates a query that will match any {@link IInstallableUnit} with the given
- * id, regardless of version.
- *
- * @param id The installable unit id to match, or <code>null</code> to match any id
- */
- public InstallableUnitQuery(String id) {
- super(IInstallableUnit.class, createMatchExpression(id));
- }
-
- /**
- * Creates a query that will match any {@link IInstallableUnit} with the given
- * id, and whose version falls in the provided range.
- *
- * @param id The installable unit id to match, or <code>null</code> to match any id
- * @param range The version range to match
- */
- public InstallableUnitQuery(String id, VersionRange range) {
- super(IInstallableUnit.class, createMatchExpression(id, range));
- }
-
- /**
- * Creates a query that will match any {@link IInstallableUnit} with the given
- * id and version.
- *
- * @param id The installable unit id to match, or <code>null</code> to match any id
- * @param version The precise version that a matching unit must have
- */
- public InstallableUnitQuery(String id, Version version) {
- super(IInstallableUnit.class, createMatchExpression(id, version));
- }
-
- /**
- * Creates a query that will match any {@link IInstallableUnit} with the given
- * id and version.
- *
- * @param versionedId The precise id/version combination that a matching unit must have
- */
- public InstallableUnitQuery(IVersionedId versionedId) {
- this(versionedId.getId(), versionedId.getVersion());
- }
-
- /**
- * Returns the id that this query will match against.
- * @return The installable unit it
- */
- public String getId() {
- Object[] params = getExpression().getParameters();
- return params.length > 0 ? (String) params[0] : null;
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/PatchQuery.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/PatchQuery.java
deleted file mode 100644
index 3217a755d..000000000
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/PatchQuery.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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
- * Cloudsmith Inc. - converted into expression based query
- *******************************************************************************/
-package org.eclipse.equinox.p2.metadata.query;
-
-import org.eclipse.equinox.internal.p2.metadata.query.IUPropertyQuery;
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-
-/**
- * A query matching every {@link IInstallableUnit} that is a patch.
- * @since 2.0
- */
-public final class PatchQuery extends ExpressionQuery<IInstallableUnit> {
- private static final String PROP_TYPE_PATCH = "org.eclipse.equinox.p2.type.patch"; //$NON-NLS-1$
-
- public PatchQuery() {
- super(IInstallableUnit.class, IUPropertyQuery.createMatchExpression(PROP_TYPE_PATCH, Boolean.TRUE.toString()));
- }
-
- /**
- * Test if the {@link IInstallableUnit} is a patch.
- * @param iu the element being tested.
- * @return <tt>true</tt> if the parameter is a patch.
- */
- public static boolean isPatch(IInstallableUnit iu) {
- String value = iu.getProperty(PROP_TYPE_PATCH);
- if (value != null && (value.equals(Boolean.TRUE.toString())))
- return true;
- return false;
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQuery.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQuery.java
deleted file mode 100644
index f8bc1ecd0..000000000
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQuery.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 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
- * EclipseSource - ongoing development
- * Cloudsmith Inc. - added index capabilities
- *******************************************************************************/
-package org.eclipse.equinox.p2.query;
-
-import org.eclipse.equinox.internal.p2.metadata.query.IMatchQuery;
-
-import org.eclipse.equinox.internal.p2.metadata.expression.ExpressionFactory;
-import org.eclipse.equinox.internal.p2.metadata.expression.Expression.VariableFinder;
-import org.eclipse.equinox.p2.metadata.expression.*;
-import org.eclipse.equinox.p2.metadata.query.ExpressionContextQuery;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
-
-/**
- * A query that combines a group of sub-queries.<P>
- *
- * In a CompoundQuery each sub-query is executed over the entire input and the
- * results are combined using either logical AND or logical OR operations. <P>
- *
- * Clients are expected to call {@link CompoundQuery#createCompoundQuery(IQuery[], boolean)}
- * to create a concrete instance of a CompoundQuery. If all Queries are instances of
- * {@link IMatchQuery} then the resulting compound query will be an {@link IMatchQuery}, otherwise the
- * resulting query will be a context query}.
- *
- * @noextend This class is not intended to be subclassed by clients.
- * @since 2.0
- */
-public abstract class CompoundQuery<T> {
- /**
- * Creates a compound query that combines the given queries. The queries
- * will be performed by the compound query in the given order. This method
- * might not perform all queries if it can determine the result of the compound
- * expression without doing so.
- *
- * If all the queries are instances of {@link IMatchQuery} then the resulting
- * compound query will be an instance of IMatchQuery, otherwise the resulting
- * compound query will be a context query.
- *
- * @param queries The queries to perform
- * @param and <code>true</code> if this query represents a logical 'and', and
- * <code>false</code> if this query represents a logical 'or'.
- */
- @SuppressWarnings("unchecked")
- public static <E> IQuery<E> createCompoundQuery(IQuery<E>[] queries, boolean and) {
- IExpressionFactory factory = ExpressionUtil.getFactory();
- int idx = queries.length;
- if (idx == 1)
- return queries[0];
-
- Class<? extends E> elementClass = (Class<E>) Object.class;
- if (idx == 0)
- return ExpressionQuery.<E> create(elementClass, ExpressionQuery.matchAll());
-
- IExpression[] expressions = new IExpression[idx];
- boolean justBooleans = true;
- boolean justContexts = true;
- while (--idx >= 0) {
- IQuery<E> query = queries[idx];
- if (query instanceof IMatchQuery<?>)
- justContexts = false;
- else
- justBooleans = false;
-
- IExpression expr = query.getExpression();
- if (expr == null)
- expr = factory.toExpression(query);
-
- Class<? extends E> ec = ExpressionContextQuery.getElementClass(query);
- if (elementClass == null)
- elementClass = ec;
- else if (elementClass != ec) {
- if (elementClass.isAssignableFrom(ec)) {
- if (and)
- // Use most restrictive class
- elementClass = ec;
- } else if (ec.isAssignableFrom(elementClass)) {
- if (!and)
- // Use least restrictive class
- elementClass = ec;
- }
- }
- expressions[idx] = expr;
- }
-
- if (justBooleans) {
- IExpression compound = and ? factory.and(expressions) : factory.or(expressions);
- return ExpressionQuery.<E> create(elementClass, compound);
- }
-
- if (!justContexts) {
- // Mix of boolean queries and context queries. All must be converted into context then.
- for (idx = 0; idx < expressions.length; ++idx)
- expressions[idx] = makeContextExpression(factory, expressions[idx]);
- }
-
- IExpression compound = expressions[0];
- for (idx = 1; idx < expressions.length; ++idx)
- compound = and ? factory.intersect(compound, expressions[idx]) : factory.union(compound, expressions[idx]);
- return ExpressionContextQuery.<E> createQuery(elementClass, compound);
- }
-
- @SuppressWarnings("unchecked")
- public static <T> IQuery<T> createCompoundQuery(IQuery<T> query1, IQuery<T> query2, boolean and) {
- return createCompoundQuery(new IQuery[] {query1, query2}, and);
- }
-
- private static IExpression makeContextExpression(IExpressionFactory factory, IExpression expr) {
- VariableFinder finder = new VariableFinder(ExpressionFactory.EVERYTHING);
- expr.accept(finder);
- if (!finder.isFound())
- expr = factory.select(ExpressionFactory.EVERYTHING, factory.lambda(ExpressionFactory.THIS, expr));
- return expr;
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQueryable.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQueryable.java
index 0d51d8ad8..12c86ade5 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQueryable.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQueryable.java
@@ -44,7 +44,7 @@ public class CompoundQueryable<T> extends IndexProvider<T> {
private IQueryable<T>[] queryables;
- private CompoundQueryable(IQueryable<T>[] queryables) {
+ public CompoundQueryable(IQueryable<T>[] queryables) {
this.queryables = queryables;
}
@@ -54,7 +54,7 @@ public class CompoundQueryable<T> extends IndexProvider<T> {
* @param queryables The collection of queryables to be combined
*/
@SuppressWarnings("unchecked")
- public CompoundQueryable(Collection<? extends IQueryable<T>> queryables) {
+ CompoundQueryable(Collection<? extends IQueryable<T>> queryables) {
this(queryables.toArray(new IQueryable[queryables.size()]));
}
@@ -65,22 +65,10 @@ public class CompoundQueryable<T> extends IndexProvider<T> {
* @param query2 The second queryable
*/
@SuppressWarnings("unchecked")
- public CompoundQueryable(IQueryable<T> query1, IQueryable<T> query2) {
+ CompoundQueryable(IQueryable<T> query1, IQueryable<T> query2) {
this(new IQueryable[] {query1, query2});
}
- /**
- * Creates a queryable that combines the three provided input queryables
- *
- * @param query1 The first queryable
- * @param query2 The second queryable
- * @param query3 The third queryable
- */
- @SuppressWarnings("unchecked")
- public CompoundQueryable(IQueryable<T> query1, IQueryable<T> query2, IQueryable<T> query3) {
- this(new IQueryable[] {query1, query2, query3});
- }
-
public IIndex<T> getIndex(String memberName) {
// Check that at least one of the queryable can present an index
// for the given member.
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/ExpressionQuery.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/ExpressionMatchQuery.java
index 3f4a56a9a..58cd913e8 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/ExpressionQuery.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/ExpressionMatchQuery.java
@@ -8,7 +8,7 @@
* Contributors:
* Cloudsmith Inc. - initial API and implementation
*******************************************************************************/
-package org.eclipse.equinox.p2.metadata.query;
+package org.eclipse.equinox.p2.query;
import java.util.HashSet;
import java.util.Iterator;
@@ -16,51 +16,25 @@ import org.eclipse.equinox.internal.p2.metadata.expression.Expression;
import org.eclipse.equinox.internal.p2.metadata.expression.ExpressionFactory;
import org.eclipse.equinox.internal.p2.metadata.query.IMatchQuery;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.expression.*;
import org.eclipse.equinox.p2.metadata.index.*;
-import org.eclipse.equinox.p2.query.*;
/**
* A query that matches candidates against an expression.
* @since 2.0
*/
-public class ExpressionQuery<T> implements IMatchQuery<T>, IQueryWithIndex<T> {
+public class ExpressionMatchQuery<T> implements IMatchQuery<T>, IQueryWithIndex<T> {
private final IMatchExpression<T> expression;
private final Class<? extends T> matchingClass;
private IEvaluationContext context;
- public static <T> IMatchExpression<T> matchAll() {
- return ExpressionUtil.getFactory().matchExpression(ExpressionUtil.TRUE_EXPRESSION);
- }
-
- public static <T> IMatchExpression<T> matchNothing() {
- return ExpressionUtil.getFactory().matchExpression(ExpressionUtil.FALSE_EXPRESSION);
- }
-
- public static <Q> IQuery<Q> create(Class<? extends Q> elementClass, IExpression expression, Object... parameters) {
- return new ExpressionQuery<Q>(elementClass, expression, parameters);
- }
-
- public static <Q> IQuery<Q> create(Class<? extends Q> matchingClass, String expression, Object... parameters) {
- return new ExpressionQuery<Q>(matchingClass, expression, parameters);
- }
-
- public static IQuery<IInstallableUnit> create(IExpression expression, Object... parameters) {
- return new ExpressionQuery<IInstallableUnit>(IInstallableUnit.class, expression, parameters);
- }
-
- public static IQuery<IInstallableUnit> create(String expression, Object... parameters) {
- return new ExpressionQuery<IInstallableUnit>(IInstallableUnit.class, expression, parameters);
- }
-
- protected ExpressionQuery(Class<? extends T> matchingClass, IExpression expression, Object... parameters) {
+ public ExpressionMatchQuery(Class<? extends T> matchingClass, IExpression expression, Object... parameters) {
this.matchingClass = matchingClass;
this.expression = ExpressionUtil.getFactory().<T> matchExpression(expression, parameters);
this.context = this.expression.createContext();
}
- protected ExpressionQuery(Class<? extends T> matchingClass, String expression, Object... parameters) {
+ public ExpressionMatchQuery(Class<? extends T> matchingClass, String expression, Object... parameters) {
this(matchingClass, ExpressionUtil.parse(expression), parameters);
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/ExpressionContextQuery.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/ExpressionQuery.java
index 413200e78..483116faf 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/ExpressionContextQuery.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/ExpressionQuery.java
@@ -8,48 +8,30 @@
* Contributors:
* Cloudsmith Inc. - initial API and implementation
*******************************************************************************/
-package org.eclipse.equinox.p2.metadata.query;
+package org.eclipse.equinox.p2.query;
+
import java.util.Iterator;
import org.eclipse.equinox.internal.p2.metadata.expression.*;
import org.eclipse.equinox.internal.p2.metadata.query.IMatchQuery;
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.expression.*;
import org.eclipse.equinox.p2.metadata.index.IIndexProvider;
import org.eclipse.equinox.p2.metadata.index.IQueryWithIndex;
-import org.eclipse.equinox.p2.query.IQuery;
-import org.eclipse.equinox.p2.query.IQueryResult;
/**
* A query that evaluates using an iterator as input and produces a new iterator.
* @since 2.0
*/
-public class ExpressionContextQuery<T> implements IQueryWithIndex<T> {
+public class ExpressionQuery<T> implements IQueryWithIndex<T> {
private final IContextExpression<T> expression;
private final Class<? extends T> elementClass;
- public static <Q> IQuery<Q> createQuery(Class<? extends Q> elementClass, IExpression expression, Object... parameters) {
- return new ExpressionContextQuery<Q>(elementClass, expression, parameters);
- }
-
- public static <Q> IQuery<Q> createQuery(Class<? extends Q> matchingClass, String expression, Object... parameters) {
- return new ExpressionContextQuery<Q>(matchingClass, expression, parameters);
- }
-
- public static IQuery<IInstallableUnit> createQuery(IExpression expression, Object... parameters) {
- return new ExpressionContextQuery<IInstallableUnit>(IInstallableUnit.class, expression, parameters);
- }
-
- public static IQuery<IInstallableUnit> createQuery(String expression, Object... parameters) {
- return new ExpressionContextQuery<IInstallableUnit>(IInstallableUnit.class, expression, parameters);
- }
-
- protected ExpressionContextQuery(Class<? extends T> elementClass, IExpression expression, Object... parameters) {
+ public ExpressionQuery(Class<? extends T> elementClass, IExpression expression, Object... parameters) {
this.elementClass = elementClass;
this.expression = ExpressionUtil.getFactory().<T> contextExpression(expression, parameters);
}
- protected ExpressionContextQuery(Class<? extends T> matchingClass, String expression, Object... parameters) {
+ public ExpressionQuery(Class<? extends T> matchingClass, String expression, Object... parameters) {
this(matchingClass, ExpressionUtil.parseQuery(expression), parameters);
}
@@ -72,14 +54,14 @@ public class ExpressionContextQuery<T> implements IQueryWithIndex<T> {
public static <T> Class<? extends T> getElementClass(IQuery<T> query) {
@SuppressWarnings("unchecked")
Class<? extends T> elementClass = (Class<T>) Object.class;
- if (query instanceof ExpressionQuery<?>)
- elementClass = ((ExpressionQuery<T>) query).getMatchingClass();
- else if (query instanceof ExpressionContextQuery<?>)
- elementClass = ((ExpressionContextQuery<T>) query).getElementClass();
+ if (query instanceof ExpressionMatchQuery<?>)
+ elementClass = ((ExpressionMatchQuery<T>) query).getMatchingClass();
+ else if (query instanceof ExpressionQuery<?>)
+ elementClass = ((ExpressionQuery<T>) query).getElementClass();
return elementClass;
}
- protected static <T> IContextExpression<T> createExpression(IQuery<T> query) {
+ public static <T> IContextExpression<T> createExpression(IQuery<T> query) {
IExpressionFactory factory = ExpressionUtil.getFactory();
IExpression expr = query.getExpression();
Object[] parameters;
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/LimitQuery.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/LimitQuery.java
deleted file mode 100644
index 21e429841..000000000
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/LimitQuery.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 EclipseSource 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:
-* EclipseSource - initial API and implementation
-* Cloudsmith Inc. - converted into expression based query
-******************************************************************************/
-package org.eclipse.equinox.p2.query;
-
-import org.eclipse.equinox.internal.p2.metadata.expression.ContextExpression;
-import org.eclipse.equinox.p2.metadata.expression.*;
-import org.eclipse.equinox.p2.metadata.query.ExpressionContextQuery;
-
-/**
- * A limit query can be used to limit the number of query results returned. Once
- * the limit is reached, the query is terminated.
- * @since 2.0
- */
-public class LimitQuery<T> extends ExpressionContextQuery<T> {
-
- private static <T> IContextExpression<T> createLimitExpression(IQuery<T> query, int limit) {
- ContextExpression<T> ctxExpr = (ContextExpression<T>) createExpression(query);
- IExpressionFactory factory = ExpressionUtil.getFactory();
- return factory.contextExpression(factory.limit(ctxExpr.operand, limit), ctxExpr.getParameters());
- }
-
- public LimitQuery(IQuery<T> query, int limit) {
- super(getElementClass(query), createLimitExpression(query, limit));
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/PipedQuery.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/PipedQuery.java
deleted file mode 100644
index bc0b9f213..000000000
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/PipedQuery.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2010 EclipseSource 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:
-* EclipseSource - initial API and implementation
-* IBM Corporation - ongoing development
-******************************************************************************/
-package org.eclipse.equinox.p2.query;
-
-import org.eclipse.equinox.internal.p2.metadata.expression.ExpressionFactory;
-import org.eclipse.equinox.internal.p2.metadata.expression.Expression.VariableFinder;
-import org.eclipse.equinox.p2.metadata.expression.*;
-import org.eclipse.equinox.p2.metadata.query.ExpressionContextQuery;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
-
-/**
- * A PipedQuery is a composite query in which each sub-query is executed in succession.
- * The results from the ith sub-query are piped as input into the i+1th sub-query. The
- * query will short-circuit if any query returns an empty result set.
- * @since 2.0
- */
-public abstract class PipedQuery<T> {
- /**
- * Creates a piped query based on the two provided input queries. The full
- * query input will be passed into the first query in the provided array. The
- * second query will obtain as input the result of the first query.
- *
- * @param query1 the first query
- * @param query2 the second query
- */
- @SuppressWarnings("unchecked")
- public static <E> IQuery<E> createPipe(IQuery<? extends E> query1, IQuery<? extends E> query2) {
- return createPipe(new IQuery[] {query1, query2});
- }
-
- /**
- * Creates a piped query based on the provided input queries. The full
- * query input will be passed into the first query in the provided array. Subsequent
- * queries will obtain as input the result of execution of the previous query.
- *
- * @param queries the ordered list of queries to perform
- */
- @SuppressWarnings("unchecked")
- public static <E> IQuery<E> createPipe(IQuery<E>[] queries) {
- IExpressionFactory factory = ExpressionUtil.getFactory();
- int idx = queries.length;
- IExpression[] expressions = new IExpression[idx];
- while (--idx >= 0) {
- IQuery<E> query = queries[idx];
- IExpression expr = query.getExpression();
- if (expr == null)
- expr = factory.toExpression(query);
- expressions[idx] = expr;
- }
- IExpression pipe = factory.pipe(expressions);
- VariableFinder finder = new VariableFinder(ExpressionFactory.EVERYTHING);
- pipe.accept(finder);
- return finder.isFound() ? ExpressionContextQuery.<E> createQuery((Class<E>) Object.class, pipe) : ExpressionQuery.<E> create((Class<E>) Object.class, pipe);
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/QueryUtil.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/QueryUtil.java
new file mode 100644
index 000000000..15b79d65a
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/QueryUtil.java
@@ -0,0 +1,520 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Cloudsmith Inc. 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:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.query;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import org.eclipse.equinox.internal.p2.metadata.InstallableUnit;
+import org.eclipse.equinox.internal.p2.metadata.expression.ContextExpression;
+import org.eclipse.equinox.internal.p2.metadata.expression.ExpressionFactory;
+import org.eclipse.equinox.internal.p2.metadata.expression.Expression.VariableFinder;
+import org.eclipse.equinox.internal.p2.metadata.query.IMatchQuery;
+import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.metadata.expression.*;
+
+/**
+ * Helper class for query related tasks.
+ * @since 2.0
+ */
+public class QueryUtil {
+
+ public static final IQuery<IInstallableUnit> ALL_UNITS = QueryUtil.createMatchQuery(ExpressionUtil.TRUE_EXPRESSION);
+
+ public static final String ANY = "*"; //$NON-NLS-1$
+
+ public static final IQuery<IInstallableUnit> NO_UNITS = QueryUtil.createQuery("limit(0)"); //$NON-NLS-1$
+
+ public static final String PROP_TYPE_CATEGORY = "org.eclipse.equinox.p2.type.category"; //$NON-NLS-1$
+
+ public static final String PROP_TYPE_GROUP = "org.eclipse.equinox.p2.type.group"; //$NON-NLS-1$
+
+ public static final String PROP_TYPE_PATCH = "org.eclipse.equinox.p2.type.patch"; //$NON-NLS-1$
+
+ private static final IExpression matchesRequirementsExpression = ExpressionUtil.parse("$0.exists(r | this ~= r)"); //$NON-NLS-1$
+
+ private static final IExpression matchIU_ID = ExpressionUtil.parse("id == $0"); //$NON-NLS-1$
+ private static final IExpression matchIU_IDAndRange = ExpressionUtil.parse("id == $0 && version ~= $1"); //$NON-NLS-1$
+ private static final IExpression matchIU_IDAndVersion = ExpressionUtil.parse("id == $0 && version == $1"); //$NON-NLS-1$
+ private static final IExpression matchIU_Range = ExpressionUtil.parse("version ~= $0"); //$NON-NLS-1$
+ private static final IExpression matchIU_Version = ExpressionUtil.parse("version == $0"); //$NON-NLS-1$
+ private static final IExpression matchIU_propAny = ExpressionUtil.parse("properties[$0] != null"); //$NON-NLS-1$
+ private static final IExpression matchIU_propNull = ExpressionUtil.parse("properties[$0] == null"); //$NON-NLS-1$
+ private static final IExpression matchIU_propTrue = ExpressionUtil.parse("properties[$0] == true"); //$NON-NLS-1$
+ private static final IExpression matchIU_propValue = ExpressionUtil.parse("properties[$0] == $1"); //$NON-NLS-1$
+
+ /**
+ * Creates a queryable that combines the given collection of input queryables
+ *
+ * @param queryables The collection of queryables to be combined
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> IQueryable<T> compoundQueryable(Collection<? extends IQueryable<T>> queryables) {
+ return new CompoundQueryable<T>(queryables.toArray(new IQueryable[queryables.size()]));
+ }
+
+ /**
+ * Creates a queryable that combines the two provided input queryables
+ *
+ * @param query1 The first queryable
+ * @param query2 The second queryable
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> IQueryable<T> compoundQueryable(IQueryable<T> query1, IQueryable<T> query2) {
+ return new CompoundQueryable<T>(new IQueryable[] {query1, query2});
+ }
+
+ /**
+ * Creates a compound query that combines the given queries. If all queries
+ * are candidate match queries, then the queries will be concatenated as a
+ * boolean 'and' or a boolean 'or' expression depending on the <code>and</code>
+ * flag. If at least one query is a full query, all queries will instead be evaluated
+ * using intersection when <code>and</code> is <code>true</code> or a union.
+ *
+ * @param queries The queries to perform
+ * @param and <code>true</code> if this query represents an intersection or a
+ * logical 'and', and <code>false</code> if this query represents a union or
+ * a logical 'or'.
+ * @return A compound query
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> IQuery<T> createCompoundQuery(Collection<? extends IQuery<? extends T>> queries, boolean and) {
+ IExpressionFactory factory = ExpressionUtil.getFactory();
+ int top = queries.size();
+ if (top == 1)
+ return (IQuery<T>) queries.iterator().next();
+
+ Class<? extends T> elementClass = (Class<T>) Object.class;
+ if (top == 0)
+ return QueryUtil.<T> createMatchQuery(elementClass, ExpressionUtil.TRUE_EXPRESSION);
+
+ IExpression[] expressions = new IExpression[top];
+ boolean justBooleans = true;
+ boolean justContexts = true;
+ int idx = 0;
+ for (IQuery<? extends T> query : queries) {
+ if (query instanceof IMatchQuery<?>)
+ justContexts = false;
+ else
+ justBooleans = false;
+
+ IExpression expr = query.getExpression();
+ if (expr == null)
+ expr = factory.toExpression(query);
+
+ Class<? extends T> ec = ExpressionQuery.getElementClass(query);
+ if (elementClass == null)
+ elementClass = ec;
+ else if (elementClass != ec) {
+ if (elementClass.isAssignableFrom(ec)) {
+ if (and)
+ // Use most restrictive class
+ elementClass = ec;
+ } else if (ec.isAssignableFrom(elementClass)) {
+ if (!and)
+ // Use least restrictive class
+ elementClass = ec;
+ }
+ }
+ expressions[idx++] = expr;
+ }
+
+ if (justBooleans) {
+ IExpression compound = and ? factory.and(expressions) : factory.or(expressions);
+ return QueryUtil.<T> createMatchQuery(elementClass, compound);
+ }
+
+ if (!justContexts) {
+ // Mix of boolean queries and context queries. All must be converted into context then.
+ for (idx = 0; idx < expressions.length; ++idx)
+ expressions[idx] = makeContextExpression(factory, expressions[idx]);
+ }
+
+ IExpression compound = expressions[0];
+ for (idx = 1; idx < expressions.length; ++idx)
+ compound = and ? factory.intersect(compound, expressions[idx]) : factory.union(compound, expressions[idx]);
+ return QueryUtil.<T> createQuery(elementClass, compound);
+ }
+
+ /**
+ * Creates a compound query that combines the two queries. If both queries
+ * are candidate match queries, then the queries will be concatenated as a
+ * boolean 'and' or a boolean 'or' expression depending on the <code>and</code>
+ * flag. If at least one query is a full query, all queries will instead be evaluated
+ * using intersection when <code>and</code> is <code>true</code> or a union.
+ *
+ * @param query1 the first query
+ * @param query2 the second query
+ * @param and <code>true</code> if this query represents an intersection or a
+ * logical 'and', and <code>false</code> if this query represents a union or
+ * a logical 'or'.
+ * @return A compound query
+ */
+ public static <T> IQuery<T> createCompoundQuery(IQuery<? extends T> query1, IQuery<T> query2, boolean and) {
+ ArrayList<IQuery<? extends T>> queries = new ArrayList<IQuery<? extends T>>(2);
+ queries.add(query1);
+ queries.add(query2);
+ return createCompoundQuery(queries, and);
+ }
+
+ /**
+ * Returns a query that matches all {@link InstallableUnit} elements
+ */
+ public static IQuery<IInstallableUnit> createIUAnyQuery() {
+ return ALL_UNITS;
+ }
+
+ /**
+ * Creates a new query that will return the members of the
+ * given <code>category</code>. If the specified {@link IInstallableUnit}
+ * is not a category, then no installable unit will satisfy the query.
+ *
+ * @param category The category
+ * @return A query that returns category members
+ */
+ public static IQuery<IInstallableUnit> createIUCategoryMemberQuery(IInstallableUnit category) {
+ if (QueryUtil.isCategory(category))
+ return QueryUtil.createMatchQuery(matchesRequirementsExpression, category.getRequiredCapabilities());
+ return NO_UNITS;
+ }
+
+ /**
+ * Creates a query matching every {@link IInstallableUnit} that is a category.
+ * @return The query that matches categories
+ * @since 2.0
+ */
+ public static IQuery<IInstallableUnit> createIUCategoryQuery() {
+ return createIUPropertyQuery(QueryUtil.PROP_TYPE_CATEGORY, Boolean.TRUE.toString());
+ }
+
+ /**
+ * Creates a query matching every {@link IInstallableUnit} that is a group.
+ * @return a query that matches all groups
+ */
+ public static IQuery<IInstallableUnit> createIUGroupQuery() {
+ return createIUPropertyQuery(PROP_TYPE_GROUP, Boolean.TRUE.toString());
+ }
+
+ /**
+ * Creates an {@link IInstallableUnit} that will match all patches.
+ * @return The created query
+ */
+ public static IQuery<IInstallableUnit> createIUPatchQuery() {
+ return createIUPropertyQuery(QueryUtil.PROP_TYPE_PATCH, Boolean.TRUE.toString());
+ }
+
+ /**
+ * Creates a query that searches for {@link IInstallableUnit} instances that have
+ * a property whose value matches the provided value. If no property name is
+ * specified, then all {@link IInstallableUnit} instances are accepted.
+ * @param propertyName The key of the property to match or <code>null</code> to match all
+ * @param propertyValue The value of the property. Can be {@link #ANY} to match all values
+ * except <code>null</code>
+ * @return The query matching properties
+ */
+ public static IQuery<IInstallableUnit> createIUPropertyQuery(String propertyName, String propertyValue) {
+ if (propertyName == null)
+ return QueryUtil.createMatchQuery(ExpressionUtil.TRUE_EXPRESSION);
+ if (propertyValue == null)
+ return QueryUtil.createMatchQuery(matchIU_propNull, propertyName);
+ if (ANY.equals(propertyValue))
+ return QueryUtil.createMatchQuery(matchIU_propAny, propertyName);
+ if (Boolean.valueOf(propertyValue).booleanValue())
+ return QueryUtil.createMatchQuery(matchIU_propTrue, propertyName);
+ return QueryUtil.createMatchQuery(matchIU_propValue, propertyName, propertyValue);
+ }
+
+ /**
+ * Creates a query that will match any {@link IInstallableUnit} with the given
+ * id and version.
+ *
+ * @param versionedId The precise id/version combination that a matching unit must have
+ * @return a query that matches IU's by id and version
+ */
+ public static IQuery<IInstallableUnit> createIUQuery(IVersionedId versionedId) {
+ return createIUQuery(versionedId.getId(), versionedId.getVersion());
+ }
+
+ /**
+ * Creates a query that will match any {@link IInstallableUnit} with the given
+ * id, regardless of version.
+ *
+ * @param id The installable unit id to match, or <code>null</code> to match any id
+ * @return a query that matches IU's by id
+ */
+ public static IQuery<IInstallableUnit> createIUQuery(String id) {
+ return id == null ? ALL_UNITS : QueryUtil.createMatchQuery(matchIU_ID, id);
+ }
+
+ /**
+ * Creates a query that will match any {@link IInstallableUnit} with the given
+ * id and version.
+ *
+ * @param id The installable unit id to match, or <code>null</code> to match any id
+ * @param version The precise version that a matching unit must have or <code>null</code>
+ * to match any version
+ * @return a query that matches IU's by id and version
+ */
+ public static IQuery<IInstallableUnit> createIUQuery(String id, Version version) {
+ if (version == null || version.equals(Version.emptyVersion))
+ return createIUQuery(id);
+ if (id == null)
+ return QueryUtil.createMatchQuery(matchIU_Version, version);
+ return QueryUtil.createMatchQuery(matchIU_IDAndVersion, id, version);
+ }
+
+ /**
+ * Creates a query that will match any {@link IInstallableUnit} with the given
+ * id, and whose version falls in the provided range.
+ *
+ * @param id The installable unit id to match, or <code>null</code> to match any id
+ * @param range The version range to match or <code>null</code> to match any range.
+ * @return a query that matches IU's by id and range
+ */
+ public static IQuery<IInstallableUnit> createIUQuery(String id, VersionRange range) {
+ if (range == null || range.equals(VersionRange.emptyRange))
+ return createIUQuery(id);
+ if (id == null)
+ return QueryUtil.createMatchQuery(matchIU_Range, range);
+ return QueryUtil.createMatchQuery(matchIU_IDAndRange, id, range);
+ }
+
+ /**
+ * Creates a query that returns the latest version for each unique id of an {@link IVersionedId}.
+ * All other elements are discarded.
+ * @return A query matching the latest version for each id.
+ */
+ public static IQuery<IInstallableUnit> createLatestIUQuery() {
+ return QueryUtil.createQuery(ExpressionUtil.getFactory().latest(ExpressionFactory.EVERYTHING));
+ }
+
+ /**
+ * Creates a query that returns the latest version for each unique id of an {@link IVersionedId}
+ * from the collection produced by <code>query</code>.
+ * All other elements are discarded.
+ * @param query The query that precedes the latest query when evaluating.
+ * @return A query matching the latest version for each id.
+ */
+ public static <T extends IVersionedId> IQuery<T> createLatestQuery(IQuery<T> query) {
+ IContextExpression<T> ctxExpr = ExpressionQuery.createExpression(query);
+ IExpressionFactory factory = ExpressionUtil.getFactory();
+ @SuppressWarnings("unchecked")
+ Class<T> elementClass = (Class<T>) IVersionedId.class;
+ return QueryUtil.createQuery(elementClass, factory.latest(((ContextExpression<?>) ctxExpr).operand), ctxExpr.getParameters());
+ }
+
+ /**
+ * Creates a limit query that can be used to limit the number of query results returned. Once
+ * the limit is reached, the query is terminated.
+ * @param query The query that should be limited
+ * @param limit A positive integer denoting the limit
+ * @return A limited query
+ * @since 2.0
+ */
+ public static <T> IQuery<T> createLimitQuery(IQuery<T> query, int limit) {
+ IContextExpression<T> ctxExpr = ExpressionQuery.createExpression(query);
+ IExpressionFactory factory = ExpressionUtil.getFactory();
+ return QueryUtil.createQuery(ExpressionQuery.getElementClass(query), factory.limit(((ContextExpression<T>) ctxExpr).operand, limit), ctxExpr.getParameters());
+ }
+
+ /**
+ * Creates an {@link IInstallableUnit} query that will iterate over all candidates and discriminate by
+ * applying the boolean <code>matchExpression</code> on each candidate.
+ * @param matchExpression The boolean expression used for filtering one candidate
+ * @param parameters Values for parameter substitution
+ * @return The created query
+ */
+ public static IQuery<IInstallableUnit> createMatchQuery(IExpression matchExpression, Object... parameters) {
+ return new ExpressionMatchQuery<IInstallableUnit>(IInstallableUnit.class, matchExpression, parameters);
+ }
+
+ /**
+ * Parses the <code>matchExpression</code> and creates an {@link IInstallableUnit} query that will
+ * iterate over all candidates and discriminate by applying the boolean <code>matchExpression</code>
+ * on each candidate.
+ * @param matchExpression The boolean expression used for filtering one candidate
+ * @param parameters Values for parameter substitution
+ * @return The created query
+ */
+ public static IQuery<IInstallableUnit> createMatchQuery(String matchExpression, Object... parameters) {
+ return new ExpressionMatchQuery<IInstallableUnit>(IInstallableUnit.class, matchExpression, parameters);
+ }
+
+ /**
+ * Creates an query that will iterate over all candidates and discriminate all
+ * candidates that are not instances of <code>matchinClass></code> or for which
+ * the boolean <code>matchExpression</code> returns false.
+ * @param matchingClass The class that matching candidates must be an instance of
+ * @param matchExpression The boolean expression used for filtering one candidate
+ * @param parameters Values for parameter substitution
+ * @return The created query
+ */
+ public static <T> IQuery<T> createMatchQuery(Class<? extends T> matchingClass, IExpression matchExpression, Object... parameters) {
+ return new ExpressionMatchQuery<T>(matchingClass, matchExpression, parameters);
+ }
+
+ /**
+ * Parses the <code>matchExpression</code> and creates an query that will iterate over
+ * all candidates and discriminate all candidates that are not instances of
+ * <code>matchinClass></code> or for which the boolean <code>matchExpression</code>
+ * returns false.
+ * @param matchingClass The class that matching candidates must be an instance of
+ * @param matchExpression The boolean expression used for filtering one candidate
+ * @param parameters Values for parameter substitution
+ * @return The created query
+ */
+ public static <T> IQuery<T> createMatchQuery(Class<? extends T> matchingClass, String matchExpression, Object... parameters) {
+ return new ExpressionMatchQuery<T>(matchingClass, matchExpression, parameters);
+ }
+
+ /**
+ * <p>Creates a piped query based on the provided input queries.</p>
+ * <p>A pipe is a composite query in which each sub-query is executed in succession.
+ * The results from the ith sub-query are piped as input into the i+1th sub-query. The
+ * query will short-circuit if any query returns an empty result set.</p>
+ *
+ * @param queries the ordered list of queries to perform
+ * @return A query pipe
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> IQuery<T> createPipeQuery(Collection<? extends IQuery<? extends T>> queries) {
+ IExpressionFactory factory = ExpressionUtil.getFactory();
+ int top = queries.size();
+ IExpression[] expressions = new IExpression[top];
+ int idx = 0;
+ for (IQuery<? extends T> query : queries) {
+ IExpression expr = query.getExpression();
+ if (expr == null)
+ expr = factory.toExpression(query);
+ expressions[idx++] = expr;
+ }
+ IExpression pipe = factory.pipe(expressions);
+ VariableFinder finder = new VariableFinder(ExpressionFactory.EVERYTHING);
+ pipe.accept(finder);
+ return finder.isFound() ? QueryUtil.<T> createQuery((Class<T>) Object.class, pipe) : QueryUtil.<T> createMatchQuery((Class<T>) Object.class, pipe);
+ }
+
+ /**
+ * <p>Creates a piped query based on the provided input queries.</p>
+ * <p>A pipe is a composite query in which each sub-query is executed in succession.
+ * The results from the ith sub-query are piped as input into the i+1th sub-query. The
+ * query will short-circuit if any query returns an empty result set.</p>
+ *
+ * @param query1 the first query
+ * @param query2 the second query
+ * @return A query pipe
+ */
+ public static <T> IQuery<T> createPipeQuery(IQuery<? extends T> query1, IQuery<? extends T> query2) {
+ ArrayList<IQuery<? extends T>> queries = new ArrayList<IQuery<? extends T>>(2);
+ queries.add(query1);
+ queries.add(query2);
+ return createPipeQuery(queries);
+ }
+
+ /**
+ * Creates an {@link IInstallableUnit} query based on an <code>expression</code> that
+ * uses all candidates as input.
+ * @param expression The query expression
+ * @param parameters Values for parameter substitution
+ * @return The created query
+ */
+ public static IQuery<IInstallableUnit> createQuery(IExpression expression, Object... parameters) {
+ return new ExpressionQuery<IInstallableUnit>(IInstallableUnit.class, expression, parameters);
+ }
+
+ /**
+ * Parses the <code>expression</code> and creates an {@link IInstallableUnit} query. The
+ * <code>expression</code> is expected to use all candidates as input.
+ * @param expression The query expression
+ * @param parameters Values for parameter substitution
+ * @return The created query
+ */
+ public static IQuery<IInstallableUnit> createQuery(String expression, Object... parameters) {
+ return new ExpressionQuery<IInstallableUnit>(IInstallableUnit.class, expression, parameters);
+ }
+
+ /**
+ * Creates a query that will limit the result to instances of the <code>matchinClass</code>. The
+ * <code>expression</code> is expected to use all candidates as input.
+ * @param matchingClass The class used as discriminator for the result
+ * @param expression The query expression
+ * @param parameters Values for parameter substitution
+ * @return The created query
+ */
+ public static <T> IQuery<T> createQuery(Class<? extends T> matchingClass, IExpression expression, Object... parameters) {
+ return new ExpressionQuery<T>(matchingClass, expression, parameters);
+ }
+
+ /**
+ * Parses the <code>expression</code> and creates a query that will limit the result
+ * to instances of the <code>matchinClass</code>. The <code>expression</code> is expected
+ * to use all candidates as input.
+ * @param matchingClass The class used as discriminator for the result
+ * @param expression The query expression
+ * @param parameters Values for parameter substitution
+ * @return The created query
+ */
+ public static <T> IQuery<T> createQuery(Class<? extends T> matchingClass, String expression, Object... parameters) {
+ return new ExpressionQuery<T>(matchingClass, expression, parameters);
+ }
+
+ /**
+ * Test if the {@link IInstallableUnit} is a category.
+ * @param iu the element being tested.
+ * @return <tt>true</tt> if the parameter is a category.
+ */
+ public static boolean isCategory(IInstallableUnit iu) {
+ String value = iu.getProperty(PROP_TYPE_CATEGORY);
+ if (value != null && (value.equals(Boolean.TRUE.toString())))
+ return true;
+ return false;
+ }
+
+ /**
+ * Test if the {@link IInstallableUnit} is a fragment.
+ * @param iu the element being tested.
+ * @return <tt>true</tt> if the parameter is a fragment.
+ */
+ public static boolean isFragment(IInstallableUnit iu) {
+ return iu instanceof IInstallableUnitFragment;
+ }
+
+ /**
+ * Test if the {@link IInstallableUnit} is a group.
+ * @param iu the element being tested.
+ * @return <tt>true</tt> if the parameter is a group.
+ */
+ public static boolean isGroup(IInstallableUnit iu) {
+ String value = iu.getProperty(PROP_TYPE_GROUP);
+ if (value != null && (value.equals(Boolean.TRUE.toString())))
+ return true;
+ return false;
+ }
+
+ /**
+ * Test if the {@link IInstallableUnit} is a patch.
+ * @param iu the element being tested.
+ * @return <tt>true</tt> if the parameter is a patch.
+ */
+ public static boolean isPatch(IInstallableUnit iu) {
+ String value = iu.getProperty(PROP_TYPE_PATCH);
+ if (value != null && (value.equals(Boolean.TRUE.toString())))
+ return true;
+ return false;
+ }
+
+ private static IExpression makeContextExpression(IExpressionFactory factory, IExpression expr) {
+ VariableFinder finder = new VariableFinder(ExpressionFactory.EVERYTHING);
+ expr.accept(finder);
+ if (!finder.isFound())
+ expr = factory.select(ExpressionFactory.EVERYTHING, factory.lambda(ExpressionFactory.THIS, expr));
+ return expr;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/InstallOperation.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/InstallOperation.java
index 61b02019b..6b3c41771 100644
--- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/InstallOperation.java
+++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/InstallOperation.java
@@ -20,9 +20,8 @@ import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.query.UserVisibleRootQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
-import org.eclipse.equinox.p2.metadata.query.PatchQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
/**
* An InstallOperation describes an operation that installs IInstallableUnits into
@@ -72,11 +71,11 @@ public class InstallOperation extends ProfileChangeOperation {
for (IInstallableUnit entryToInstall : toInstall) {
// If the user is installing a patch, we mark it optional. This allows
// the patched IU to be updated later by removing the patch.
- if (PatchQuery.isPatch(entryToInstall))
+ if (QueryUtil.isPatch(entryToInstall))
request.setInstallableUnitInclusionRules(entryToInstall, PlannerHelper.createOptionalInclusionRule(entryToInstall));
// Check to see if it is already installed. This may alter the request.
- IQueryResult<IInstallableUnit> alreadyInstalled = profile.query(new InstallableUnitQuery(entryToInstall.getId()), null);
+ IQueryResult<IInstallableUnit> alreadyInstalled = profile.query(QueryUtil.createIUQuery(entryToInstall.getId()), null);
// TODO ideally we should only do this check if the iu is a singleton, but in practice many iu's that should
// be singletons are not, so we don't check this (yet)
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=230878
diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java
index 3bffccf05..b71e1dad6 100644
--- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java
+++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java
@@ -12,6 +12,8 @@
package org.eclipse.equinox.p2.operations;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.IOException;
import java.util.*;
import org.eclipse.core.runtime.*;
@@ -27,7 +29,6 @@ import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.query.UserVisibleRootQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
@@ -183,7 +184,7 @@ public class ProvisioningSession {
}
private int countPlanElements(IProvisioningPlan plan) {
- return new CompoundQueryable<IInstallableUnit>(plan.getAdditions(), plan.getRemovals()).query(InstallableUnitQuery.ANY, null).unmodifiableSet().size();
+ return QueryUtil.compoundQueryable(plan.getAdditions(), plan.getRemovals()).query(QueryUtil.createIUAnyQuery(), null).unmodifiableSet().size();
}
/**
@@ -218,7 +219,7 @@ public class ProvisioningSession {
// we will be able to get everything else.
ProfileChangeRequest downloadRequest = new ProfileChangeRequest(profile);
downloadRequest.setAbsoluteMode(true);
- downloadRequest.addAll(new CompoundQueryable<IInstallableUnit>(plan.getAdditions(), plan.getInstallerPlan().getAdditions()).query(InstallableUnitQuery.ANY, null).unmodifiableSet());
+ downloadRequest.addAll(QueryUtil.compoundQueryable(plan.getAdditions(), plan.getInstallerPlan().getAdditions()).query(QueryUtil.createIUAnyQuery(), null).unmodifiableSet());
IPhaseSet download = DefaultPhaseSet.createIncluding(new String[] {DefaultPhaseSet.PHASE_COLLECT});
IProvisioningPlan downloadPlan = getPlanner().getProvisioningPlan(downloadRequest, context, mon.newChild(100));
@@ -308,7 +309,7 @@ public class ProvisioningSession {
return CollectionUtils.emptyList();
IQuery<IInstallableUnit> query;
if (all)
- query = InstallableUnitQuery.ANY;
+ query = QueryUtil.createIUAnyQuery();
else
query = new UserVisibleRootQuery();
IQueryResult<IInstallableUnit> queryResult = profile.query(query, null);
diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/UpdateOperation.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/UpdateOperation.java
index d630377a3..4fdd8b77f 100644
--- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/UpdateOperation.java
+++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/UpdateOperation.java
@@ -12,6 +12,8 @@
package org.eclipse.equinox.p2.operations;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.operations.*;
@@ -19,8 +21,6 @@ import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
-import org.eclipse.equinox.p2.metadata.query.PatchQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
/**
@@ -140,7 +140,7 @@ public class UpdateOperation extends ProfileChangeOperation {
// In the case of patches, it's possible that a patch is returned as an available update
// even though it is already installed, because we are querying each IU for updates individually.
// For now, we ignore any proposed update that is already installed.
- IQueryResult<IInstallableUnit> alreadyInstalled = profile.query(new InstallableUnitQuery(replacements[i]), null);
+ IQueryResult<IInstallableUnit> alreadyInstalled = profile.query(QueryUtil.createIUQuery(replacements[i]), null);
if (alreadyInstalled.isEmpty()) {
Update update = new Update(iu, replacements[i]);
updates.add(update);
@@ -190,7 +190,7 @@ public class UpdateOperation extends ProfileChangeOperation {
boolean foundPatch = false;
for (int j = 0; j < updates.length; j++) {
String key;
- if (PatchQuery.isPatch(updates[j].replacement)) {
+ if (QueryUtil.isPatch(updates[j].replacement)) {
foundPatch = true;
key = updates[j].replacement.getId();
} else {
@@ -238,7 +238,7 @@ public class UpdateOperation extends ProfileChangeOperation {
}
request.add(theUpdate);
request.setInstallableUnitProfileProperty(theUpdate, IProfile.PROP_PROFILE_ROOT_IU, Boolean.toString(true));
- if (PatchQuery.isPatch(theUpdate)) {
+ if (QueryUtil.isPatch(theUpdate)) {
request.setInstallableUnitInclusionRules(theUpdate, PlannerHelper.createOptionalInclusionRule(theUpdate));
} else {
request.remove(update.toUpdate);
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java
index c251d5279..170d69fb1 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java
@@ -18,7 +18,6 @@ import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifact
import org.eclipse.equinox.internal.p2.core.helpers.*;
import org.eclipse.equinox.internal.p2.core.helpers.FileUtils.IPathComputer;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.p2.metadata.query.LatestIUVersionQuery;
import org.eclipse.equinox.internal.p2.publisher.Activator;
import org.eclipse.equinox.internal.p2.publisher.QuotedTokenizer;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
@@ -26,7 +25,6 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.Inst
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.expression.ExpressionUtil;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.publisher.actions.*;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.artifact.*;
@@ -494,9 +492,9 @@ public abstract class AbstractPublisherAction implements IPublisherAction {
* @return the first matching IU or <code>null</code> if none.
*/
protected IInstallableUnit queryForIU(IPublisherResult publisherResult, String iuId, Version version) {
- IQuery<IInstallableUnit> query = new InstallableUnitQuery(iuId, version);
+ IQuery<IInstallableUnit> query = QueryUtil.createIUQuery(iuId, version);
if (version == null || Version.emptyVersion.equals(version))
- query = new LatestIUVersionQuery<IInstallableUnit>(query);
+ query = QueryUtil.createLatestQuery(query);
IQueryResult<IInstallableUnit> collector = Collector.emptyCollector();
NullProgressMonitor progress = new NullProgressMonitor();
@@ -521,7 +519,7 @@ public abstract class AbstractPublisherAction implements IPublisherAction {
protected IQueryResult<IInstallableUnit> queryForIUs(IPublisherResult publisherResult, String iuId, VersionRange versionRange) {
IQuery<IInstallableUnit> query = null;
IQueryResult<IInstallableUnit> queryResult = Collector.emptyCollector();
- query = new InstallableUnitQuery(iuId, versionRange);
+ query = QueryUtil.createIUQuery(iuId, versionRange);
NullProgressMonitor progress = new NullProgressMonitor();
if (publisherResult != null)
queryResult = publisherResult.query(query, progress);
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherApplication.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherApplication.java
index 74734e269..740753680 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherApplication.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherApplication.java
@@ -11,6 +11,8 @@
*******************************************************************************/
package org.eclipse.equinox.p2.publisher;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
@@ -24,7 +26,6 @@ import org.eclipse.equinox.internal.p2.publisher.Messages;
import org.eclipse.equinox.p2.core.*;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.query.IQueryResult;
-import org.eclipse.equinox.p2.query.LimitQuery;
import org.eclipse.equinox.p2.repository.artifact.ArtifactKeyQuery;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -89,7 +90,7 @@ public abstract class AbstractPublisherApplication implements IApplication {
}
private boolean isEmpty(IArtifactRepository repo) {
- IQueryResult<IArtifactKey> result = repo.query(new LimitQuery<IArtifactKey>(ArtifactKeyQuery.ALL_KEYS, 1), null);
+ IQueryResult<IArtifactKey> result = repo.query(QueryUtil.createLimitQuery(ArtifactKeyQuery.ALL_KEYS, 1), null);
return result.isEmpty();
}
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/QueryableFilterAdvice.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/QueryableFilterAdvice.java
index 9a068b790..e2d8b7573 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/QueryableFilterAdvice.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/QueryableFilterAdvice.java
@@ -11,9 +11,7 @@ package org.eclipse.equinox.p2.publisher.actions;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
-import org.eclipse.equinox.p2.query.IQueryResult;
-import org.eclipse.equinox.p2.query.IQueryable;
+import org.eclipse.equinox.p2.query.*;
import org.osgi.framework.Filter;
/**
@@ -29,14 +27,14 @@ public class QueryableFilterAdvice implements IFilterAdvice {
}
public Filter getFilter(String id, Version version, boolean exact) {
- InstallableUnitQuery query = new InstallableUnitQuery(id, version);
+ IQuery<IInstallableUnit> query = QueryUtil.createIUQuery(id, version);
IQueryResult<IInstallableUnit> result = queryable.query(query, null);
if (!result.isEmpty())
return result.iterator().next().getFilter();
if (exact)
return null;
- query = new InstallableUnitQuery(id);
+ query = QueryUtil.createIUQuery(id);
result = queryable.query(query, null);
if (!result.isEmpty())
return result.iterator().next().getFilter();
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ApplicationLauncherAction.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ApplicationLauncherAction.java
index d0528cbbf..a35a926fa 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ApplicationLauncherAction.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ApplicationLauncherAction.java
@@ -10,6 +10,8 @@
******************************************************************************/
package org.eclipse.equinox.p2.publisher.eclipse;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.File;
import java.util.*;
import org.eclipse.core.runtime.*;
@@ -17,7 +19,6 @@ import org.eclipse.equinox.internal.p2.publisher.eclipse.ExecutablesDescriptor;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.FragmentQuery;
import org.eclipse.equinox.p2.publisher.*;
import org.eclipse.equinox.p2.publisher.actions.VersionAdvice;
@@ -91,7 +92,7 @@ public class ApplicationLauncherAction extends AbstractPublisherAction {
for (IInstallableUnit iu : ius) {
// skip over source bundles and fragments
// TODO should we use the source property here rather than magic name matching?
- if (iu.getId().endsWith(".source") || FragmentQuery.isFragment(iu)) //$NON-NLS-1$
+ if (iu.getId().endsWith(".source") || QueryUtil.isFragment(iu)) //$NON-NLS-1$
continue;
advice.setVersion(IInstallableUnit.NAMESPACE_IU_ID, iu.getId(), iu.getVersion());
found = true;
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src_ant/org/eclipse/equinox/internal/p2/publisher/ant/AbstractPublishTask.java b/bundles/org.eclipse.equinox.p2.publisher/src_ant/org/eclipse/equinox/internal/p2/publisher/ant/AbstractPublishTask.java
index 6204a46aa..04f18ebd7 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src_ant/org/eclipse/equinox/internal/p2/publisher/ant/AbstractPublishTask.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src_ant/org/eclipse/equinox/internal/p2/publisher/ant/AbstractPublishTask.java
@@ -8,6 +8,8 @@
******************************************************************************/
package org.eclipse.equinox.internal.p2.publisher.ant;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
@@ -25,7 +27,6 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.publisher.*;
import org.eclipse.equinox.p2.query.IQueryResult;
-import org.eclipse.equinox.p2.query.LimitQuery;
import org.eclipse.equinox.p2.repository.artifact.ArtifactKeyQuery;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
import org.eclipse.osgi.util.NLS;
@@ -105,7 +106,7 @@ public abstract class AbstractPublishTask extends Task {
}
private boolean isEmpty(IArtifactRepository repo) {
- IQueryResult<IArtifactKey> result = repo.query(new LimitQuery<IArtifactKey>(ArtifactKeyQuery.ALL_KEYS, 1), null);
+ IQueryResult<IArtifactKey> result = repo.query(QueryUtil.createLimitQuery(ArtifactKeyQuery.ALL_KEYS, 1), null);
return result.isEmpty();
}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java
index bd5027842..ddf584ff0 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java
@@ -11,6 +11,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.reconciler.dropins;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
@@ -25,7 +27,6 @@ import org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryLi
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
@@ -208,7 +209,7 @@ public class DropinsRepositoryListener extends RepositoryListener {
return;
Tracing.debug(PREFIX + "Repository created " + repository.getLocation()); //$NON-NLS-1$
// Print out a list of all the IUs in the repository
- IQueryResult<IInstallableUnit> result = repository.query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ IQueryResult<IInstallableUnit> result = repository.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor());
for (Iterator<IInstallableUnit> iter = result.iterator(); iter.hasNext();)
Tracing.debug(PREFIX + "\t" + iter.next()); //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
index 5cf44a773..51a56f606 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
@@ -10,6 +10,8 @@
******************************************************************************/
package org.eclipse.equinox.internal.p2.reconciler.dropins;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
@@ -26,8 +28,6 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.GroupQuery;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.Collector;
import org.eclipse.equinox.p2.query.IQueryResult;
@@ -104,7 +104,7 @@ public class ProfileSynchronizer {
return status;
debug(request, plan);
- if (plan.getAdditions().query(InstallableUnitQuery.ANY, null).isEmpty() && plan.getRemovals().query(InstallableUnitQuery.ANY, null).isEmpty()) {
+ if (plan.getAdditions().query(QueryUtil.createIUAnyQuery(), null).isEmpty() && plan.getRemovals().query(QueryUtil.createIUAnyQuery(), null).isEmpty()) {
writeTimestamps();
return status;
}
@@ -299,10 +299,10 @@ public class ProfileSynchronizer {
List<IInstallableUnit> toRemove = new ArrayList<IInstallableUnit>();
boolean foundIUsToAdd = false;
- Set<IInstallableUnit> profileIUs = profile.query(InstallableUnitQuery.ANY, null).unmodifiableSet();
+ Set<IInstallableUnit> profileIUs = profile.query(QueryUtil.createIUAnyQuery(), null).unmodifiableSet();
// we use IProfile.available(...) here so that we also gather any shared IUs
- Set<IInstallableUnit> availableProfileIUs = profile.available(InstallableUnitQuery.ANY, null).unmodifiableSet();
+ Set<IInstallableUnit> availableProfileIUs = profile.available(QueryUtil.createIUAnyQuery(), null).unmodifiableSet();
// get all IUs from all our repos (toAdd)
IQueryResult<IInstallableUnit> allIUs = getAllIUsFromRepos();
@@ -310,7 +310,7 @@ public class ProfileSynchronizer {
final IInstallableUnit iu = iter.next();
// if the IU is already installed in the profile then skip it
if (!profileIUs.contains(iu)) {
- if (GroupQuery.isGroup(iu))
+ if (QueryUtil.isGroup(iu))
request.setInstallableUnitProfileProperty(iu, IProfile.PROP_PROFILE_ROOT_IU, Boolean.TRUE.toString());
// mark all IUs with special property
request.setInstallableUnitProfileProperty(iu, PROP_FROM_DROPINS, Boolean.TRUE.toString());
@@ -370,11 +370,11 @@ public class ProfileSynchronizer {
List<IInstallableUnit> toRemove = new ArrayList<IInstallableUnit>(request.getRemovals());
// remove from the request everything that is in the plan
- for (Iterator<IInstallableUnit> iterator = plan.getRemovals().query(InstallableUnitQuery.ANY, null).iterator(); iterator.hasNext();) {
+ for (Iterator<IInstallableUnit> iterator = plan.getRemovals().query(QueryUtil.createIUAnyQuery(), null).iterator(); iterator.hasNext();) {
IInstallableUnit iu = iterator.next();
toRemove.remove(iu);
}
- for (Iterator<IInstallableUnit> iterator = plan.getAdditions().query(InstallableUnitQuery.ANY, null).iterator(); iterator.hasNext();) {
+ for (Iterator<IInstallableUnit> iterator = plan.getAdditions().query(QueryUtil.createIUAnyQuery(), null).iterator(); iterator.hasNext();) {
IInstallableUnit iu = iterator.next();
toAdd.remove(iu);
}
@@ -440,7 +440,7 @@ public class ProfileSynchronizer {
// TODO: Should consider using a sequenced iterator here instead of collecting
Collector<IInstallableUnit> allRepos = new Collector<IInstallableUnit>();
for (IMetadataRepository repository : repositoryMap.values()) {
- allRepos.addAll(repository.query(InstallableUnitQuery.ANY, null));
+ allRepos.addAll(repository.query(QueryUtil.createIUAnyQuery(), null));
}
return allRepos;
}
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/MirrorApplication.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/MirrorApplication.java
index e70468460..6fa0d1629 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/MirrorApplication.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/MirrorApplication.java
@@ -19,12 +19,10 @@ import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.p2.director.PermissiveSlicer;
-import org.eclipse.equinox.internal.p2.metadata.query.LatestIUVersionQuery;
import org.eclipse.equinox.internal.p2.repository.helpers.RepositoryHelper;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.internal.repository.mirroring.*;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
@@ -197,7 +195,7 @@ public class MirrorApplication extends AbstractApplication implements IApplicati
private IStatus mirrorArtifacts(IQueryable<IInstallableUnit> slice, IProgressMonitor monitor) {
// Obtain ArtifactKeys from IUs
- IQueryResult<IInstallableUnit> ius = slice.query(InstallableUnitQuery.ANY, monitor);
+ IQueryResult<IInstallableUnit> ius = slice.query(QueryUtil.createIUAnyQuery(), monitor);
ArrayList<IArtifactKey> keys = new ArrayList<IArtifactKey>();
for (Iterator<IInstallableUnit> iterator = ius.iterator(); iterator.hasNext();) {
IInstallableUnit iu = iterator.next();
@@ -240,7 +238,7 @@ public class MirrorApplication extends AbstractApplication implements IApplicati
}
private void mirrorMetadata(IQueryable<IInstallableUnit> slice, IProgressMonitor monitor) {
- IQueryResult<IInstallableUnit> allIUs = slice.query(InstallableUnitQuery.ANY, monitor);
+ IQueryResult<IInstallableUnit> allIUs = slice.query(QueryUtil.createIUAnyQuery(), monitor);
destinationMetadataRepository.addInstallableUnits(allIUs.toSet());
}
@@ -270,13 +268,13 @@ public class MirrorApplication extends AbstractApplication implements IApplicati
for (int i = 0; i < rootIUs.length; i++) {
String[] segments = getArrayArgsFromString(rootIUs[i], "/"); //$NON-NLS-1$
VersionRange range = segments.length > 1 ? new VersionRange(segments[i]) : null;
- Iterator<IInstallableUnit> queryResult = metadataRepo.query(new InstallableUnitQuery(segments[i], range), null).iterator();
+ Iterator<IInstallableUnit> queryResult = metadataRepo.query(QueryUtil.createIUQuery(segments[i], range), null).iterator();
while (queryResult.hasNext())
sourceIUs.add(queryResult.next());
}
} else if (sourceIUs == null || sourceIUs.isEmpty()) {
sourceIUs = new ArrayList<IInstallableUnit>();
- Iterator<IInstallableUnit> queryResult = metadataRepo.query(InstallableUnitQuery.ANY, null).iterator();
+ Iterator<IInstallableUnit> queryResult = metadataRepo.query(QueryUtil.createIUAnyQuery(), null).iterator();
while (queryResult.hasNext())
sourceIUs.add(queryResult.next());
/* old metadata mirroring app did not throw an exception here */
@@ -322,7 +320,7 @@ public class MirrorApplication extends AbstractApplication implements IApplicati
IQueryable<IInstallableUnit> slice = slicer.slice(sourceIUs.toArray(new IInstallableUnit[sourceIUs.size()]), monitor);
if (slice != null && slicingOptions.latestVersionOnly()) {
- IQueryResult<IInstallableUnit> queryResult = slice.query(new LatestIUVersionQuery<IInstallableUnit>(), monitor);
+ IQueryResult<IInstallableUnit> queryResult = slice.query(QueryUtil.createLatestIUQuery(), monitor);
slice = queryResult;
}
if (slicer.getStatus().getSeverity() != IStatus.OK && mirrorLog != null) {
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java
index ef3b8b842..346998652 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java
@@ -11,6 +11,8 @@
*******************************************************************************/
package org.eclipse.equinox.p2.internal.repository.tools;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.net.URISyntaxException;
import java.util.*;
import org.eclipse.core.runtime.*;
@@ -25,7 +27,6 @@ import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
@@ -199,7 +200,7 @@ public class Repo2Runnable extends AbstractApplication implements IApplication {
private IQueryResult<IInstallableUnit> getAllIUs(IMetadataRepository repository, IProgressMonitor monitor) {
SubMonitor progress = SubMonitor.convert(monitor, 2);
try {
- return repository.query(InstallableUnitQuery.ANY, progress.newChild(1));
+ return repository.query(QueryUtil.createIUAnyQuery(), progress.newChild(1));
} finally {
progress.done();
}
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/HostCheckAnalyzer.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/HostCheckAnalyzer.java
index ed9125b23..5add41a2e 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/HostCheckAnalyzer.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/HostCheckAnalyzer.java
@@ -13,8 +13,8 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.metadata.RequiredCapability;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.expression.IMatchExpression;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.tools.analyzer.IUAnalyzer;
@@ -36,7 +36,7 @@ public class HostCheckAnalyzer extends IUAnalyzer {
if ("osgi.bundle".equals(namespace)) {
String name = RequiredCapability.extractName(hostMatch);
VersionRange range = RequiredCapability.extractRange(hostMatch);
- IQueryResult<IInstallableUnit> results = repository.query(new InstallableUnitQuery(name, range), new NullProgressMonitor());
+ IQueryResult<IInstallableUnit> results = repository.query(QueryUtil.createIUQuery(name, range), new NullProgressMonitor());
if (results.isEmpty()) {
error(iu, "IU Fragment: " + iu.getId() + " cannot find host" + name + " : " + range);
return;
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/repository/tools/analyzer/RepositoryAnalyzer.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/repository/tools/analyzer/RepositoryAnalyzer.java
index 446f0571c..1f082557b 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/repository/tools/analyzer/RepositoryAnalyzer.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/repository/tools/analyzer/RepositoryAnalyzer.java
@@ -9,11 +9,12 @@
******************************************************************************/
package org.eclipse.equinox.p2.repository.tools.analyzer;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.util.Iterator;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.p2.internal.repository.tools.Activator;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -36,7 +37,7 @@ public class RepositoryAnalyzer {
IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(IIUAnalyzer.ID);
for (int i = 0; i < repositories.length; i++) {
- IQueryResult<IInstallableUnit> queryResult = repositories[i].query(InstallableUnitQuery.ANY, sub);
+ IQueryResult<IInstallableUnit> queryResult = repositories[i].query(QueryUtil.createIUAnyQuery(), sub);
SubMonitor repositoryMonitor = SubMonitor.convert(sub, IProgressMonitor.UNKNOWN);
for (int j = 0; j < config.length; j++) {
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java
index 787da352e..dc5ffe55a 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java
@@ -13,14 +13,11 @@ package org.eclipse.equinox.p2.internal.repository.tools.tasks;
import java.util.*;
import org.apache.tools.ant.types.DataType;
import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
-import org.eclipse.equinox.internal.p2.metadata.query.IUPropertyQuery;
-import org.eclipse.equinox.internal.p2.metadata.query.LatestIUVersionQuery;
import org.eclipse.equinox.p2.internal.repository.tools.Activator;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQuery;
-import org.eclipse.equinox.p2.query.PipedQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
@@ -111,10 +108,10 @@ public class IUDescription extends DataType {
if (id != null) {
if (version == null || version.length() == 0) {
// Get the latest version of the iu
- queries.add(new LatestIUVersionQuery<IInstallableUnit>(new InstallableUnitQuery(id)));
+ queries.add(QueryUtil.createLatestQuery(QueryUtil.createIUQuery(id)));
} else {
Version iuVersion = Version.parseVersion(version);
- queries.add(new InstallableUnitQuery(id, iuVersion));
+ queries.add(QueryUtil.createIUQuery(id, iuVersion));
}
}
@@ -125,8 +122,7 @@ public class IUDescription extends DataType {
if (queries.size() == 1)
return queries.get(0);
- @SuppressWarnings("unchecked")
- IQuery<IInstallableUnit> query = PipedQuery.createPipe(queries.toArray(new IQuery[queries.size()]));
+ IQuery<IInstallableUnit> query = QueryUtil.createPipeQuery(queries);
return query;
}
@@ -145,8 +141,8 @@ public class IUDescription extends DataType {
if (name == null)
return null;
if (value == null)
- value = IUPropertyQuery.ANY;
- return new IUPropertyQuery(name, value);
+ value = QueryUtil.ANY;
+ return QueryUtil.createIUPropertyQuery(name, value);
}
return null;
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java
index cb4662088..c7933c227 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java
@@ -19,8 +19,8 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.internal.repository.tools.Messages;
import org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.query.CompoundQuery;
import org.eclipse.equinox.p2.query.IQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
public class MirrorTask extends AbstractRepositoryTask {
@@ -81,9 +81,7 @@ public class MirrorTask extends AbstractRepositoryTask {
if (queries.size() == 1)
return queries.get(0);
- @SuppressWarnings("unchecked")
- IQuery<IArtifactDescriptor>[] array = queries.toArray(new IQuery[queries.size()]);
- return CompoundQuery.<IArtifactDescriptor> createCompoundQuery(array, false);
+ return QueryUtil.<IArtifactDescriptor> createCompoundQuery(queries, false);
}
public SlicingOption createSlicingOptions() {
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java
index 47af929c7..c90b94161 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java
@@ -1112,7 +1112,7 @@ public abstract class AbstractRepositoryManager<T> implements IRepositoryManager
}
}
try {
- CompoundQueryable<T> compoundQueryable = new CompoundQueryable<T>(queryables);
+ IQueryable<T> compoundQueryable = QueryUtil.compoundQueryable(queryables);
return compoundQueryable.query(query, sub.newChild(locations.length * 1));
} finally {
sub.done();
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactDescriptorQuery.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactDescriptorQuery.java
index f387beb78..56337f1be 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactDescriptorQuery.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactDescriptorQuery.java
@@ -12,11 +12,12 @@
package org.eclipse.equinox.p2.repository.artifact;
+import org.eclipse.equinox.p2.query.ExpressionMatchQuery;
+
import java.util.*;
import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.p2.metadata.VersionRange;
import org.eclipse.equinox.p2.metadata.expression.*;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
/**
* A general purpose query for matching {@link IArtifactDescriptor} instances
@@ -24,7 +25,7 @@ import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
*
* @since 2.0
*/
-public class ArtifactDescriptorQuery extends ExpressionQuery<IArtifactDescriptor> {
+public class ArtifactDescriptorQuery extends ExpressionMatchQuery<IArtifactDescriptor> {
private static final IExpression descriptorMatch = ExpressionUtil.parse(//
"artifactKey.id == $0 && artifactKey.version ~= $1 && ($2.empty || $2.all(x | properties[x.key] == x.value))"); //$NON-NLS-1$
@@ -56,7 +57,7 @@ public class ArtifactDescriptorQuery extends ExpressionQuery<IArtifactDescriptor
*/
private ArtifactDescriptorQuery() {
//matches everything
- super(IArtifactDescriptor.class, matchAll());
+ super(IArtifactDescriptor.class, ExpressionUtil.TRUE_EXPRESSION);
}
/**
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactKeyQuery.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactKeyQuery.java
index b093d68cc..02e154322 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactKeyQuery.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactKeyQuery.java
@@ -12,10 +12,12 @@
package org.eclipse.equinox.p2.repository.artifact;
+import org.eclipse.equinox.p2.query.ExpressionMatchQuery;
+
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.VersionRange;
-import org.eclipse.equinox.p2.metadata.expression.*;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
+import org.eclipse.equinox.p2.metadata.expression.ExpressionUtil;
+import org.eclipse.equinox.p2.metadata.expression.IExpression;
/**
* A general purpose query for matching {@link IArtifactKey} instances
@@ -23,22 +25,22 @@ import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
*
* @since 2.0
*/
-public class ArtifactKeyQuery extends ExpressionQuery<IArtifactKey> {
+public class ArtifactKeyQuery extends ExpressionMatchQuery<IArtifactKey> {
private static final IExpression matchKey = ExpressionUtil.parse("this == $0"); //$NON-NLS-1$
private static final IExpression matchID = ExpressionUtil.parse("id == $0"); //$NON-NLS-1$
private static final IExpression matchIDClassifierRange = ExpressionUtil.parse("id == $0 && version ~= $2 && (null == $1 || classifier == $1)"); //$NON-NLS-1$
- private static IMatchExpression<IArtifactKey> createMatchExpression(IArtifactKey key) {
+ private static IExpression createMatchExpression(IArtifactKey key) {
if (key == null)
- return matchAll();
+ return ExpressionUtil.TRUE_EXPRESSION;
return ExpressionUtil.getFactory().<IArtifactKey> matchExpression(matchKey, key);
}
- private static IMatchExpression<IArtifactKey> createMatchExpression(String classifier, String id, VersionRange range) {
+ private static IExpression createMatchExpression(String classifier, String id, VersionRange range) {
if (range == null) {
if (classifier == null) {
if (id == null)
- return matchAll();
+ return ExpressionUtil.TRUE_EXPRESSION;
return ExpressionUtil.getFactory().<IArtifactKey> matchExpression(matchID, id);
}
range = VersionRange.emptyRange;
@@ -60,7 +62,7 @@ public class ArtifactKeyQuery extends ExpressionQuery<IArtifactKey> {
}
private ArtifactKeyQuery() {
- super(IArtifactKey.class, matchAll());
+ super(IArtifactKey.class, ExpressionUtil.TRUE_EXPRESSION);
}
public ArtifactKeyQuery(IArtifactKey key) {
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/IUPropertyPagesTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/IUPropertyPagesTest.java
index 52b85ae92..33997fa15 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/IUPropertyPagesTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/dialogs/IUPropertyPagesTest.java
@@ -10,15 +10,11 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.ui.dialogs;
-import org.eclipse.equinox.p2.metadata.Version;
-
-import org.eclipse.equinox.p2.metadata.ILicense;
-
import java.net.URI;
import java.net.URISyntaxException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.*;
+import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.tests.ui.AbstractProvisioningUITest;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.dialogs.PropertyDialog;
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/planning/UpdatePlanning.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/planning/UpdatePlanning.java
index bb854f395..9f3d3d02b 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/planning/UpdatePlanning.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/planning/UpdatePlanning.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.ui.planning;
-import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
-
import java.util.ArrayList;
import java.util.HashSet;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
@@ -21,6 +19,7 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.operations.Update;
import org.eclipse.equinox.p2.operations.UpdateOperation;
+import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
import org.eclipse.equinox.p2.tests.ui.AbstractProvisioningUITest;
public class UpdatePlanning extends AbstractProvisioningUITest {
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java
index b4d723261..1bcaca558 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AbstractQueryTest.java
@@ -11,7 +11,6 @@
package org.eclipse.equinox.p2.tests.ui.query;
import org.eclipse.equinox.internal.p2.metadata.query.MatchQuery;
-
import org.eclipse.equinox.internal.p2.ui.ProvUI;
import org.eclipse.equinox.p2.operations.RepositoryTracker;
import org.eclipse.equinox.p2.query.IQuery;
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AnyRequiredCapabilityTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AnyRequiredCapabilityTest.java
index c7b138990..0e75761bc 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AnyRequiredCapabilityTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AnyRequiredCapabilityTest.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.ui.query;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
@@ -17,7 +19,6 @@ import org.eclipse.equinox.internal.p2.ui.QueryableMetadataRepositoryManager;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IRequirement;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.TestData;
@@ -31,7 +32,7 @@ public class AnyRequiredCapabilityTest extends AbstractQueryTest {
List items = new ArrayList();
items.add(match);
items.add(noMatch);
- IQueryResult result = ExpressionQuery.create(requires.getMatches()).perform(items.iterator());
+ IQueryResult result = QueryUtil.createMatchQuery(requires.getMatches()).perform(items.iterator());
assertEquals("1.0", 1, queryResultSize(result));
assertEquals("1.1", match, result.iterator().next());
}
@@ -48,7 +49,7 @@ public class AnyRequiredCapabilityTest extends AbstractQueryTest {
metadataRepositoryManager.addRepository(location);
QueryableMetadataRepositoryManager manager = new QueryableMetadataRepositoryManager(ProvisioningUI.getDefaultUI(), false);
IRequirement requires = MetadataFactory.createRequiredCapability("org.eclipse.equinox.p2.iu", "test.bundle", ANY_VERSION, null, false, false);
- IQueryResult result = manager.query(ExpressionQuery.create(requires.getMatches()), getMonitor());
+ IQueryResult result = manager.query(QueryUtil.createMatchQuery(requires.getMatches()), getMonitor());
assertEquals("1.0", 1, queryResultSize(result));
IInstallableUnit iu = (IInstallableUnit) result.iterator().next();
assertEquals("1.1", "test.bundle", iu.getId());
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AvailableIUWrapperTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AvailableIUWrapperTest.java
index 79e3f86c1..41cdcdd1d 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AvailableIUWrapperTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AvailableIUWrapperTest.java
@@ -11,18 +11,15 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.ui.query;
-import org.eclipse.equinox.p2.metadata.Version;
-
import java.util.*;
-import org.eclipse.equinox.internal.p2.metadata.query.IUPropertyQuery;
import org.eclipse.equinox.internal.p2.ui.model.CategoryElement;
import org.eclipse.equinox.internal.p2.ui.model.IIUElement;
import org.eclipse.equinox.internal.p2.ui.query.AvailableIUWrapper;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.query.Collector;
-import org.eclipse.equinox.p2.query.IQuery;
+import org.eclipse.equinox.p2.metadata.Version;
+import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.tests.MockQueryable;
/**
@@ -153,6 +150,6 @@ public class AvailableIUWrapperTest extends AbstractQueryTest {
}
protected IQuery getMockQuery() {
- return new IUPropertyQuery("key", "value");
+ return QueryUtil.createIUPropertyQuery("key", "value");
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/CategoryElementWrapperTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/CategoryElementWrapperTest.java
index 4a2470e71..d8f1838cd 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/CategoryElementWrapperTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/CategoryElementWrapperTest.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.ui.query;
-import org.eclipse.equinox.p2.metadata.Version;
-
import java.util.Collection;
import java.util.Iterator;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
@@ -21,6 +19,7 @@ import org.eclipse.equinox.internal.p2.ui.query.CategoryElementWrapper;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.query.Collector;
import org.eclipse.equinox.p2.tests.MockQueryable;
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 a98519434..87c788eef 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
@@ -11,17 +11,15 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.ui.query;
-import org.eclipse.equinox.p2.metadata.Version;
-
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.equinox.internal.p2.metadata.query.LatestIUVersionQuery;
import org.eclipse.equinox.internal.p2.ui.model.IIUElement;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.metadata.Version;
+import org.eclipse.equinox.p2.query.*;
/**
- * Tests for {@link LatestIUVersionQuery}. This has all the tests of the superclass,
+ * Tests for latest query. This has all the tests of the superclass,
* plus some extras for testing the latest IU capabilities.
*/
public class LatestIUVersionElementWrapperTest extends AvailableIUWrapperTest {
@@ -39,7 +37,7 @@ public class LatestIUVersionElementWrapperTest extends AvailableIUWrapperTest {
* Tests that only the latest version is collected.
*/
public void testCollectLatestIU() {
- LatestIUVersionQuery latestIuVersionElementQuery = new LatestIUVersionQuery();
+ IQuery 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();
@@ -52,7 +50,7 @@ public class LatestIUVersionElementWrapperTest extends AvailableIUWrapperTest {
}
public void testMultipleIUsAndVersions() {
- LatestIUVersionQuery latestIuVersionElementQuery = new LatestIUVersionQuery();
+ IQuery 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));
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java
index 3a18aa712..c220d4637 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java
@@ -9,11 +9,10 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.ui.query;
-import org.eclipse.equinox.internal.p2.metadata.query.MatchQuery;
-
import java.util.*;
import junit.framework.TestCase;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.equinox.internal.p2.metadata.query.MatchQuery;
import org.eclipse.equinox.internal.p2.ui.ElementQueryDescriptor;
import org.eclipse.equinox.internal.p2.ui.ElementWrapper;
import org.eclipse.equinox.p2.query.*;
@@ -100,7 +99,7 @@ public class QueryDescriptorTest extends TestCase {
}
public void testCompoundDescriptorAND() {
- IQuery query = CompoundQuery.createCompoundQuery(new IQuery[] {new SimpleMatchQuery(), new SimpleMatchQuery2()}, true);
+ IQuery query = QueryUtil.createCompoundQuery(new SimpleMatchQuery(), new SimpleMatchQuery2(), true);
ElementQueryDescriptor eqDescriptor = new ElementQueryDescriptor(new SimpleQueryable(), query, new Collector(), new StringWrapper());
Collection collection = eqDescriptor.performQuery(null);
assertEquals("1.0", 1, collection.size());
@@ -108,7 +107,7 @@ public class QueryDescriptorTest extends TestCase {
}
public void testCompoundDescriptorOR() {
- IQuery query = CompoundQuery.createCompoundQuery(new IQuery[] {new SimpleMatchQuery(), new SimpleMatchQuery2()}, false);
+ IQuery query = QueryUtil.createCompoundQuery(new SimpleMatchQuery(), new SimpleMatchQuery2(), false);
ElementQueryDescriptor eqDescriptor = new ElementQueryDescriptor(new SimpleQueryable(), query, new Collector(), new StringWrapper());
Collection collection = eqDescriptor.performQuery(null);
assertEquals("1.0", 3, collection.size());
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableMetadataRepositoryManagerTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableMetadataRepositoryManagerTest.java
index ceb273c84..5b8c4d953 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableMetadataRepositoryManagerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableMetadataRepositoryManagerTest.java
@@ -14,7 +14,6 @@ import java.io.File;
import java.net.URI;
import java.util.Collection;
import org.eclipse.core.tests.harness.CancelingProgressMonitor;
-import org.eclipse.equinox.internal.p2.metadata.query.IUPropertyQuery;
import org.eclipse.equinox.internal.p2.ui.*;
import org.eclipse.equinox.internal.p2.ui.model.AvailableIUElement;
import org.eclipse.equinox.internal.p2.ui.model.MetadataRepositories;
@@ -22,10 +21,10 @@ import org.eclipse.equinox.internal.p2.ui.query.IUViewQueryContext;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.operations.ProvisioningJob;
import org.eclipse.equinox.p2.operations.ProvisioningSession;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.TestData;
@@ -108,7 +107,7 @@ public class QueryableMetadataRepositoryManagerTest extends AbstractQueryTest {
metadataRepositoryManager.addRepository(broken);
QueryableMetadataRepositoryManager manager = getQueryableManager();
- IQueryResult result = manager.query(new InstallableUnitQuery("test.bundle", Version.createOSGi(1, 0, 0)), new CancelingProgressMonitor());
+ IQueryResult result = manager.query(QueryUtil.createIUQuery("test.bundle", Version.createOSGi(1, 0, 0)), new CancelingProgressMonitor());
assertTrue("1.0", result.isEmpty());
}
@@ -177,7 +176,7 @@ public class QueryableMetadataRepositoryManagerTest extends AbstractQueryTest {
metadataRepositoryManager.addRepository(broken);
QueryableMetadataRepositoryManager manager = getQueryableManager();
- IQueryResult result = manager.query(new InstallableUnitQuery("test.bundle", Version.createOSGi(1, 0, 0)), getMonitor());
+ IQueryResult result = manager.query(QueryUtil.createIUQuery("test.bundle", Version.createOSGi(1, 0, 0)), getMonitor());
assertEquals("1.0", 1, queryResultSize(result));
IInstallableUnit iu = (IInstallableUnit) result.iterator().next();
assertEquals("1.1", "test.bundle", iu.getId());
@@ -191,9 +190,9 @@ public class QueryableMetadataRepositoryManagerTest extends AbstractQueryTest {
assertContains("2.1", result, broken);
// null IUPropertyQuery collects all IUs
- result = manager.query(new InstallableUnitQuery((String) null), getMonitor());
+ result = manager.query(QueryUtil.createIUQuery((String) null), getMonitor());
int iuCount = queryResultSize(result);
- result = manager.query(new IUPropertyQuery(null, IUPropertyQuery.ANY), getMonitor());
+ result = manager.query(QueryUtil.createIUPropertyQuery(null, QueryUtil.ANY), getMonitor());
assertEquals("2.2", iuCount, queryResultSize(result));
}
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/TranslationSupportTests.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/TranslationSupportTests.java
index 33632cdc4..80f80f328 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/TranslationSupportTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/TranslationSupportTests.java
@@ -23,9 +23,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.Inst
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitFragmentDescription;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
-import org.eclipse.equinox.p2.query.IQueryResult;
-import org.eclipse.equinox.p2.query.IQueryable;
+import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -58,7 +56,7 @@ public class TranslationSupportTests extends AbstractQueryTest {
fail("1.99", e);
return;
}
- IQueryResult result = repository.query(new InstallableUnitQuery("test.feature.feature.group"), getMonitor());
+ IQueryResult result = repository.query(QueryUtil.createIUQuery("test.feature.feature.group"), getMonitor());
assertTrue("1.0", !result.isEmpty());
IInstallableUnit unit = (IInstallableUnit) result.iterator().next();
diff --git a/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java b/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java
index be5a5454f..4d6dee3a4 100644
--- a/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java
+++ b/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java
@@ -22,8 +22,8 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.osgi.framework.internal.core.Constants;
import org.eclipse.osgi.service.resolver.*;
import org.eclipse.osgi.util.NLS;
@@ -280,7 +280,7 @@ public class VerifierApplication implements IApplication {
IProfile profile = registry.getProfile(IProfileRegistry.SELF);
if (profile == null)
return createError("SELF profile not available in profile registry."); //$NON-NLS-1$
- IQueryResult results = profile.query(new InstallableUnitQuery(Activator.PLUGIN_ID), null);
+ IQueryResult results = profile.query(QueryUtil.createIUQuery(Activator.PLUGIN_ID), null);
if (results.isEmpty())
return createError(NLS.bind("IU for {0} not found in SELF profile.", Activator.PLUGIN_ID)); //$NON-NLS-1$
return Status.OK_STATUS;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
index a550d820b..7730810b9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
@@ -8,6 +8,8 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.*;
import java.lang.reflect.Field;
import java.net.URI;
@@ -30,8 +32,6 @@ import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.metadata.expression.ExpressionUtil;
-import org.eclipse.equinox.p2.metadata.query.FragmentQuery;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.publisher.PublisherInfo;
import org.eclipse.equinox.p2.publisher.eclipse.*;
@@ -591,7 +591,7 @@ public abstract class AbstractProvisioningTest extends TestCase {
}
public static Iterator getInstallableUnits(IProfile profile2) {
- return profile2.query(InstallableUnitQuery.ANY, null).iterator();
+ return profile2.query(QueryUtil.createIUAnyQuery(), null).iterator();
}
/**
@@ -843,7 +843,7 @@ public abstract class AbstractProvisioningTest extends TestCase {
}
protected IInstallableUnit getIU(IMetadataRepository repository, String name) {
- IQueryResult queryResult = repository.query(new InstallableUnitQuery(name), null);
+ IQueryResult queryResult = repository.query(QueryUtil.createIUQuery(name), null);
IInstallableUnit unit = null;
if (!queryResult.isEmpty())
@@ -946,17 +946,17 @@ public abstract class AbstractProvisioningTest extends TestCase {
}
protected static void assertInstallOperand(IProvisioningPlan plan, IInstallableUnit iu) {
- if (plan.getAdditions().query(new InstallableUnitQuery(iu), null).isEmpty())
+ if (plan.getAdditions().query(QueryUtil.createIUQuery(iu), null).isEmpty())
fail("Can't find " + iu + " in the plan");
}
protected static void assertUninstallOperand(IProvisioningPlan plan, IInstallableUnit iu) {
- if (plan.getRemovals().query(new InstallableUnitQuery(iu), null).isEmpty())
+ if (plan.getRemovals().query(QueryUtil.createIUQuery(iu), null).isEmpty())
fail("Can't find " + iu + " in the plan");
}
protected static void assertNoOperand(IProvisioningPlan plan, IInstallableUnit iu) {
- if (!(plan.getRemovals().query(new InstallableUnitQuery(iu), null).isEmpty() && plan.getAdditions().query(new InstallableUnitQuery(iu), null).isEmpty()))
+ if (!(plan.getRemovals().query(QueryUtil.createIUQuery(iu), null).isEmpty() && plan.getAdditions().query(QueryUtil.createIUQuery(iu), null).isEmpty()))
fail(iu + " should not be present in this plan.");
}
@@ -1058,15 +1058,15 @@ public abstract class AbstractProvisioningTest extends TestCase {
if (!iu1.equals(iu2))
fail(message + " " + iu1 + " is not equal to " + iu2);
- if (FragmentQuery.isFragment(iu1)) {
- if (!FragmentQuery.isFragment(iu2))
+ if (QueryUtil.isFragment(iu1)) {
+ if (!QueryUtil.isFragment(iu2))
fail(message + " " + iu1 + " is not a fragment.");
try {
assertEquals(message, ((IInstallableUnitFragment) iu1).getHost(), ((IInstallableUnitFragment) iu2).getHost());
} catch (AssertionFailedError failure) {
fail(message + " Unequal hosts: " + failure.getMessage());
}
- } else if (FragmentQuery.isFragment(iu2)) {
+ } else if (QueryUtil.isFragment(iu2)) {
fail(message + " " + iu2 + " is a fragment.");
}
@@ -1220,12 +1220,12 @@ public abstract class AbstractProvisioningTest extends TestCase {
* Note: NOT BICONDITIONAL! assertContains(A, B) is NOT the same as assertContains(B, A)
*/
protected static void assertContains(String message, IMetadataRepository sourceRepo, IMetadataRepository destinationRepo) {
- IQueryResult sourceCollector = sourceRepo.query(InstallableUnitQuery.ANY, null);
+ IQueryResult sourceCollector = sourceRepo.query(QueryUtil.createIUAnyQuery(), null);
Iterator it = sourceCollector.iterator();
while (it.hasNext()) {
IInstallableUnit sourceIU = (IInstallableUnit) it.next();
- IQueryResult destinationCollector = destinationRepo.query(new InstallableUnitQuery(sourceIU), null);
+ IQueryResult destinationCollector = destinationRepo.query(QueryUtil.createIUQuery(sourceIU), null);
assertEquals(message, 1, queryResultSize(destinationCollector));
assertEquals(message, sourceIU, (IInstallableUnit) destinationCollector.iterator().next());
}
@@ -1241,12 +1241,12 @@ public abstract class AbstractProvisioningTest extends TestCase {
}
public static void assertContains(String message, IQueryable source, IQueryable destination) {
- IQueryResult sourceCollector = source.query(InstallableUnitQuery.ANY, null);
+ IQueryResult sourceCollector = source.query(QueryUtil.createIUAnyQuery(), null);
Iterator it = sourceCollector.iterator();
while (it.hasNext()) {
IInstallableUnit sourceIU = (IInstallableUnit) it.next();
- IQueryResult destinationCollector = destination.query(new InstallableUnitQuery(sourceIU), null);
+ IQueryResult destinationCollector = destination.query(QueryUtil.createIUQuery(sourceIU), null);
assertEquals(message, 1, queryResultSize(destinationCollector));
assertTrue(message, sourceIU.equals(destinationCollector.iterator().next()));
}
@@ -1465,7 +1465,7 @@ public abstract class AbstractProvisioningTest extends TestCase {
}
public int countPlanElements(IProvisioningPlan plan) {
- return queryResultSize(new CompoundQueryable(plan.getAdditions(), plan.getRemovals()).query(InstallableUnitQuery.ANY, null));
+ return queryResultSize(QueryUtil.compoundQueryable(plan.getAdditions(), plan.getRemovals()).query(QueryUtil.createIUAnyQuery(), null));
}
/**
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java
index 52ae7a134..1d4e8c7a8 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java
@@ -18,9 +18,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
-import org.eclipse.equinox.p2.query.IQuery;
-import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.spi.AbstractMetadataRepository;
@@ -70,7 +68,7 @@ public class TestMetadataRepository extends AbstractMetadataRepository {
}
public IInstallableUnit find(String id, String versionString) {
- Iterator result = query(new InstallableUnitQuery(id, Version.create(versionString)), null).iterator();
+ Iterator result = query(QueryUtil.createIUQuery(id, Version.create(versionString)), null).iterator();
return (IInstallableUnit) (result.hasNext() ? result.next() : null);
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java
index fd39a29ec..5219701ce 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java
@@ -24,7 +24,6 @@ import org.eclipse.equinox.internal.p2.metadata.InstallableUnit;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.internal.repository.comparator.MD5ArtifactComparator;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -319,7 +318,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
AntTaskElement mirror = createMirrorTask(TYPE_METADATA);
@@ -333,7 +332,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
p.setProperty("org.eclipse.update.install.features", String.valueOf(true));
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, true, true, true, false);
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
- assertEquals("Different number of IUs", queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor())), getIUCount(destinationRepo));
+ assertEquals("Different number of IUs", queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())), getIUCount(destinationRepo));
try {
assertIUContentEquals("IUs differ", result, getMetadataRepositoryManager().loadRepository(destinationRepo, null));
@@ -349,7 +348,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
AntTaskElement mirror = createMirrorTask(TYPE_METADATA);
@@ -362,7 +361,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
PermissiveSlicer slicer = new PermissiveSlicer(repo, new Properties(), true, false, true, false, false);
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
- assertEquals("Different number of IUs", queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor())), getIUCount(destinationRepo));
+ assertEquals("Different number of IUs", queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())), getIUCount(destinationRepo));
try {
assertIUContentEquals("IUs differ", result, getMetadataRepositoryManager().loadRepository(destinationRepo, null));
} catch (ProvisionException e) {
@@ -377,7 +376,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
AntTaskElement mirror = createMirrorTask(TYPE_METADATA);
@@ -391,7 +390,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
p.setProperty("org.eclipse.update.install.features", String.valueOf(true));
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, false, true, true, false, false);
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
- assertEquals("Different number of IUs", queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor())), getIUCount(destinationRepo));
+ assertEquals("Different number of IUs", queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())), getIUCount(destinationRepo));
try {
assertIUContentEquals("IUs differ", result, getMetadataRepositoryManager().loadRepository(destinationRepo, null));
} catch (ProvisionException e) {
@@ -406,7 +405,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
AntTaskElement mirror = createMirrorTask(TYPE_METADATA);
@@ -419,7 +418,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
Properties p = getSliceProperties();
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, true, true, false, false);
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
- assertEquals("Different number of IUs", queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor())), getIUCount(destinationRepo));
+ assertEquals("Different number of IUs", queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())), getIUCount(destinationRepo));
try {
assertIUContentEquals("IUs differ", result, getMetadataRepositoryManager().loadRepository(destinationRepo, null));
} catch (ProvisionException e) {
@@ -437,7 +436,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
AntTaskElement mirror = createMirrorTask(TYPE_METADATA);
@@ -451,7 +450,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
p.setProperty("org.eclipse.update.install.features", String.valueOf(true));
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, true, true, false, false);
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
- assertEquals("Different number of IUs", queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor())), getIUCount(destinationRepo));
+ assertEquals("Different number of IUs", queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())), getIUCount(destinationRepo));
try {
assertIUContentEquals("IUs differ", result, getMetadataRepositoryManager().loadRepository(destinationRepo, null));
} catch (ProvisionException e) {
@@ -469,7 +468,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
// Create task
@@ -483,7 +482,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
Properties p = getSliceProperties();
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, true, true, false, false);
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
- assertEquals("Different number of IUs", queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor())), getIUCount(destinationRepo));
+ assertEquals("Different number of IUs", queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())), getIUCount(destinationRepo));
try {
assertIUContentEquals("IUs differ", result, getMetadataRepositoryManager().loadRepository(destinationRepo, null));
} catch (ProvisionException e) {
@@ -501,7 +500,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- IQueryResult c = repo.query(new InstallableUnitQuery("test.feature.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("test.feature.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
// Create task
@@ -516,10 +515,10 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, true, true, false, false);
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
- assertEquals("Different number of IUs", queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor())), getIUCount(destinationRepo));
- assertEquals("Different number of ArtifactKeys", getArtifactKeyCount(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor())), getArtifactKeyCount(destinationRepo));
+ assertEquals("Different number of IUs", queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())), getIUCount(destinationRepo));
+ assertEquals("Different number of ArtifactKeys", getArtifactKeyCount(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())), getArtifactKeyCount(destinationRepo));
try {
- assertArtifactKeyContentEquals("Different ArtifactKeys", result.query(InstallableUnitQuery.ANY, new NullProgressMonitor()), destinationRepo);
+ assertArtifactKeyContentEquals("Different ArtifactKeys", result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()), destinationRepo);
assertIUContentEquals("IUs differ", result, getMetadataRepositoryManager().loadRepository(destinationRepo, null));
} catch (ProvisionException e) {
fail("Failed to compare contents", e);
@@ -537,7 +536,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- IQueryResult c = repo.query(new InstallableUnitQuery("test.feature.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("test.feature.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
// Create task
@@ -552,8 +551,8 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, true, true, false, false);
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
- assertEquals("Different number of ArtifactKeys", getArtifactKeyCount(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor())), getArtifactKeyCount(destinationRepo));
- assertArtifactKeyContentEquals("Different ArtifactKeys", result.query(InstallableUnitQuery.ANY, new NullProgressMonitor()), destinationRepo);
+ assertEquals("Different number of ArtifactKeys", getArtifactKeyCount(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())), getArtifactKeyCount(destinationRepo));
+ assertArtifactKeyContentEquals("Different ArtifactKeys", result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()), destinationRepo);
}
/*
@@ -566,10 +565,10 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- IQueryResult c = repo.query(new InstallableUnitQuery("test.feature.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("test.feature.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
- c = repo.query(new InstallableUnitQuery("RCP_Browser_Example.feature.group"), new NullProgressMonitor());
+ c = repo.query(QueryUtil.createIUQuery("RCP_Browser_Example.feature.group"), new NullProgressMonitor());
IInstallableUnit iu2 = (IInstallableUnit) c.iterator().next();
// Create task
@@ -585,8 +584,8 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, true, true, false, false);
IQueryable result = slicer.slice(new IInstallableUnit[] {iu, iu2}, new NullProgressMonitor());
- assertEquals("Different number of ArtifactKeys", getArtifactKeyCount(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor())), getArtifactKeyCount(destinationRepo));
- assertArtifactKeyContentEquals("Different ArtifactKeys", result.query(InstallableUnitQuery.ANY, new NullProgressMonitor()), destinationRepo);
+ assertEquals("Different number of ArtifactKeys", getArtifactKeyCount(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())), getArtifactKeyCount(destinationRepo));
+ assertArtifactKeyContentEquals("Different ArtifactKeys", result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()), destinationRepo);
}
public void testMirrorCompareWithIgnore() throws Exception {
@@ -644,7 +643,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.ui.examples.readmetool"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.ui.examples.readmetool"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
// Create task
@@ -826,7 +825,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
*/
protected int getIUCount(URI location) {
try {
- return queryResultSize(getMetadataRepositoryManager().loadRepository(location, null).query(InstallableUnitQuery.ANY, null));
+ return queryResultSize(getMetadataRepositoryManager().loadRepository(location, null).query(QueryUtil.createIUAnyQuery(), null));
} catch (ProvisionException e) {
fail("Failed to load repository " + URIUtil.toUnencodedString(location) + " for ArtifactDescriptor count");
return -1;
@@ -837,7 +836,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
* Add all IUs to the parent element
*/
protected void addAllIUs(AntTaskElement parent, IMetadataRepository repo) {
- IQueryResult queryResult = repo.query(InstallableUnitQuery.ANY, null);
+ IQueryResult queryResult = repo.query(QueryUtil.createIUAnyQuery(), null);
for (Iterator iter = queryResult.iterator(); iter.hasNext();) {
IInstallableUnit iu = (IInstallableUnit) iter.next();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/Repo2RunnableTaskTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/Repo2RunnableTaskTests.java
index 1fb74ff9b..90d52405d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/Repo2RunnableTaskTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/Repo2RunnableTaskTests.java
@@ -17,8 +17,8 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractAntProvisioningTest;
@@ -60,7 +60,7 @@ public class Repo2RunnableTaskTests extends AbstractAntProvisioningTest {
IInstallableUnit iu = null;
try {
IMetadataRepository repo = getMetadataRepositoryManager().loadRepository(source, new NullProgressMonitor());
- IQueryResult ius = repo.query(new InstallableUnitQuery("helloworldfeature.feature.jar"), new NullProgressMonitor());
+ IQueryResult ius = repo.query(QueryUtil.createIUQuery("helloworldfeature.feature.jar"), new NullProgressMonitor());
assertEquals("Expected number of IUs", 1, queryResultSize(ius));
iu = (IInstallableUnit) ius.iterator().next();
} catch (ProvisionException e) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryMissingSizeData.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryMissingSizeData.java
index aac4bca55..082bf17e7 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryMissingSizeData.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactRepositoryMissingSizeData.java
@@ -21,7 +21,7 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.VersionRange;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -40,8 +40,8 @@ public class ArtifactRepositoryMissingSizeData extends AbstractProvisioningTest
IMetadataRepositoryManager mmgr = getMetadataRepositoryManager();
metaRepo = mmgr.loadRepository((getTestData("MissingArtifact repo", testDataLocation).toURI()), null);
- missingArtifactIU = (IInstallableUnit) metaRepo.query(new InstallableUnitQuery("javax.wsdl", new VersionRange("[1.5, 1.6)")), null).iterator().next();
- missingSizeIU = (IInstallableUnit) metaRepo.query(new InstallableUnitQuery("javax.wsdl", new VersionRange("[1.4, 1.5)")), null).iterator().next();
+ missingArtifactIU = (IInstallableUnit) metaRepo.query(QueryUtil.createIUQuery("javax.wsdl", new VersionRange("[1.5, 1.6)")), null).iterator().next();
+ missingSizeIU = (IInstallableUnit) metaRepo.query(QueryUtil.createIUQuery("javax.wsdl", new VersionRange("[1.4, 1.5)")), null).iterator().next();
IArtifactRepositoryManager mgr = getArtifactRepositoryManager();
source = mgr.loadRepository((getTestData("MissingArtifact repo", testDataLocation).toURI()), null);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug265577.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug265577.java
index 92b95a499..52fb22815 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug265577.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug265577.java
@@ -17,8 +17,8 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -59,7 +59,7 @@ public class Bug265577 extends AbstractProvisioningTest {
// Tests the response to a feature folder inside a jar
public void testZippedRepoWithFolderFeature() {
- IQueryResult queryResult = metadataRepo.query(new InstallableUnitQuery("Field_Assist_Example.feature.jar"), null);
+ IQueryResult queryResult = metadataRepo.query(QueryUtil.createIUQuery("Field_Assist_Example.feature.jar"), null);
IInstallableUnit[] ius = (IInstallableUnit[]) queryResult.toArray(IInstallableUnit.class);
IArtifactKey key = (ius[0].getArtifacts()).iterator().next();
@@ -83,7 +83,7 @@ public class Bug265577 extends AbstractProvisioningTest {
// Test to retrieve a file from a zipped metadata & artifact repository
public void testZippedRepo() {
- IQueryResult queryResult = metadataRepo.query(new InstallableUnitQuery("valid.feature.jar"), null);
+ IQueryResult queryResult = metadataRepo.query(QueryUtil.createIUQuery("valid.feature.jar"), null);
IInstallableUnit[] ius = (IInstallableUnit[]) queryResult.toArray(IInstallableUnit.class);
IArtifactKey key = (ius[0].getArtifacts()).iterator().next();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java
index 38de5985f..222699b1d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java
@@ -9,12 +9,9 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.core;
-import org.eclipse.equinox.internal.p2.metadata.query.MatchQuery;
-
-import org.eclipse.equinox.internal.p2.metadata.query.IMatchQuery;
-
import java.util.*;
import junit.framework.TestCase;
+import org.eclipse.equinox.internal.p2.metadata.query.MatchQuery;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -33,7 +30,7 @@ public class AggregateQueryTest extends TestCase {
}
public void testEmptyCompositeQuery() {
- IQuery query = PipedQuery.createPipe(new IQuery[0]);
+ IQuery query = QueryUtil.createPipeQuery(Collections.<IQuery<Object>> emptySet());
query.perform(getABCDE().iterator());
// We should not throw an exception. No guarantee on what perform
// will return in this case
@@ -67,19 +64,19 @@ public class AggregateQueryTest extends TestCase {
}
};
- IQuery compoundQuery = CompoundQuery.createCompoundQuery(new IQuery[] {getLatest, getAllBut3}, true);
+ IQuery compoundQuery = QueryUtil.createCompoundQuery(getLatest, getAllBut3, true);
IQueryResult result = compoundQuery.perform(get123().iterator());
assertEquals(0, AbstractProvisioningTest.queryResultSize(result));
- compoundQuery = CompoundQuery.createCompoundQuery(new IQuery[] {getAllBut3, getLatest}, true);
+ compoundQuery = QueryUtil.createCompoundQuery(getAllBut3, getLatest, true);
result = compoundQuery.perform(get123().iterator());
assertEquals(0, AbstractProvisioningTest.queryResultSize(result));
- compoundQuery = CompoundQuery.createCompoundQuery(new IQuery[] {getLatest, getAllBut3}, false);
+ compoundQuery = QueryUtil.createCompoundQuery(getLatest, getAllBut3, false);
result = compoundQuery.perform(get123().iterator());
assertEquals(3, AbstractProvisioningTest.queryResultSize(result));
- compoundQuery = CompoundQuery.createCompoundQuery(new IQuery[] {getAllBut3, getLatest}, false);
+ compoundQuery = QueryUtil.createCompoundQuery(getAllBut3, getLatest, false);
result = compoundQuery.perform(get123().iterator());
assertEquals(3, AbstractProvisioningTest.queryResultSize(result));
@@ -118,81 +115,17 @@ public class AggregateQueryTest extends TestCase {
}
};
- IQuery compoundQuery = PipedQuery.createPipe(getLatest, getAllBut3);
+ IQuery compoundQuery = QueryUtil.createPipeQuery(getLatest, getAllBut3);
IQueryResult result = compoundQuery.perform(get123().iterator());
assertEquals(0, AbstractProvisioningTest.queryResultSize(result));
- compoundQuery = PipedQuery.createPipe(getAllBut3, getLatest);
+ compoundQuery = QueryUtil.createPipeQuery(getAllBut3, getLatest);
result = compoundQuery.perform(get123().iterator());
assertEquals(1, AbstractProvisioningTest.queryResultSize(result));
assertEquals("2", result.iterator().next());
}
- public void testCompoundAllMatchQueries() {
- IQuery A = new MatchQuery() {
- public boolean isMatch(Object candidate) {
- return false;
- }
- };
- IQuery B = new MatchQuery() {
- public boolean isMatch(Object candidate) {
- return false;
- }
- };
- IQuery C = new MatchQuery() {
- public boolean isMatch(Object candidate) {
- return false;
- }
- };
- IQuery compoundQuery = CompoundQuery.createCompoundQuery(new IQuery[] {A, B, C}, true);
- assertTrue("1.0", compoundQuery instanceof IMatchQuery);
- }
-
- public void testCompoundSomeMatchQueries() {
- IQuery A = new MatchQuery() {
- public boolean isMatch(Object candidate) {
- return false;
- }
- };
- IQuery B = new ContextQuery() {
- public Collector perform(Iterator iterator) {
- // TODO Auto-generated method stub
- return null;
- }
- };
- IQuery C = new MatchQuery() {
- public boolean isMatch(Object candidate) {
- return false;
- }
- };
- IQuery compoundQuery = CompoundQuery.createCompoundQuery(new IQuery[] {A, B, C}, true);
- assertTrue("1.0", !(compoundQuery instanceof IMatchQuery));
- }
-
- public void testCompoundNoMatchQueries() {
- IQuery A = new ContextQuery() {
- public Collector perform(Iterator iterator) {
- // TODO Auto-generated method stub
- return null;
- }
- };
- IQuery B = new ContextQuery() {
- public Collector perform(Iterator iterator) {
- // TODO Auto-generated method stub
- return null;
- }
- };
- IQuery C = new ContextQuery() {
- public Collector perform(Iterator iterator) {
- // TODO Auto-generated method stub
- return null;
- }
- };
- IQuery compoundQuery = CompoundQuery.createCompoundQuery(new IQuery[] {A, B, C}, true);
- assertTrue("1.0", !(compoundQuery instanceof IMatchQuery));
- }
-
public void testIntersection() {
IQuery ABC = new MatchQuery() {
public boolean isMatch(Object candidate) {
@@ -210,7 +143,7 @@ public class AggregateQueryTest extends TestCase {
}
};
- IQuery compoundQuery = CompoundQuery.createCompoundQuery(new IQuery[] {ABC, BCDE}, true);
+ IQuery compoundQuery = QueryUtil.createCompoundQuery(ABC, BCDE, true);
IQueryResult result = compoundQuery.perform(getABCDE().iterator());
assertEquals("1.0", AbstractProvisioningTest.queryResultSize(result), 2);
AbstractProvisioningTest.assertContains("1.1", result, "B");
@@ -242,7 +175,7 @@ public class AggregateQueryTest extends TestCase {
}
};
- IQuery compoundQuery = CompoundQuery.createCompoundQuery(new IQuery[] {ABC, BCDE}, true);
+ IQuery compoundQuery = QueryUtil.createCompoundQuery(ABC, BCDE, true);
IQueryResult result = compoundQuery.perform(getABCDE().iterator());
assertEquals("1.0", AbstractProvisioningTest.queryResultSize(result), 2);
AbstractProvisioningTest.assertContains("1.1", result, "B");
@@ -266,7 +199,7 @@ public class AggregateQueryTest extends TestCase {
}
};
- IQuery compoundQuery = CompoundQuery.createCompoundQuery(new IQuery[] {ABC, BCDE}, false);
+ IQuery compoundQuery = QueryUtil.createCompoundQuery(ABC, BCDE, false);
IQueryResult result = compoundQuery.perform(getABCDE().iterator());
assertEquals("1.0", AbstractProvisioningTest.queryResultSize(result), 5);
AbstractProvisioningTest.assertContains("1.1", result, "A");
@@ -301,7 +234,7 @@ public class AggregateQueryTest extends TestCase {
}
};
- IQuery compoundQuery = CompoundQuery.createCompoundQuery(new IQuery[] {ABC, BCDE}, false);
+ IQuery compoundQuery = QueryUtil.createCompoundQuery(ABC, BCDE, false);
IQueryResult result = compoundQuery.perform(getABCDE().iterator());
assertEquals("1.0", AbstractProvisioningTest.queryResultSize(result), 5);
AbstractProvisioningTest.assertContains("1.1", result, "A");
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java
index 5a24e5348..a9e330549 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java
@@ -11,9 +11,8 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.core;
-import org.eclipse.equinox.internal.p2.metadata.query.MatchQuery;
-
import java.util.*;
+import org.eclipse.equinox.internal.p2.metadata.query.MatchQuery;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java
index 9a52da388..56e25e479 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java
@@ -9,13 +9,12 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.core;
-import org.eclipse.equinox.internal.p2.metadata.query.MatchQuery;
-
import java.util.Arrays;
import java.util.Iterator;
import junit.framework.TestCase;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.tests.harness.TestProgressMonitor;
+import org.eclipse.equinox.internal.p2.metadata.query.MatchQuery;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -57,11 +56,11 @@ public class CompoundQueryableTest extends TestCase {
return Arrays.asList(array).iterator();
}
- IQueryable queryable1 = new IQueryable() {
+ IQueryable<Integer> queryable1 = new IQueryable<Integer>() {
Integer[] elements = new Integer[] {1, 2, 3, 4, 5};
- public IQueryResult query(IQuery query, IProgressMonitor monitor) {
- IQueryResult collector;
+ public IQueryResult<Integer> query(IQuery<Integer> query, IProgressMonitor monitor) {
+ IQueryResult<Integer> collector;
try {
monitor.beginTask("", 10);
collector = query.perform(createIterator(elements));
@@ -73,11 +72,11 @@ public class CompoundQueryableTest extends TestCase {
}
};
- IQueryable queryable2 = new IQueryable() {
+ IQueryable<Integer> queryable2 = new IQueryable<Integer>() {
Integer[] elements = new Integer[] {4, 6, 8, 10, 12};
- public IQueryResult query(IQuery query, IProgressMonitor monitor) {
- IQueryResult collector;
+ public IQueryResult<Integer> query(IQuery<Integer> query, IProgressMonitor monitor) {
+ IQueryResult<Integer> collector;
try {
monitor.beginTask("", 10);
collector = query.perform(createIterator(elements));
@@ -160,7 +159,7 @@ public class CompoundQueryableTest extends TestCase {
};
public void testMatchQuery() {
- CompoundQueryable cQueryable = new CompoundQueryable(queryable1, queryable2);
+ IQueryable cQueryable = QueryUtil.compoundQueryable(queryable1, queryable2);
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
IQueryResult queryResult = cQueryable.query(matchQuery, monitor);
assertEquals("1.0", 6, AbstractProvisioningTest.queryResultSize(queryResult));
@@ -173,7 +172,7 @@ public class CompoundQueryableTest extends TestCase {
}
public void testSingleQueryable() {
- CompoundQueryable cQueryable = new CompoundQueryable(Arrays.asList(queryable1));
+ IQueryable cQueryable = QueryUtil.compoundQueryable(Arrays.asList(queryable1));
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
IQueryResult queryResult = cQueryable.query(matchQuery, monitor);
assertEquals("1.0", 2, AbstractProvisioningTest.queryResultSize(queryResult));
@@ -182,7 +181,7 @@ public class CompoundQueryableTest extends TestCase {
}
public void testSingleContextQuery() {
- CompoundQueryable cQueryable = new CompoundQueryable(Arrays.asList(queryable1));
+ IQueryable cQueryable = QueryUtil.compoundQueryable(Arrays.asList(queryable1));
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
IQueryResult queryResult = cQueryable.query(greatestNumberQuery, monitor);
assertEquals("1.0", 1, AbstractProvisioningTest.queryResultSize(queryResult));
@@ -190,7 +189,7 @@ public class CompoundQueryableTest extends TestCase {
}
public void testMultipleContextQueries() {
- CompoundQueryable cQueryable = new CompoundQueryable(queryable1, queryable2);
+ IQueryable cQueryable = QueryUtil.compoundQueryable(queryable1, queryable2);
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
IQueryResult queryResult = cQueryable.query(greatestNumberQuery, monitor);
assertEquals("1.0", 1, AbstractProvisioningTest.queryResultSize(queryResult));
@@ -198,9 +197,9 @@ public class CompoundQueryableTest extends TestCase {
}
public void testCompoundMatchAndQuery() {
- CompoundQueryable cQueryable = new CompoundQueryable(queryable1, queryable2);
+ IQueryable cQueryable = QueryUtil.compoundQueryable(queryable1, queryable2);
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
- IQueryResult queryResult = cQueryable.query(CompoundQuery.createCompoundQuery(new IQuery[] {matchQuery, matchMod4query}, true), monitor);
+ IQueryResult queryResult = cQueryable.query(QueryUtil.createCompoundQuery(matchQuery, matchMod4query, true), monitor);
assertEquals("1.0", 3, AbstractProvisioningTest.queryResultSize(queryResult));
AbstractProvisioningTest.assertContains("1.2", queryResult, 4);
AbstractProvisioningTest.assertContains("1.4", queryResult, 8);
@@ -208,9 +207,9 @@ public class CompoundQueryableTest extends TestCase {
}
public void testCompoundMatchOrQuery() {
- CompoundQueryable cQueryable = new CompoundQueryable(queryable1, queryable2);
+ IQueryable cQueryable = QueryUtil.compoundQueryable(queryable1, queryable2);
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
- IQueryResult queryResult = cQueryable.query(CompoundQuery.createCompoundQuery(new IQuery[] {matchQuery, matchMod4query}, false), monitor);
+ IQueryResult queryResult = cQueryable.query(QueryUtil.createCompoundQuery(matchQuery, matchMod4query, false), monitor);
assertEquals("1.0", 6, AbstractProvisioningTest.queryResultSize(queryResult));
AbstractProvisioningTest.assertContains("1.2", queryResult, 2);
AbstractProvisioningTest.assertContains("1.2", queryResult, 4);
@@ -221,7 +220,7 @@ public class CompoundQueryableTest extends TestCase {
}
public void testMatchQueryProgressMonitor() {
- CompoundQueryable cQueryable = new CompoundQueryable(queryable1, queryable2);
+ IQueryable cQueryable = QueryUtil.compoundQueryable(queryable1, queryable2);
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
cQueryable.query(matchQuery, monitor);
assertTrue("1.0", monitor.isDone());
@@ -229,7 +228,7 @@ public class CompoundQueryableTest extends TestCase {
}
public void testSingleQueryableProgressMonitor() {
- CompoundQueryable cQueryable = new CompoundQueryable(Arrays.asList(queryable1));
+ IQueryable cQueryable = QueryUtil.compoundQueryable(Arrays.asList(queryable1));
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
cQueryable.query(matchQuery, monitor);
assertTrue("1.0", monitor.isDone());
@@ -237,7 +236,7 @@ public class CompoundQueryableTest extends TestCase {
}
public void testSingleContextQueryProgressMonitor() {
- CompoundQueryable cQueryable = new CompoundQueryable(Arrays.asList(queryable1));
+ IQueryable cQueryable = QueryUtil.compoundQueryable(Arrays.asList(queryable1));
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
cQueryable.query(greatestNumberQuery, monitor);
assertTrue("1.0", monitor.isDone());
@@ -245,7 +244,7 @@ public class CompoundQueryableTest extends TestCase {
}
public void testMultipleContextQueriesProgressMonitor() {
- CompoundQueryable cQueryable = new CompoundQueryable(queryable1, queryable2);
+ IQueryable cQueryable = QueryUtil.compoundQueryable(queryable1, queryable2);
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
cQueryable.query(greatestNumberQuery, monitor);
assertTrue("1.0", monitor.isDone());
@@ -253,17 +252,17 @@ public class CompoundQueryableTest extends TestCase {
}
public void testNullProgressMonitor() {
- CompoundQueryable cQueryable = new CompoundQueryable(queryable1, queryable2);
+ IQueryable cQueryable = QueryUtil.compoundQueryable(queryable1, queryable2);
cQueryable.query(greatestNumberQuery, null);
// this is the same as above will null passed in, this should not throw any exceptions
}
public void testDoubleCompoundContextOrQuery() {
- CompoundQueryable cQueryable1 = new CompoundQueryable(queryable3, queryable2);
- CompoundQueryable cQueryable = new CompoundQueryable(cQueryable1, queryable1);
+ IQueryable cQueryable1 = QueryUtil.compoundQueryable(queryable3, queryable2);
+ IQueryable cQueryable = QueryUtil.compoundQueryable(cQueryable1, queryable1);
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
- IQueryResult queryResult = cQueryable.query(CompoundQuery.createCompoundQuery(new IQuery[] {contextQuery, greatestNumberQuery}, false), monitor);
+ IQueryResult queryResult = cQueryable.query(QueryUtil.createCompoundQuery(contextQuery, greatestNumberQuery, false), monitor);
assertEquals("1.0", 7, AbstractProvisioningTest.queryResultSize(queryResult));
AbstractProvisioningTest.assertContains("1.2", queryResult, 2);
AbstractProvisioningTest.assertContains("1.2", queryResult, 4);
@@ -277,10 +276,10 @@ public class CompoundQueryableTest extends TestCase {
}
public void testDoubleCompositeQuery() {
- CompoundQueryable cQueryable1 = new CompoundQueryable(queryable3, queryable2);
- CompoundQueryable cQueryable = new CompoundQueryable(cQueryable1, queryable1);
+ IQueryable cQueryable1 = QueryUtil.compoundQueryable(queryable3, queryable2);
+ IQueryable cQueryable = QueryUtil.compoundQueryable(cQueryable1, queryable1);
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
- IQueryResult queryResult = cQueryable.query(PipedQuery.createPipe(contextQuery, greatestNumberQuery), monitor);
+ IQueryResult queryResult = cQueryable.query(QueryUtil.createPipeQuery(contextQuery, greatestNumberQuery), monitor);
assertEquals("1.0", 1, AbstractProvisioningTest.queryResultSize(queryResult));
AbstractProvisioningTest.assertContains("1.2", queryResult, 12);
assertTrue("1.0", monitor.isDone());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/ContextQuery.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/ContextQuery.java
index adaebd75d..11d0d9643 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/ContextQuery.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/ContextQuery.java
@@ -9,10 +9,10 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.core;
-import org.eclipse.equinox.p2.query.*;
-
import java.util.Iterator;
import org.eclipse.equinox.p2.metadata.expression.IExpression;
+import org.eclipse.equinox.p2.query.IQuery;
+import org.eclipse.equinox.p2.query.IQueryResult;
/**
* ContextQuery is the abstract superclass for Queries that require the entire
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/QueryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/QueryTest.java
index c6977d762..428d423b1 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/QueryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/QueryTest.java
@@ -10,11 +10,10 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.core;
-import org.eclipse.equinox.internal.p2.metadata.query.MatchQuery;
-
import java.util.Arrays;
import java.util.List;
import junit.framework.TestCase;
+import org.eclipse.equinox.internal.p2.metadata.query.MatchQuery;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -57,7 +56,7 @@ public class QueryTest extends TestCase {
public void testLimitQuery() {
List items = Arrays.asList("red", "green", "blue");
IQuery query = new AnyStringQuery();
- IQuery limitQuery = new LimitQuery(query, 1);
+ IQuery limitQuery = QueryUtil.createLimitQuery(query, 1);
IQueryResult collector = limitQuery.perform(items.iterator());
assertEquals("1.0", 1, AbstractProvisioningTest.queryResultSize(collector));
AbstractProvisioningTest.assertContains("1.1", collector, "red");
@@ -66,7 +65,7 @@ public class QueryTest extends TestCase {
public void testLimitQuery2() {
List items = Arrays.asList("red", "green", "blue");
IQuery query = new AnyStringQuery();
- IQuery limitQuery = new LimitQuery(query, 2);
+ IQuery limitQuery = QueryUtil.createLimitQuery(query, 2);
IQueryResult collector = limitQuery.perform(items.iterator());
assertEquals("1.0", 2, AbstractProvisioningTest.queryResultSize(collector));
AbstractProvisioningTest.assertContains("1.1", collector, "red");
@@ -76,7 +75,7 @@ public class QueryTest extends TestCase {
public void testLimitQuery3() {
List items = Arrays.asList("red", "green", "blue");
IQuery query = new AnyStringQuery();
- IQuery limitQuery = new LimitQuery(query, 3);
+ IQuery limitQuery = QueryUtil.createLimitQuery(query, 3);
IQueryResult collector = limitQuery.perform(items.iterator());
assertEquals("1.0", 3, AbstractProvisioningTest.queryResultSize(collector));
AbstractProvisioningTest.assertContains("1.1", collector, "red");
@@ -87,7 +86,7 @@ public class QueryTest extends TestCase {
public void testLimitQuery0() {
List items = Arrays.asList("red", "green", "blue");
IQuery query = new AnyStringQuery();
- IQuery limitQuery = new LimitQuery(query, 0);
+ IQuery limitQuery = QueryUtil.createLimitQuery(query, 0);
IQueryResult collector = limitQuery.perform(items.iterator());
assertEquals("1.0", 0, AbstractProvisioningTest.queryResultSize(collector));
}
@@ -102,7 +101,7 @@ public class QueryTest extends TestCase {
// }
// };
// IQuery pipedQuery = new PipedQuery(new IQuery[] {anyString, containsI});
- // IQuery limitQuery = new LimitQuery(pipedQuery, 1);
+ // IQuery limitQuery = LimitQuery.create(pipedQuery, 1);
// Collector collector = limitQuery.perform(items.iterator(), new Collector());
// Collection result = collector.toCollection();
// assertEquals("1.0", 1, result.size());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/ReplacePlanTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/ReplacePlanTest.java
index 9cdd322d0..6141b65be 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/ReplacePlanTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/ReplacePlanTest.java
@@ -10,13 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.director;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.IDirector;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
/**
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/RollbackTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/RollbackTest.java
index 1f9bedf6b..c97314f54 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/RollbackTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/RollbackTest.java
@@ -21,8 +21,8 @@ import org.eclipse.equinox.p2.core.IAgentLocation;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -111,7 +111,7 @@ public class RollbackTest extends AbstractProvisioningTest {
IStatus status = director.provision(request1, null, new NullProgressMonitor());
assertEquals("1.0", IStatus.OK, status.getCode());
- IQueryResult profileIUs = profile.query(InstallableUnitQuery.ANY, null);
+ IQueryResult profileIUs = profile.query(QueryUtil.createIUAnyQuery(), null);
assertContains("2.0", profileIUs, a1);
assertContains("3.0", profileIUs, b1);
@@ -123,7 +123,7 @@ public class RollbackTest extends AbstractProvisioningTest {
status = director.provision(request2, null, new NullProgressMonitor());
assertEquals("5.0", IStatus.OK, status.getCode());
- profileIUs = profile.query(InstallableUnitQuery.ANY, null);
+ profileIUs = profile.query(QueryUtil.createIUAnyQuery(), null);
assertNotContains("6.0", profileIUs, a1);
assertContains("7.0", profileIUs, b1);
assertContains("8.0", profileIUs, c1);
@@ -134,7 +134,7 @@ public class RollbackTest extends AbstractProvisioningTest {
status = director.revert(profile, revertProfile, new ProvisioningContext(), new NullProgressMonitor());
assertEquals("10.0", IStatus.OK, status.getCode());
- profileIUs = profile.query(InstallableUnitQuery.ANY, null);
+ profileIUs = profile.query(QueryUtil.createIUAnyQuery(), null);
assertContains("11.0", profileIUs, a1);
assertContains("12.0", profileIUs, b1);
assertNotContains("13.0", profileIUs, c1);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/UpdateTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/UpdateTest.java
index 673b6985e..bc582cb4c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/UpdateTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/UpdateTest.java
@@ -8,14 +8,14 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.director;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.IDirector;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class UpdateTest extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/TestRepositoryWatcher.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/TestRepositoryWatcher.java
index 19f92dfbd..6813f2f55 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/TestRepositoryWatcher.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/TestRepositoryWatcher.java
@@ -17,8 +17,8 @@ import org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryWat
import org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.eclipse.equinox.p2.tests.TestActivator;
@@ -63,7 +63,7 @@ class TestRepositoryWatcher extends DirectoryWatcher {
* Return the list of all the IUs known to the metadata repository this watcher's listener.
*/
public IInstallableUnit[] getInstallableUnits() {
- return listener.getMetadataRepository().query(InstallableUnitQuery.ANY, null).toArray(IInstallableUnit.class);
+ return listener.getMetadataRepository().query(QueryUtil.createIUAnyQuery(), null).toArray(IInstallableUnit.class);
}
/*
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/EngineTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/EngineTest.java
index 980065ba7..ff95fd7a1 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/EngineTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/EngineTest.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.engine;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.File;
import java.util.*;
import org.eclipse.core.runtime.*;
@@ -22,7 +24,6 @@ import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -382,14 +383,14 @@ public class EngineTest extends AbstractProvisioningTest {
plan.addInstallableUnit(iu33);
IStatus result = engine.perform(plan, new NullProgressMonitor());
assertTrue(result.isOK());
- Iterator ius = profile.query(new InstallableUnitQuery(iu33), null).iterator();
+ Iterator ius = profile.query(QueryUtil.createIUQuery(iu33), null).iterator();
assertTrue(ius.hasNext());
plan = engine.createPlan(profile, null);
plan.updateInstallableUnit(iu33, iu34);
result = engine.perform(plan, new NullProgressMonitor());
assertTrue(result.isOK());
- ius = profile.query(new InstallableUnitQuery(iu34), null).iterator();
+ ius = profile.query(QueryUtil.createIUQuery(iu34), null).iterator();
assertTrue(ius.hasNext());
}
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 21549899c..8d52ceebf 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,9 +10,6 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.engine;
-import org.eclipse.equinox.internal.p2.engine.InstallableUnitOperand;
-import org.eclipse.equinox.internal.p2.engine.Operand;
-
import java.io.File;
import java.io.IOException;
import java.util.*;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileMetadataRepositoryTest.java
index 7cac4e872..873f2133f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileMetadataRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileMetadataRepositoryTest.java
@@ -15,8 +15,8 @@ import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifact
import org.eclipse.equinox.internal.p2.engine.*;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.IProfile;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -55,7 +55,7 @@ public class ProfileMetadataRepositoryTest extends AbstractProvisioningTest {
IProfile profile = registry.getProfile("SDKPatchingTest");
assertNotNull("0.3", profile);
- IQueryResult profileCollector = profile.query(InstallableUnitQuery.ANY, getMonitor());
+ IQueryResult profileCollector = profile.query(QueryUtil.createIUAnyQuery(), getMonitor());
assertFalse("0.4", profileCollector.isEmpty());
File simpleProfileFolder = new File(tempFolder, "SDKPatchingTest.profile");
@@ -70,7 +70,7 @@ public class ProfileMetadataRepositoryTest extends AbstractProvisioningTest {
fail("0.99", e1);
}
- IQueryResult repoCollector = repo.query(InstallableUnitQuery.ANY, getMonitor());
+ IQueryResult repoCollector = repo.query(QueryUtil.createIUAnyQuery(), getMonitor());
assertFalse("1.0", repoCollector.isEmpty());
assertContains("1.1", repoCollector, profileCollector);
}
@@ -84,7 +84,7 @@ public class ProfileMetadataRepositoryTest extends AbstractProvisioningTest {
IProfile profile = registry.getProfile("SDKPatchingTest");
assertNotNull("0.3", profile);
- IQueryResult profileCollector = profile.query(InstallableUnitQuery.ANY, getMonitor());
+ IQueryResult profileCollector = profile.query(QueryUtil.createIUAnyQuery(), getMonitor());
assertFalse("0.4", profileCollector.isEmpty());
File simpleProfileFolder = new File(tempFolder, "SDKPatchingTest.profile");
@@ -102,7 +102,7 @@ public class ProfileMetadataRepositoryTest extends AbstractProvisioningTest {
fail("0.99", e1);
}
- IQueryResult repoCollector = repo.query(InstallableUnitQuery.ANY, getMonitor());
+ IQueryResult repoCollector = repo.query(QueryUtil.createIUAnyQuery(), getMonitor());
assertFalse("1.0", repoCollector.isEmpty());
assertContains("1.1", repoCollector, profileCollector);
}
@@ -124,7 +124,7 @@ public class ProfileMetadataRepositoryTest extends AbstractProvisioningTest {
IProfile profile = registry.getProfile("SDKPatchingTest");
assertNotNull("1.0", profile);
- IQueryResult profileCollector = profile.query(InstallableUnitQuery.ANY, getMonitor());
+ IQueryResult profileCollector = profile.query(QueryUtil.createIUAnyQuery(), getMonitor());
assertFalse("1.1", profileCollector.isEmpty());
File simpleProfileFolder = new File(profileRegistryFolder, "SDKPatchingTest.profile");
@@ -146,7 +146,7 @@ public class ProfileMetadataRepositoryTest extends AbstractProvisioningTest {
fail("2.99", e1);
}
- IQueryResult repoCollector = repo.query(InstallableUnitQuery.ANY, getMonitor());
+ IQueryResult repoCollector = repo.query(QueryUtil.createIUAnyQuery(), getMonitor());
assertFalse("3.0", repoCollector.isEmpty());
assertContains("3.1", repoCollector, profileCollector);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileRegistryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileRegistryTest.java
index 07df7e46c..30b72d14e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileRegistryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileRegistryTest.java
@@ -23,7 +23,7 @@ import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.eclipse.equinox.p2.tests.TestActivator;
@@ -133,21 +133,21 @@ public class ProfileRegistryTest extends AbstractProvisioningTest {
public void testIUPeristence() throws ProvisionException {
assertNull(registry.getProfile(PROFILE_NAME));
Profile profile = (Profile) registry.addProfile(PROFILE_NAME);
- assertTrue(profile.query(InstallableUnitQuery.ANY, null).isEmpty());
+ assertTrue(profile.query(QueryUtil.createIUAnyQuery(), null).isEmpty());
profile.addInstallableUnit(createIU("test"));
- assertEquals(1, queryResultSize(profile.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(1, queryResultSize(profile.query(QueryUtil.createIUAnyQuery(), null)));
saveProfile(registry, profile);
restart();
profile = (Profile) registry.getProfile(PROFILE_NAME);
- assertEquals(1, queryResultSize(profile.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(1, queryResultSize(profile.query(QueryUtil.createIUAnyQuery(), null)));
profile.removeInstallableUnit(createIU("test"));
- assertTrue(profile.query(InstallableUnitQuery.ANY, null).isEmpty());
+ assertTrue(profile.query(QueryUtil.createIUAnyQuery(), null).isEmpty());
saveProfile(registry, profile);
restart();
profile = (Profile) registry.getProfile(PROFILE_NAME);
- assertTrue(profile.query(InstallableUnitQuery.ANY, null).isEmpty());
+ assertTrue(profile.query(QueryUtil.createIUAnyQuery(), null).isEmpty());
registry.removeProfile(PROFILE_NAME);
restart();
assertNull(registry.getProfile(PROFILE_NAME));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java
index 61e3c9a81..4d5c9c80a 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java
@@ -22,7 +22,6 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.osgi.framework.BundleContext;
@@ -83,11 +82,11 @@ public class ProfileTest extends AbstractProvisioningTest {
IProfileRegistry registry = getProfileRegistry();
assertNull(registry.getProfile(PROFILE_NAME));
Profile profile = (Profile) registry.addProfile(PROFILE_NAME);
- assertTrue(profile.query(InstallableUnitQuery.ANY, null).isEmpty());
+ assertTrue(profile.query(QueryUtil.createIUAnyQuery(), null).isEmpty());
profile.addInstallableUnit(createIU("test"));
- assertEquals(1, queryResultSize(profile.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(1, queryResultSize(profile.query(QueryUtil.createIUAnyQuery(), null)));
profile.removeInstallableUnit(createIU("test"));
- assertTrue(profile.query(InstallableUnitQuery.ANY, null).isEmpty());
+ assertTrue(profile.query(QueryUtil.createIUAnyQuery(), null).isEmpty());
registry.removeProfile(PROFILE_NAME);
assertNull(registry.getProfile(PROFILE_NAME));
}
@@ -96,11 +95,11 @@ public class ProfileTest extends AbstractProvisioningTest {
IProfileRegistry registry = getProfileRegistry();
assertNull(registry.getProfile(PROFILE_NAME));
Profile profile = (Profile) registry.addProfile(PROFILE_NAME);
- assertTrue(profile.query(InstallableUnitQuery.ANY, null).isEmpty());
+ assertTrue(profile.query(QueryUtil.createIUAnyQuery(), null).isEmpty());
profile.addInstallableUnit(createIU("test"));
- assertEquals(1, queryResultSize(profile.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(1, queryResultSize(profile.query(QueryUtil.createIUAnyQuery(), null)));
profile.addInstallableUnit(createIU("test"));
- assertEquals(1, queryResultSize(profile.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(1, queryResultSize(profile.query(QueryUtil.createIUAnyQuery(), null)));
registry.removeProfile(PROFILE_NAME);
assertNull(registry.getProfile(PROFILE_NAME));
}
@@ -109,7 +108,7 @@ public class ProfileTest extends AbstractProvisioningTest {
IProfileRegistry registry = getProfileRegistry();
assertNull(registry.getProfile(PROFILE_NAME));
Profile profile = (Profile) registry.addProfile(PROFILE_NAME);
- assertTrue(profile.query(InstallableUnitQuery.ANY, null).isEmpty());
+ assertTrue(profile.query(QueryUtil.createIUAnyQuery(), null).isEmpty());
profile.addInstallableUnit(createIU("test"));
assertNull(profile.getInstallableUnitProperty(createIU("test"), "test"));
assertNull(profile.removeInstallableUnitProperty(createIU("test"), "test"));
@@ -119,7 +118,7 @@ public class ProfileTest extends AbstractProvisioningTest {
assertEquals("test", profile.getInstallableUnitProperty(createIU("test"), "test"));
profile.removeInstallableUnitProperty(createIU("test"), "test");
assertNull(profile.getInstallableUnitProperty(createIU("test"), "test"));
- assertEquals(1, queryResultSize(profile.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(1, queryResultSize(profile.query(QueryUtil.createIUAnyQuery(), null)));
registry.removeProfile(PROFILE_NAME);
assertNull(registry.getProfile(PROFILE_NAME));
}
@@ -128,9 +127,9 @@ public class ProfileTest extends AbstractProvisioningTest {
IProfileRegistry registry = getProfileRegistry();
assertNull(registry.getProfile(PROFILE_NAME));
Profile profile = (Profile) registry.addProfile(PROFILE_NAME);
- assertTrue(profile.available(InstallableUnitQuery.ANY, null).isEmpty());
+ assertTrue(profile.available(QueryUtil.createIUAnyQuery(), null).isEmpty());
profile.addInstallableUnit(createIU("test"));
- assertEquals(1, queryResultSize(profile.available(InstallableUnitQuery.ANY, null)));
+ assertEquals(1, queryResultSize(profile.available(QueryUtil.createIUAnyQuery(), null)));
profile.setSurrogateProfileHandler(new ISurrogateProfileHandler() {
public IProfile createProfile(String id) {
return null;
@@ -148,8 +147,8 @@ public class ProfileTest extends AbstractProvisioningTest {
return false;
}
});
- assertTrue(profile.available(InstallableUnitQuery.ANY, null).isEmpty());
- assertTrue(profile.snapshot().available(InstallableUnitQuery.ANY, null).isEmpty());
+ assertTrue(profile.available(QueryUtil.createIUAnyQuery(), null).isEmpty());
+ assertTrue(profile.snapshot().available(QueryUtil.createIUAnyQuery(), null).isEmpty());
registry.removeProfile(PROFILE_NAME);
assertNull(registry.getProfile(PROFILE_NAME));
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/SurrogateProfileHandlerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/SurrogateProfileHandlerTest.java
index e4d7b2262..a454357c9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/SurrogateProfileHandlerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/SurrogateProfileHandlerTest.java
@@ -17,7 +17,7 @@ import org.eclipse.equinox.internal.p2.engine.*;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SurrogateProfileHandlerTest extends AbstractProvisioningTest {
@@ -82,8 +82,8 @@ public class SurrogateProfileHandlerTest extends AbstractProvisioningTest {
saveProfile(registry, profile);
IProfile surrogateProfile = handler.createProfile(PROFILE_NAME);
assertTrue(handler.isSurrogate(surrogateProfile));
- assertEquals(0, queryResultSize(surrogateProfile.query(InstallableUnitQuery.ANY, null)));
- assertEquals(1, queryResultSize(surrogateProfile.available(InstallableUnitQuery.ANY, null)));
+ assertEquals(0, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
+ assertEquals(1, queryResultSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
}
public void testUpdateProfile() throws ProvisionException {
@@ -92,34 +92,34 @@ public class SurrogateProfileHandlerTest extends AbstractProvisioningTest {
profile.setInstallableUnitProperty(createIU("test"), PROP_TYPE_ROOT, Boolean.TRUE.toString());
saveProfile(registry, profile);
IProfile surrogateProfile = handler.createProfile(PROFILE_NAME);
- assertEquals(1, queryResultSize(surrogateProfile.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(1, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
// HashSet used here to eliminate duplicates
- assertEquals(1, queryResultUniqueSize(surrogateProfile.available(InstallableUnitQuery.ANY, null)));
+ assertEquals(1, queryResultUniqueSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
handler.updateProfile(surrogateProfile);
- assertEquals(1, queryResultSize(surrogateProfile.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(1, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
// HashSet used here to eliminate duplicates
- assertEquals(1, queryResultUniqueSize(surrogateProfile.available(InstallableUnitQuery.ANY, null)));
+ assertEquals(1, queryResultUniqueSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
Profile writeableSurrogateProfile = (Profile) surrogateProfile;
writeableSurrogateProfile.addInstallableUnit(createIU("surrogate.test"));
writeableSurrogateProfile.setInstallableUnitProperty(createIU("surrogate.test"), PROP_TYPE_ROOT, Boolean.TRUE.toString());
- assertEquals(2, queryResultSize(surrogateProfile.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(2, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
// HashSet used here to eliminate duplicates
- assertEquals(2, queryResultUniqueSize(surrogateProfile.available(InstallableUnitQuery.ANY, null)));
+ assertEquals(2, queryResultUniqueSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
profile.addInstallableUnit(createIU("test2"));
profile.setInstallableUnitProperty(createIU("test2"), PROP_TYPE_ROOT, Boolean.TRUE.toString());
saveProfile(registry, profile);
- assertEquals(2, queryResultSize(surrogateProfile.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(2, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
// HashSet used here to eliminate duplicates
- assertEquals(3, queryResultUniqueSize(surrogateProfile.available(InstallableUnitQuery.ANY, null)));
+ assertEquals(3, queryResultUniqueSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
//Strictly speaking this should not be necessary however without resetting the timestamp this test will sometimes fail
writeableSurrogateProfile.setProperty(PROP_SHARED_TIMESTAMP, null);
handler.updateProfile(surrogateProfile);
- assertEquals(3, queryResultSize(surrogateProfile.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(3, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
// HashSet used here to eliminate duplicates
- assertEquals(3, queryResultUniqueSize(surrogateProfile.available(InstallableUnitQuery.ANY, null)));
+ assertEquals(3, queryResultUniqueSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java
index e090fcc11..cd34c18c9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java
@@ -16,7 +16,7 @@ import java.net.*;
import org.eclipse.equinox.internal.p2.extensionlocation.Constants;
import org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationMetadataRepositoryFactory;
import org.eclipse.equinox.p2.core.ProvisionException;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.IRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -164,7 +164,7 @@ public class ExtensionLocationMetadataRepositoryFactoryTest extends AbstractProv
URI location = directory.toURI();
try {
IMetadataRepository repo = factory.load(location, 0, getMonitor());
- if (queryResultSize(repo.query(InstallableUnitQuery.ANY, null)) != 3)
+ if (queryResultSize(repo.query(QueryUtil.createIUAnyQuery(), null)) != 3)
fail("2.99");
} catch (ProvisionException ex) {
fail("2.0");
@@ -180,7 +180,7 @@ public class ExtensionLocationMetadataRepositoryFactoryTest extends AbstractProv
URI location = directory.toURI();
try {
IMetadataRepository repo = factory.load(location, 0, getMonitor());
- if (queryResultSize(repo.query(InstallableUnitQuery.ANY, null)) != 2)
+ if (queryResultSize(repo.query(QueryUtil.createIUAnyQuery(), null)) != 2)
fail("3.0");
} catch (ProvisionException ex) {
fail("2.0");
@@ -196,7 +196,7 @@ public class ExtensionLocationMetadataRepositoryFactoryTest extends AbstractProv
URI location = directory.toURI();
try {
IMetadataRepository repo = factory.load(location, 0, getMonitor());
- if (queryResultSize(repo.query(InstallableUnitQuery.ANY, null)) != 1)
+ if (queryResultSize(repo.query(QueryUtil.createIUAnyQuery(), null)) != 1)
fail("3.0");
} catch (ProvisionException ex) {
fail("2.0");
@@ -210,7 +210,7 @@ public class ExtensionLocationMetadataRepositoryFactoryTest extends AbstractProv
copy("1.0", getTestData("1.1", "/testData/extensionlocation"), eclipseDirectory);
try {
IMetadataRepository repo = factory.load(directory.toURI(), 0, getMonitor());
- if (queryResultSize(repo.query(InstallableUnitQuery.ANY, null)) != 3)
+ if (queryResultSize(repo.query(QueryUtil.createIUAnyQuery(), null)) != 3)
fail("3.0");
} catch (ProvisionException e) {
fail("2.0");
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/DirectorTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/DirectorTest.java
index 1e0516926..833be4d54 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/DirectorTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/DirectorTest.java
@@ -22,8 +22,8 @@ import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.VersionRange;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.eclipse.equinox.p2.tests.TestActivator;
@@ -52,7 +52,7 @@ public class DirectorTest extends AbstractProvisioningTest {
}
String autoInstall = System.getProperty("eclipse.p2.autoInstall");
- IQueryResult allJobs = mgr.query(new InstallableUnitQuery(autoInstall, VersionRange.emptyRange), null);
+ IQueryResult allJobs = mgr.query(QueryUtil.createIUQuery(autoInstall, VersionRange.emptyRange), null);
String installFolder = System.getProperty(IProfile.PROP_INSTALL_FOLDER);
IProfileRegistry profileRegistry = getProfileRegistry();
@@ -94,8 +94,8 @@ public class DirectorTest extends AbstractProvisioningTest {
if (!operationStatus.isOK())
fail("The installation has failed");
- IInstallableUnit[] result = (IInstallableUnit[]) p.query(new InstallableUnitQuery(allRoots[0].getId(), VersionRange.emptyRange), null).toArray(IInstallableUnit.class);
+ IInstallableUnit[] result = (IInstallableUnit[]) p.query(QueryUtil.createIUQuery(allRoots[0].getId(), VersionRange.emptyRange), null).toArray(IInstallableUnit.class);
assertEquals(result.length, (!doUninstall ? 1 : 0));
- result = (IInstallableUnit[]) p.query(new InstallableUnitQuery("toolingdefault", VersionRange.emptyRange), null).toArray(IInstallableUnit.class);
+ result = (IInstallableUnit[]) p.query(QueryUtil.createIUQuery("toolingdefault", VersionRange.emptyRange), null).toArray(IInstallableUnit.class);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/End2EndTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/End2EndTest.java
index 15369963a..9060ed095 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/End2EndTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/End2EndTest.java
@@ -26,8 +26,7 @@ import org.eclipse.equinox.p2.core.*;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
-import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -109,18 +108,18 @@ public class End2EndTest extends AbstractProvisioningTest {
}
private void attemptToUninstallRCP35(IProfile profile2, File installFolder) {
- IQueryResult collect = profile2.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult collect = profile2.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
assertEquals(1, queryResultSize(collect));
ProfileChangeRequest request = new ProfileChangeRequest(profile2);
request.removeInstallableUnits(new IInstallableUnit[] {(IInstallableUnit) collect.iterator().next()});
IStatus s = director.provision(request, null, new NullProgressMonitor());
assertOK("Can not uninstall RCP", s);
- assertEquals(1, queryResultSize(profile2.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor())));
+ assertEquals(1, queryResultSize(profile2.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor())));
}
protected void uninstallPlatform(IProfile profile2, File installFolder) {
System.out.println("Uninstall the platform");
- IQueryResult collect = profile2.query(new InstallableUnitQuery("org.eclipse.platform.ide"), new NullProgressMonitor());
+ IQueryResult collect = profile2.query(QueryUtil.createIUQuery("org.eclipse.platform.ide"), new NullProgressMonitor());
assertEquals(1, queryResultSize(collect));
// Collector collect2 = profile2.query(new InstallableUnitQuery("org.eclipse.platform.source.feature.group"), new Collector(), new NullProgressMonitor());
ProfileChangeRequest request = new ProfileChangeRequest(profile2);
@@ -200,7 +199,7 @@ public class End2EndTest extends AbstractProvisioningTest {
* not be found. Never returns null.
*/
public IInstallableUnit getIU(String id, Version v) {
- final InstallableUnitQuery query = new InstallableUnitQuery(id, v);
+ final IQuery<IInstallableUnit> query = QueryUtil.createIUQuery(id, v);
Iterator it = metadataRepoManager.query(query, null).iterator();
if (it.hasNext())
return (IInstallableUnit) it.next();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/RepoValidator.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/RepoValidator.java
index 56c618143..68a54ce1c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/RepoValidator.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/RepoValidator.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.full;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
@@ -21,9 +19,8 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.ProvisioningContext;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
-import org.eclipse.equinox.p2.query.IQuery;
-import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -56,7 +53,7 @@ public class RepoValidator extends AbstractProvisioningTest {
IQuery q;
- q = new InstallableUnitQuery("org.eclipse.rcp.feature.group");
+ q = QueryUtil.createIUQuery("org.eclipse.rcp.feature.group");
// q = InstallableUnitQuery.ANY;
IQueryResult iusToTest = validatedRepo.query(q, null);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/EclipseSDK33Test.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/EclipseSDK33Test.java
index 93c9a46f5..321a07ddf 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/EclipseSDK33Test.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/EclipseSDK33Test.java
@@ -20,7 +20,7 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.equinox.internal.provisional.p2.metadata.generator.Generator;
import org.eclipse.equinox.internal.provisional.p2.metadata.generator.IGeneratorInfo;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.GroupQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
import org.eclipse.equinox.p2.tests.*;
import org.osgi.framework.Bundle;
@@ -95,7 +95,7 @@ public class EclipseSDK33Test extends AbstractProvisioningTest {
* Asserts that the given IU represents a group.
*/
private void assertGroup(IInstallableUnit unit) {
- assertEquals("IU is not a group", Boolean.TRUE.toString(), GroupQuery.isGroup(unit));
+ assertEquals("IU is not a group", Boolean.TRUE.toString(), QueryUtil.isGroup(unit));
}
private IGeneratorInfo createGeneratorInfo() {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/PatchIUGeneration.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/PatchIUGeneration.java
index 95ef9ed92..4b9793119 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/PatchIUGeneration.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/PatchIUGeneration.java
@@ -8,13 +8,14 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.generator;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import junit.framework.TestCase;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.p2.metadata.generator.features.FeatureParser;
import org.eclipse.equinox.internal.provisional.p2.metadata.generator.Feature;
import org.eclipse.equinox.internal.provisional.p2.metadata.generator.MetadataGeneratorHelper;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.PatchQuery;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchIUGeneration extends AbstractProvisioningTest {
@@ -39,7 +40,7 @@ public class PatchIUGeneration extends AbstractProvisioningTest {
assertEquals(VersionRange.emptyRange, patchIU.getRequirementsChange().get(0).applyOn().getRange());
assertEquals("org.eclipse.jdt.core", patchIU.getRequirementsChange().get(0).newValue().getName());
assertEquals(new VersionRange("[3.2.2,3.2.2]"), patchIU.getRequirementsChange().get(0).newValue().getRange());
- assertTrue(PatchQuery.isPatch(patchIU));
+ assertTrue(QueryUtil.isPatch(patchIU));
assertEquals(1, patchIU.getRequiredCapabilities().size());
assertEquals(featureIU.getId(), ((IRequiredCapability) patchIU.getRequiredCapabilities().iterator().next()).getName());
assertEquals("org.eclipse.jdt.feature.group", ((IRequiredCapability) patchIU.getLifeCycle()).getName());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/FragmentTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/FragmentTest.java
index e51f887e5..cfe1f378f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/FragmentTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/FragmentTest.java
@@ -15,8 +15,7 @@ import junit.framework.AssertionFailedError;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.FragmentQuery;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class FragmentTest extends AbstractProvisioningTest {
@@ -27,7 +26,7 @@ public class FragmentTest extends AbstractProvisioningTest {
IInstallableUnit iu2 = createBundleFragment("iuFragment.test1");
ProfileChangeRequest req = new ProfileChangeRequest(createProfile(getName()));
createTestMetdataRepository(new IInstallableUnit[] {iu1, iu2});
- Iterator iterator = createPlanner().getProvisioningPlan(req, null, null).getAdditions().query(InstallableUnitQuery.ANY, null).iterator();
+ Iterator iterator = createPlanner().getProvisioningPlan(req, null, null).getAdditions().query(QueryUtil.createIUAnyQuery(), null).iterator();
// ResolutionHelper rh = new ResolutionHelper(new Hashtable(), null);
// HashSet set = new HashSet();
// set.add(iu1);
@@ -50,7 +49,7 @@ public class FragmentTest extends AbstractProvisioningTest {
IInstallableUnit iu2 = createBundleFragment("iuFragment.test1");
ProfileChangeRequest req = new ProfileChangeRequest(createProfile(getName()));
createTestMetdataRepository(new IInstallableUnit[] {iu1, iu2, iu3});
- Iterator iterator = createPlanner().getProvisioningPlan(req, null, null).getAdditions().query(InstallableUnitQuery.ANY, null).iterator();
+ Iterator iterator = createPlanner().getProvisioningPlan(req, null, null).getAdditions().query(QueryUtil.createIUAnyQuery(), null).iterator();
for (; iterator.hasNext();) {
IInstallableUnit iu = (IInstallableUnit) iterator.next();
if (iu.getId().equals(ID1)) {
@@ -71,7 +70,7 @@ public class FragmentTest extends AbstractProvisioningTest {
IInstallableUnit iu2 = createBundleFragment("iuFragment.test1");
ProfileChangeRequest req = new ProfileChangeRequest(createProfile(getName()));
createTestMetdataRepository(new IInstallableUnit[] {iu1, iu2});
- Iterator iterator = createPlanner().getProvisioningPlan(req, null, null).getAdditions().query(InstallableUnitQuery.ANY, null).iterator();
+ Iterator iterator = createPlanner().getProvisioningPlan(req, null, null).getAdditions().query(QueryUtil.createIUAnyQuery(), null).iterator();
for (; iterator.hasNext();) {
IInstallableUnit iu = (IInstallableUnit) iterator.next();
if (iu.getId().equals(iu1.getId()))
@@ -82,7 +81,7 @@ public class FragmentTest extends AbstractProvisioningTest {
public void testFragmentCapability() {
IInstallableUnit iu = createBundleFragment("iuFragment.test1");
- assertTrue(FragmentQuery.isFragment(iu));
+ assertTrue(QueryUtil.isFragment(iu));
}
public void testDefaultIUCapability() {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/LatestIUTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/LatestIUTest.java
index 8ad4c9ab0..97f752f3c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/LatestIUTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/LatestIUTest.java
@@ -10,10 +10,10 @@
package org.eclipse.equinox.p2.tests.metadata;
import java.net.URI;
-import org.eclipse.equinox.internal.p2.metadata.query.LatestIUVersionQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.eclipse.equinox.p2.tests.TestData;
@@ -34,7 +34,7 @@ public class LatestIUTest extends AbstractProvisioningTest {
IMetadataRepositoryManager metadataRepositoryManager = getMetadataRepositoryManager();
metadataRepositoryManager.addRepository(location);
- IQueryResult query = metadataRepositoryManager.query(new LatestIUVersionQuery(), null);
+ IQueryResult query = metadataRepositoryManager.query(QueryUtil.createLatestIUQuery(), null);
assertEquals("1.0", 1, queryResultSize(query));
assertEquals("1.1", Version.createOSGi(2, 1, 0), ((IInstallableUnit) query.iterator().next()).getVersion());
}
@@ -50,7 +50,7 @@ public class LatestIUTest extends AbstractProvisioningTest {
IMetadataRepositoryManager metadataRepositoryManager = getMetadataRepositoryManager();
metadataRepositoryManager.addRepository(location);
- IQueryResult query = metadataRepositoryManager.query(new LatestIUVersionQuery(), null);
+ IQueryResult query = metadataRepositoryManager.query(QueryUtil.createLatestIUQuery(), null);
assertEquals("1.0", 1, queryResultSize(query));
assertEquals("1.1", Version.createOSGi(3, 0, 0), ((IInstallableUnit) query.iterator().next()).getVersion());
}
@@ -69,7 +69,7 @@ public class LatestIUTest extends AbstractProvisioningTest {
metadataRepositoryManager.addRepository(location1);
metadataRepositoryManager.addRepository(location2);
- IQueryResult queryResult = metadataRepositoryManager.query(new LatestIUVersionQuery(), null);
+ IQueryResult queryResult = metadataRepositoryManager.query(QueryUtil.createLatestIUQuery(), null);
assertEquals("1.0", 1, queryResultSize(queryResult));
assertEquals("1.1", Version.createOSGi(3, 0, 0), ((IInstallableUnit) queryResult.iterator().next()).getVersion());
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/MultipleIUAndFragmentTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/MultipleIUAndFragmentTest.java
index b2d74c2f8..62ee765e3 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/MultipleIUAndFragmentTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/MultipleIUAndFragmentTest.java
@@ -17,7 +17,7 @@ import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.VersionRange;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class MultipleIUAndFragmentTest extends AbstractProvisioningTest {
@@ -40,7 +40,7 @@ public class MultipleIUAndFragmentTest extends AbstractProvisioningTest {
iu3 = createBundleFragment("fragment");
ProfileChangeRequest req = new ProfileChangeRequest(createProfile(getName()));
createTestMetdataRepository(new IInstallableUnit[] {iu1, iu2, iu3});
- Iterator iterator = createPlanner().getProvisioningPlan(req, null, null).getAdditions().query(InstallableUnitQuery.ANY, null).iterator();
+ Iterator iterator = createPlanner().getProvisioningPlan(req, null, null).getAdditions().query(QueryUtil.createIUAnyQuery(), null).iterator();
for (; iterator.hasNext();) {
IInstallableUnit iu = (IInstallableUnit) iterator.next();
if (iu.getId().equals(iu1.getId())) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java
index 165583051..b66c800ed 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java
@@ -12,15 +12,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.metadata.repository;
-import org.eclipse.equinox.internal.p2.metadata.query.MatchQuery;
-
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.p2.metadata.query.LatestIUVersionQuery;
+import org.eclipse.equinox.internal.p2.metadata.query.MatchQuery;
import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository;
import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepositoryFactory;
import org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryState;
@@ -29,7 +27,6 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.Inst
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -120,7 +117,7 @@ public class CompositeMetadataRepositoryTest extends AbstractProvisioningTest {
//Try to remove an InstallableUnit.
try {
- IQueryResult queryResult = compRepo.query(InstallableUnitQuery.ANY, null);
+ IQueryResult queryResult = compRepo.query(QueryUtil.createIUAnyQuery(), null);
compRepo.removeInstallableUnits(queryResult.toSet());
fail("Should not be able to remove InstallableUnit");
} catch (UnsupportedOperationException e) {
@@ -270,7 +267,7 @@ public class CompositeMetadataRepositoryTest extends AbstractProvisioningTest {
assertContains("Assert child1's content is in composite repo", repo1, compRepo);
assertContains("Assert child2's content is in composite repo", repo2, compRepo);
//checks that the destination has the correct number of keys (no extras)
- assertEquals("Assert correct number of IUs", getNumUnique(repo1.query(InstallableUnitQuery.ANY, null), repo2.query(InstallableUnitQuery.ANY, null)), queryResultSize(compRepo.query(InstallableUnitQuery.ANY, null)));
+ assertEquals("Assert correct number of IUs", getNumUnique(repo1.query(QueryUtil.createIUAnyQuery(), null), repo2.query(QueryUtil.createIUAnyQuery(), null)), queryResultSize(compRepo.query(QueryUtil.createIUAnyQuery(), null)));
}
public void testRemoveNonexistantChild() {
@@ -429,7 +426,7 @@ public class CompositeMetadataRepositoryTest extends AbstractProvisioningTest {
compRepo.addChild(repo2Location.toURI());
//force composite repository to load all children
- compRepo.query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ compRepo.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor());
assertTrue("Ensuring previously loaded repo is enabled", getMetadataRepositoryManager().isEnabled(repo1Location.toURI()));
String repo1System = getMetadataRepositoryManager().getRepositoryProperty(repo1Location.toURI(), IRepository.PROP_SYSTEM);
@@ -455,7 +452,7 @@ public class CompositeMetadataRepositoryTest extends AbstractProvisioningTest {
CompositeMetadataRepository compositeRepo = createRepo(false);
compositeRepo.addChild(location1);
compositeRepo.addChild(location2);
- IQueryResult queryResult = compositeRepo.query(new LatestIUVersionQuery(), monitor);
+ IQueryResult queryResult = compositeRepo.query(QueryUtil.createLatestIUQuery(), monitor);
assertEquals("1.0", 1, queryResultSize(queryResult));
assertEquals("1.1", Version.createOSGi(3, 0, 0), ((IInstallableUnit) queryResult.iterator().next()).getVersion());
assertTrue("1.2", monitor.isDone());
@@ -476,7 +473,7 @@ public class CompositeMetadataRepositoryTest extends AbstractProvisioningTest {
CompositeMetadataRepository compositeRepo = createRepo(false);
compositeRepo.addChild(location1);
compositeRepo.addChild(location2);
- IQuery cQuery = new LatestIUVersionQuery(new MatchQuery() {
+ IQuery cQuery = QueryUtil.createLatestQuery(new MatchQuery() {
public boolean isMatch(Object candidate) {
if (candidate instanceof IInstallableUnit) {
IInstallableUnit iInstallableUnit = (IInstallableUnit) candidate;
@@ -532,7 +529,7 @@ public class CompositeMetadataRepositoryTest extends AbstractProvisioningTest {
assertContains("Assert child1's content is in composite repo", repo1, compRepo);
assertContains("Assert child2's content is in composite repo", repo2, compRepo);
//checks that the destination has the correct number of keys (no extras)
- assertEquals("Assert correct number of IUs", getNumUnique(repo1.query(InstallableUnitQuery.ANY, null), repo2.query(InstallableUnitQuery.ANY, null)), queryResultSize(compRepo.query(InstallableUnitQuery.ANY, null)));
+ assertEquals("Assert correct number of IUs", getNumUnique(repo1.query(QueryUtil.createIUAnyQuery(), null), repo2.query(QueryUtil.createIUAnyQuery(), null)), queryResultSize(compRepo.query(QueryUtil.createIUAnyQuery(), null)));
}
private CompositeMetadataRepository createRepo(boolean compressed) {
@@ -630,7 +627,7 @@ public class CompositeMetadataRepositoryTest extends AbstractProvisioningTest {
// query the number of IUs
List children = repository.getChildren();
assertEquals("2.0", 2, children.size());
- IQueryResult queryResult = repository.query(InstallableUnitQuery.ANY, getMonitor());
+ IQueryResult queryResult = repository.query(QueryUtil.createIUAnyQuery(), getMonitor());
assertEquals("2.1", 2, queryResultSize(queryResult));
// ensure the child URIs are stored as relative
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLMetadataRepositoryTest.java
index 1347978f0..88c045bf5 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLMetadataRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLMetadataRepositoryTest.java
@@ -21,7 +21,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.Inst
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.IRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -77,7 +77,7 @@ public class JarURLMetadataRepositoryTest extends AbstractProvisioningTest {
}
IMetadataRepository repo = manager.loadRepository(jarRepoLocation, null);
- assertTrue(!repo.query(InstallableUnitQuery.ANY, null).isEmpty());
+ assertTrue(!repo.query(QueryUtil.createIUAnyQuery(), null).isEmpty());
URI[] local = manager.getKnownRepositories(IRepositoryManager.REPOSITORIES_LOCAL);
boolean found = false;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java
index e2482b192..edf39631a 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java
@@ -21,8 +21,8 @@ import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -123,10 +123,10 @@ public class LocalMetadataRepositoryTest extends AbstractProvisioningTest {
IMetadataRepository repo = manager.createRepository(repoLocation.toURI(), "TestRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
IInstallableUnit iu = createIU("foo");
repo.addInstallableUnits(Arrays.asList(iu));
- IQueryResult result = repo.query(new InstallableUnitQuery((String) null), getMonitor());
+ IQueryResult result = repo.query(QueryUtil.createIUQuery((String) null), getMonitor());
assertEquals("1.0", 1, queryResultSize(result));
repo.removeAll();
- result = repo.query(new InstallableUnitQuery((String) null), getMonitor());
+ result = repo.query(QueryUtil.createIUQuery((String) null), getMonitor());
assertTrue("1.1", result.isEmpty());
}
@@ -136,13 +136,13 @@ public class LocalMetadataRepositoryTest extends AbstractProvisioningTest {
IInstallableUnit iu = createIU("foo");
IInstallableUnit iu2 = createIU("bar");
repo.addInstallableUnits(Arrays.asList(iu, iu2));
- IQueryResult result = repo.query(new InstallableUnitQuery((String) null), getMonitor());
+ IQueryResult result = repo.query(QueryUtil.createIUQuery((String) null), getMonitor());
assertEquals("1.0", 2, queryResultSize(result));
repo.removeInstallableUnits(Arrays.asList(iu));
- result = repo.query(new InstallableUnitQuery((String) null), getMonitor());
+ result = repo.query(QueryUtil.createIUQuery((String) null), getMonitor());
assertEquals("1.1", 1, queryResultSize(result));
repo.removeInstallableUnits(Arrays.asList(iu2));
- result = repo.query(new InstallableUnitQuery((String) null), getMonitor());
+ result = repo.query(QueryUtil.createIUQuery((String) null), getMonitor());
assertTrue("1.2", result.isEmpty());
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java
index 0a1489eb9..b3becf8f2 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java
@@ -29,8 +29,8 @@ import org.eclipse.equinox.internal.provisional.p2.core.eventbus.SynchronousProv
import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent;
import org.eclipse.equinox.p2.core.IAgentLocation;
import org.eclipse.equinox.p2.core.ProvisionException;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.IRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -410,7 +410,7 @@ public class MetadataRepositoryManagerTest extends AbstractProvisioningTest {
URI location = site.toURI();
try {
IMetadataRepository repository = manager.loadRepository(location, getMonitor());
- IQueryResult result = repository.query(new InstallableUnitQuery("test.bundle"), getMonitor());
+ IQueryResult result = repository.query(QueryUtil.createIUQuery("test.bundle"), getMonitor());
assertEquals("1.0", 1, queryResultSize(result));
} catch (ProvisionException e) {
fail("=.99", e);
@@ -539,7 +539,7 @@ public class MetadataRepositoryManagerTest extends AbstractProvisioningTest {
public void testReadableFilter() throws ProvisionException {
File site = getTestData("readable", "/testData/metadataRepo/badFilter/readable");
IMetadataRepository loadRepository = manager.loadRepository(site.toURI(), null);
- assertEquals(1, loadRepository.query(InstallableUnitQuery.ANY, null).toSet().size());
+ assertEquals(1, loadRepository.query(QueryUtil.createIUAnyQuery(), null).toSet().size());
}
public void testUnreadableFailingFilter() throws ProvisionException {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java
index 5bb652fff..da5b48873 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java
@@ -10,8 +10,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.metadata.repository;
-import org.eclipse.equinox.internal.p2.metadata.query.MatchQuery;
-
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
@@ -23,6 +21,7 @@ import java.util.*;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.internal.p2.metadata.*;
+import org.eclipse.equinox.internal.p2.metadata.query.MatchQuery;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitPatchDescription;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java
index 7e46b7318..b6e684c52 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java
@@ -18,8 +18,8 @@ import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepo
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -362,7 +362,7 @@ public class MetadataMirrorApplicationTest extends AbstractProvisioningTest {
assertContains("5.1", getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null), getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null));
assertContains("5.2", getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null), getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null));
//checks that the destination has the correct number of keys (no extras)
- assertEquals("5.3", getNumUnique(getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null).query(InstallableUnitQuery.ANY, null), getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null).query(InstallableUnitQuery.ANY, null)), queryResultSize(getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null).query(InstallableUnitQuery.ANY, null)));
+ assertEquals("5.3", getNumUnique(getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null).query(QueryUtil.createIUAnyQuery(), null), getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null).query(QueryUtil.createIUAnyQuery(), null)), queryResultSize(getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null).query(QueryUtil.createIUAnyQuery(), null)));
} catch (ProvisionException e) {
fail("5.4", e);
}
@@ -467,7 +467,7 @@ public class MetadataMirrorApplicationTest extends AbstractProvisioningTest {
assertContains("11.1", getMetadataRepositoryManager().loadRepository(sourceRepo3Location.toURI(), null), getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null));
assertContains("11.2", getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null), getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null));
//checks that the destination has the correct number of keys (no extras)
- assertEquals("11.3", getNumUnique(getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null).query(InstallableUnitQuery.ANY, null), getMetadataRepositoryManager().loadRepository(sourceRepo3Location.toURI(), null).query(InstallableUnitQuery.ANY, null)), queryResultSize(getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null).query(InstallableUnitQuery.ANY, null)));
+ assertEquals("11.3", getNumUnique(getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null).query(QueryUtil.createIUAnyQuery(), null), getMetadataRepositoryManager().loadRepository(sourceRepo3Location.toURI(), null).query(QueryUtil.createIUAnyQuery(), null)), queryResultSize(getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null).query(QueryUtil.createIUAnyQuery(), null)));
} catch (ProvisionException e) {
fail("11.4", e);
}
@@ -652,7 +652,7 @@ public class MetadataMirrorApplicationTest extends AbstractProvisioningTest {
assertContains("20.2", getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null), getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null));
assertContains("20.3", getMetadataRepositoryManager().loadRepository(sourceRepo4Location.toURI(), null), getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null));
//checks that the destination has the correct number of keys (no extras)
- assertEquals("20.4", getNumUnique(getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null).query(InstallableUnitQuery.ANY, null), getMetadataRepositoryManager().loadRepository(sourceRepo4Location.toURI(), null).query(InstallableUnitQuery.ANY, null)), queryResultSize(getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null).query(InstallableUnitQuery.ANY, null)));
+ assertEquals("20.4", getNumUnique(getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null).query(QueryUtil.createIUAnyQuery(), null), getMetadataRepositoryManager().loadRepository(sourceRepo4Location.toURI(), null).query(QueryUtil.createIUAnyQuery(), null)), queryResultSize(getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null).query(QueryUtil.createIUAnyQuery(), null)));
} catch (ProvisionException e) {
fail("20.5", e);
}
@@ -938,7 +938,7 @@ public class MetadataMirrorApplicationTest extends AbstractProvisioningTest {
assertContains("3", getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null), getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null));
assertContains("4", getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null), getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null));
//checks that the destination has the correct number of keys (no extras)
- assertEquals("5", getNumUnique(getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null).query(InstallableUnitQuery.ANY, null), getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null).query(InstallableUnitQuery.ANY, null)), queryResultSize(getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null).query(InstallableUnitQuery.ANY, null)));
+ assertEquals("5", getNumUnique(getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null).query(QueryUtil.createIUAnyQuery(), null), getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null).query(QueryUtil.createIUAnyQuery(), null)), queryResultSize(getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null).query(QueryUtil.createIUAnyQuery(), null)));
} catch (ProvisionException e) {
fail("Could not load destination", e);
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationMetadataTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationMetadataTest.java
index 8baac04e3..26f12d015 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationMetadataTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationMetadataTest.java
@@ -20,8 +20,8 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication;
import org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -394,7 +394,7 @@ public class NewMirrorApplicationMetadataTest extends AbstractProvisioningTest {
assertContains("5.1", getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null), getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null));
assertContains("5.2", getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null), getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null));
//checks that the destination has the correct number of keys (no extras)
- assertEquals("5.3", getNumUnique(getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null).query(InstallableUnitQuery.ANY, null), getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null).query(InstallableUnitQuery.ANY, null)), queryResultSize(getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null).query(InstallableUnitQuery.ANY, null)));
+ assertEquals("5.3", getNumUnique(getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null).query(QueryUtil.createIUAnyQuery(), null), getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null).query(QueryUtil.createIUAnyQuery(), null)), queryResultSize(getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null).query(QueryUtil.createIUAnyQuery(), null)));
} catch (ProvisionException e) {
fail("5.4", e);
}
@@ -499,7 +499,7 @@ public class NewMirrorApplicationMetadataTest extends AbstractProvisioningTest {
assertContains("11.1", getMetadataRepositoryManager().loadRepository(sourceRepo3Location.toURI(), null), getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null));
assertContains("11.2", getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null), getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null));
//checks that the destination has the correct number of keys (no extras)
- assertEquals("11.3", getNumUnique(getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null).query(InstallableUnitQuery.ANY, null), getMetadataRepositoryManager().loadRepository(sourceRepo3Location.toURI(), null).query(InstallableUnitQuery.ANY, null)), queryResultSize(getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null).query(InstallableUnitQuery.ANY, null)));
+ assertEquals("11.3", getNumUnique(getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null).query(QueryUtil.createIUAnyQuery(), null), getMetadataRepositoryManager().loadRepository(sourceRepo3Location.toURI(), null).query(QueryUtil.createIUAnyQuery(), null)), queryResultSize(getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null).query(QueryUtil.createIUAnyQuery(), null)));
} catch (ProvisionException e) {
fail("11.4", e);
}
@@ -704,7 +704,7 @@ public class NewMirrorApplicationMetadataTest extends AbstractProvisioningTest {
assertContains("20.2", getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null), getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null));
assertContains("20.3", getMetadataRepositoryManager().loadRepository(sourceRepo4Location.toURI(), null), getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null));
//checks that the destination has the correct number of keys (no extras)
- assertEquals("20.4", getNumUnique(getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null).query(InstallableUnitQuery.ANY, null), getMetadataRepositoryManager().loadRepository(sourceRepo4Location.toURI(), null).query(InstallableUnitQuery.ANY, null)), queryResultSize(getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null).query(InstallableUnitQuery.ANY, null)));
+ assertEquals("20.4", getNumUnique(getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null).query(QueryUtil.createIUAnyQuery(), null), getMetadataRepositoryManager().loadRepository(sourceRepo4Location.toURI(), null).query(QueryUtil.createIUAnyQuery(), null)), queryResultSize(getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null).query(QueryUtil.createIUAnyQuery(), null)));
} catch (ProvisionException e) {
fail("20.5", e);
}
@@ -959,7 +959,7 @@ public class NewMirrorApplicationMetadataTest extends AbstractProvisioningTest {
assertContains("3", getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null), getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null));
assertContains("4", getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null), getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null));
//checks that the destination has the correct number of keys (no extras)
- assertEquals("5", getNumUnique(getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null).query(InstallableUnitQuery.ANY, null), getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null).query(InstallableUnitQuery.ANY, null)), queryResultSize(getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null).query(InstallableUnitQuery.ANY, null)));
+ assertEquals("5", getNumUnique(getMetadataRepositoryManager().loadRepository(sourceRepoLocation.toURI(), null).query(QueryUtil.createIUAnyQuery(), null), getMetadataRepositoryManager().loadRepository(sourceRepo2Location.toURI(), null).query(QueryUtil.createIUAnyQuery(), null)), queryResultSize(getMetadataRepositoryManager().loadRepository(destRepoLocation.toURI(), null).query(QueryUtil.createIUAnyQuery(), null)));
} catch (ProvisionException e) {
fail("Could not load destination", e);
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/MetadataRepositoryPerformanceTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/MetadataRepositoryPerformanceTest.java
index 5301913b5..a98020b1a 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/MetadataRepositoryPerformanceTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/MetadataRepositoryPerformanceTest.java
@@ -15,8 +15,8 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.tests.harness.PerformanceTestRunner;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -53,7 +53,7 @@ public class MetadataRepositoryPerformanceTest extends ProvisioningPerformanceTe
List<IInstallableUnit> ius = new ArrayList(IU_COUNT);
for (int i = 0; i < IU_COUNT; i++) {
IInstallableUnit iu = generateIU(i);
- queries[i] = new InstallableUnitQuery(iu.getId(), iu.getVersion());
+ queries[i] = QueryUtil.createIUQuery(iu.getId(), iu.getVersion());
ius.add(iu);
}
repository.addInstallableUnits(ius);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/PublisherPerformanceTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/PublisherPerformanceTest.java
index 5f57de535..646a1afd9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/PublisherPerformanceTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/PublisherPerformanceTest.java
@@ -12,11 +12,10 @@ package org.eclipse.equinox.p2.tests.perf;
import org.eclipse.core.tests.harness.PerformanceTestRunner;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.publisher.IPublisherResult;
import org.eclipse.equinox.p2.publisher.PublisherResult;
import org.eclipse.equinox.p2.query.IQuery;
-import org.eclipse.equinox.p2.query.LimitQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
/**
* Performance tests for the p2 publisher
@@ -36,7 +35,7 @@ public class PublisherPerformanceTest extends ProvisioningPerformanceTest {
for (int i = 0; i < ius.length; i++) {
ius[i] = generateIU(i);
result.addIU(ius[i], IPublisherResult.ROOT);
- queries[i] = new InstallableUnitQuery(ius[i].getId(), ius[i].getVersion());
+ queries[i] = QueryUtil.createIUQuery(ius[i].getId(), ius[i].getVersion());
}
}
@@ -63,7 +62,7 @@ public class PublisherPerformanceTest extends ProvisioningPerformanceTest {
for (int i = 0; i < ius.length; i++) {
ius[i] = generateIU(i);
result.addIU(ius[i], IPublisherResult.ROOT);
- queries[i] = new LimitQuery(new InstallableUnitQuery(ius[i].getId(), ius[i].getVersion()), 1);
+ queries[i] = QueryUtil.createLimitQuery(QueryUtil.createIUQuery(ius[i].getId(), ius[i].getVersion()), 1);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AbsolutePlanTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AbsolutePlanTest.java
index 2711d092a..a28b3a341 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AbsolutePlanTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AbsolutePlanTest.java
@@ -1,10 +1,6 @@
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.internal.p2.engine.InstallableUnitPropertyOperand;
-import org.eclipse.equinox.internal.p2.engine.Operand;
-
+import org.eclipse.equinox.internal.p2.engine.*;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AbstractPlannerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AbstractPlannerTest.java
index 1ca38c4fe..bf90740ff 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AbstractPlannerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AbstractPlannerTest.java
@@ -10,16 +10,11 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.internal.p2.engine.InstallableUnitOperand;
-import org.eclipse.equinox.internal.p2.engine.Operand;
-
import java.io.File;
import java.lang.reflect.Field;
import java.util.Collection;
import java.util.Iterator;
-import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
+import org.eclipse.equinox.internal.p2.engine.*;
import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ActualChangeRequestTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ActualChangeRequestTest.java
index 81e6ec145..88021ef39 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ActualChangeRequestTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ActualChangeRequestTest.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.Map;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
@@ -19,7 +17,8 @@ import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class ActualChangeRequestTest extends AbstractProvisioningTest {
@@ -54,7 +53,7 @@ public class ActualChangeRequestTest extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan.getStatus().getSeverity());
engine.perform(plan, null);
assertProfileContainsAll("B is missing", profile1, new IInstallableUnit[] {b});
- assertEquals(1, queryResultSize(profile1.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(1, queryResultSize(profile1.query(QueryUtil.createIUAnyQuery(), null)));
//Install A
ProfileChangeRequest req2 = new ProfileChangeRequest(profile1);
@@ -69,7 +68,7 @@ public class ActualChangeRequestTest extends AbstractProvisioningTest {
assertEquals(IStatus.OK, ((PlannerStatus) plan2.getStatus()).getRequestChanges().get(a).getSeverity());
engine.perform(plan2, null);
assertProfileContainsAll("A is missing", profile1, new IInstallableUnit[] {a, b});
- assertEquals(2, queryResultSize(profile1.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(2, queryResultSize(profile1.query(QueryUtil.createIUAnyQuery(), null)));
//Uninstall B
ProfileChangeRequest req3 = new ProfileChangeRequest(profile1);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ActualChangeRequestTest2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ActualChangeRequestTest2.java
index 5967c0fc2..047e2fa86 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ActualChangeRequestTest2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ActualChangeRequestTest2.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.Map;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
@@ -19,7 +17,8 @@ import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class ActualChangeRequestTest2 extends AbstractProvisioningTest {
@@ -58,7 +57,7 @@ public class ActualChangeRequestTest2 extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan.getStatus().getSeverity());
engine.perform(plan, null);
assertProfileContainsAll("B is missing", profile1, new IInstallableUnit[] {a, b});
- assertEquals(2, queryResultSize(profile1.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(2, queryResultSize(profile1.query(QueryUtil.createIUAnyQuery(), null)));
//Install B2
ProfileChangeRequest req2 = new ProfileChangeRequest(profile1);
@@ -76,7 +75,7 @@ public class ActualChangeRequestTest2 extends AbstractProvisioningTest {
assertEquals(RequestStatus.REMOVED, m.get(a).getInitialRequestType());
engine.perform(plan2, null);
assertProfileContainsAll("A is missing", profile1, new IInstallableUnit[] {b2});
- assertEquals(1, queryResultSize(profile1.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(1, queryResultSize(profile1.query(QueryUtil.createIUAnyQuery(), null)));
//Try to Install A
ProfileChangeRequest req3 = new ProfileChangeRequest(profile1);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AddIUProperty.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AddIUProperty.java
index faac57f10..f7e71d6ec 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AddIUProperty.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AddIUProperty.java
@@ -8,17 +8,17 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.director.SimplePlanner;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class AddIUProperty extends AbstractProvisioningTest {
@@ -66,7 +66,7 @@ public class AddIUProperty extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan.getStatus().getSeverity());
engine.perform(plan, null);
assertProfileContainsAll("A1 is missing", profile, new IInstallableUnit[] {a1});
- IQueryResult allProfileIUs = profile.query(InstallableUnitQuery.ANY, null);
+ IQueryResult allProfileIUs = profile.query(QueryUtil.createIUAnyQuery(), null);
assertEquals(queryResultSize(allProfileIUs), 1);
//Add a2 with a1. This is an error
@@ -86,7 +86,7 @@ public class AddIUProperty extends AbstractProvisioningTest {
engine.perform(plan2, null);
profile = getProfile(profile.getProfileId());
assertProfileContainsAll("A2 is missing", profile, new IInstallableUnit[] {a2});
- allProfileIUs = profile.query(InstallableUnitQuery.ANY, null);
+ allProfileIUs = profile.query(QueryUtil.createIUAnyQuery(), null);
assertEquals(queryResultSize(allProfileIUs), 1);
IQueryResult iuProfileProperties = profile.query(new IUProfilePropertyQuery(SimplePlanner.INCLUSION_RULES, IUProfilePropertyQuery.ANY), null);
@@ -98,7 +98,7 @@ public class AddIUProperty extends AbstractProvisioningTest {
IProvisioningPlan plan3 = planner.getProvisioningPlan(req3, null, null);
assertEquals(IStatus.OK, plan.getStatus().getSeverity());
engine.perform(plan3, null);
- allProfileIUs = profile.query(InstallableUnitQuery.ANY, null);
+ allProfileIUs = profile.query(QueryUtil.createIUAnyQuery(), null);
assertProfileContainsAll("A2 is missing", profile, new IInstallableUnit[] {a2});
assertEquals(queryResultSize(allProfileIUs), 1);
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AdditionalConstraints.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AdditionalConstraints.java
index b3f20ec08..fcc20cfb9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AdditionalConstraints.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AdditionalConstraints.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.Arrays;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class AdditionalConstraints extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstance.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstance.java
index 11492913a..2ef3fb4b3 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstance.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstance.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.lang.reflect.Field;
import java.net.URI;
import java.util.Properties;
@@ -20,7 +18,8 @@ import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class AgentPlanTestInExternalInstance extends AbstractProvisioningTest {
@@ -276,7 +275,7 @@ public class AgentPlanTestInExternalInstance extends AbstractProvisioningTest {
assertProfileContainsAll("Checking profile after install of actions", getProfile("agent"), new IInstallableUnit[] {act1, act1b, act2});
assertOK("install A", engine.perform(planUpdateA, null));
assertProfileContainsAll("Checking profile after install of actions", getProfile("installation"), new IInstallableUnit[] {a111, b, c});
- assertTrue(getProfile("installation").query(new InstallableUnitQuery("Action1", DEFAULT_VERSION), null).isEmpty());
+ assertTrue(getProfile("installation").query(QueryUtil.createIUQuery("Action1", DEFAULT_VERSION), null).isEmpty());
assertEquals(getProfile("agent").getProfileId(), plan.getInstallerPlan().getProfile().getProfileId());
//uninstall A
@@ -302,7 +301,7 @@ public class AgentPlanTestInExternalInstance extends AbstractProvisioningTest {
requestForD.addInstallableUnits(new IInstallableUnit[] {d});
IProvisioningPlan planForD = planner.getProvisioningPlan(requestForD, ctx, new NullProgressMonitor());
assertNotNull(planForD.getInstallerPlan());
- assertEquals(1, queryResultSize(planForD.getInstallerPlan().getRemovals().query(new InstallableUnitQuery(act1b.getId()), null)));
+ assertEquals(1, queryResultSize(planForD.getInstallerPlan().getRemovals().query(QueryUtil.createIUQuery(act1b.getId()), null)));
assertOK("install actions", engine.perform(planForD.getInstallerPlan(), null));
assertProfileContainsAll("Checking profile after install of actions", getProfile("agent"), new IInstallableUnit[] {act1v2});
assertOK("install D", engine.perform(planForD, null));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstanceForCohostedMode.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstanceForCohostedMode.java
index fe52feef3..48042a909 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstanceForCohostedMode.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInExternalInstanceForCohostedMode.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.lang.reflect.Field;
import java.net.URI;
import java.util.Properties;
@@ -20,7 +18,8 @@ import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class AgentPlanTestInExternalInstanceForCohostedMode extends AbstractProvisioningTest {
@@ -276,7 +275,7 @@ public class AgentPlanTestInExternalInstanceForCohostedMode extends AbstractProv
assertProfileContainsAll("Checking profile after install of actions", getProfile("agent"), new IInstallableUnit[] {act1, act1b, act2});
assertOK("install A", engine.perform(planUpdateA, null));
assertProfileContainsAll("Checking profile after install of actions", getProfile("installation"), new IInstallableUnit[] {act2, act1b, a111, b, c});
- assertTrue(getProfile("installation").query(new InstallableUnitQuery("Action1", DEFAULT_VERSION), null).isEmpty());
+ assertTrue(getProfile("installation").query(QueryUtil.createIUQuery("Action1", DEFAULT_VERSION), null).isEmpty());
assertEquals(getProfile("agent").getProfileId(), plan.getInstallerPlan().getProfile().getProfileId());
//uninstall A
@@ -302,7 +301,7 @@ public class AgentPlanTestInExternalInstanceForCohostedMode extends AbstractProv
requestForD.addInstallableUnits(new IInstallableUnit[] {d});
IProvisioningPlan planForD = planner.getProvisioningPlan(requestForD, ctx, new NullProgressMonitor());
assertNotNull(planForD.getInstallerPlan());
- assertEquals(1, queryResultSize(planForD.getInstallerPlan().getRemovals().query(new InstallableUnitQuery(act1b.getId()), null)));
+ assertEquals(1, queryResultSize(planForD.getInstallerPlan().getRemovals().query(QueryUtil.createIUQuery(act1b.getId()), null)));
assertOK("install actions", engine.perform(planForD.getInstallerPlan(), null));
assertProfileContainsAll("Checking profile after install of actions", getProfile("agent"), new IInstallableUnit[] {act1v2});
assertOK("install D", engine.perform(planForD, null));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInRunningInstance.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInRunningInstance.java
index 62f695cc6..90946bc9c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInRunningInstance.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AgentPlanTestInRunningInstance.java
@@ -8,16 +8,16 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.net.URI;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlanExecutionHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class AgentPlanTestInRunningInstance extends AbstractProvisioningTest {
@@ -259,7 +259,7 @@ public class AgentPlanTestInRunningInstance extends AbstractProvisioningTest {
assertProfileContainsAll("Checking profile after install of actions", getProfile(IProfileRegistry.SELF), new IInstallableUnit[] {act1, act1b});
assertOK("install A", engine.perform(planUpdateA, null));
assertProfileContainsAll("Checking profile after install of actions", getProfile(IProfileRegistry.SELF), new IInstallableUnit[] {act1b, a111, b, c});
- assertTrue(getProfile(IProfileRegistry.SELF).query(new InstallableUnitQuery("Action1", DEFAULT_VERSION), null).isEmpty());
+ assertTrue(getProfile(IProfileRegistry.SELF).query(QueryUtil.createIUQuery("Action1", DEFAULT_VERSION), null).isEmpty());
//uninstall A
ProfileChangeRequest request3 = new ProfileChangeRequest(getProfile(IProfileRegistry.SELF));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AllOptional.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AllOptional.java
index 1673e00bf..901414493 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AllOptional.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AllOptional.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class AllOptional extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AllOrbit.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AllOrbit.java
index 3fc0f21e7..348b89b2e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AllOrbit.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AllOrbit.java
@@ -8,17 +8,17 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.ArrayList;
import java.util.Iterator;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -41,7 +41,7 @@ public class AllOrbit extends AbstractProvisioningTest {
public void testInstallTwoVersionsOptionaly() {
ProfileChangeRequest req1 = new ProfileChangeRequest(profile1);
- IQueryResult allIUs = repo.query(InstallableUnitQuery.ANY, null);
+ IQueryResult allIUs = repo.query(QueryUtil.createIUAnyQuery(), null);
req1.addInstallableUnits((IInstallableUnit[]) allIUs.toArray(IInstallableUnit.class));
for (Iterator iterator = allIUs.iterator(); iterator.hasNext();) {
IInstallableUnit iu = (IInstallableUnit) iterator.next();
@@ -55,7 +55,7 @@ public class AllOrbit extends AbstractProvisioningTest {
public void test2() {
//Install everything except com.ibm.icu
ProfileChangeRequest req1 = new ProfileChangeRequest(profile1);
- IQueryResult allIUs = repo.query(InstallableUnitQuery.ANY, null);
+ IQueryResult allIUs = repo.query(QueryUtil.createIUAnyQuery(), null);
ArrayList toInstall = new ArrayList();
int removed = 0;
for (Iterator iterator = allIUs.iterator(); iterator.hasNext();) {
@@ -75,7 +75,7 @@ public class AllOrbit extends AbstractProvisioningTest {
public void test3() {
//Install everything optionaly (except com.ibm.icu that we don't install at all)
ProfileChangeRequest req1 = new ProfileChangeRequest(profile1);
- IQueryResult allIUs = repo.query(InstallableUnitQuery.ANY, null);
+ IQueryResult allIUs = repo.query(QueryUtil.createIUAnyQuery(), null);
ArrayList toInstall = new ArrayList();
int removed = 0;
for (Iterator iterator = allIUs.iterator(); iterator.hasNext();) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AnotherSingleton.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AnotherSingleton.java
index 45ce1bd98..cb32a01c8 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AnotherSingleton.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AnotherSingleton.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class AnotherSingleton extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug207319.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug207319.java
index 6e24f9294..06fe2199d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug207319.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug207319.java
@@ -14,7 +14,7 @@ import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class Bug207319 extends AbstractProvisioningTest {
@@ -39,13 +39,13 @@ public class Bug207319 extends AbstractProvisioningTest {
req.addInstallableUnits(new IInstallableUnit[] {b});
assertEquals(IStatus.OK, director.provision(req, null, null).getSeverity());
assertProfileContainsAll("B is missing", profile, new IInstallableUnit[] {b});
- assertNotIUs(new IInstallableUnit[] {a}, profile.query(InstallableUnitQuery.ANY, null).iterator());
+ assertNotIUs(new IInstallableUnit[] {a}, profile.query(QueryUtil.createIUAnyQuery(), null).iterator());
ProfileChangeRequest req2 = new ProfileChangeRequest(profile);
req2.addInstallableUnits(new IInstallableUnit[] {c});
assertEquals(IStatus.OK, director.provision(req2, null, null).getSeverity());
assertProfileContainsAll("B and C are missing", profile, new IInstallableUnit[] {b, c});
- assertNotIUs(new IInstallableUnit[] {a}, profile.query(InstallableUnitQuery.ANY, null).iterator());
+ assertNotIUs(new IInstallableUnit[] {a}, profile.query(QueryUtil.createIUAnyQuery(), null).iterator());
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug249605.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug249605.java
index ba9b74af7..5c2cd40ee 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug249605.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug249605.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.HashMap;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -21,6 +19,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.query.UserVisibleRootQuery;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class Bug249605 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252638.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252638.java
index e9ca817fb..7ced73126 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252638.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252638.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
//Failing to install something optionally should indicate the failure in the request status for the IU being installed.
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252682.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252682.java
index 5a048daac..e9f03525e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252682.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252682.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.io.File;
import java.util.ArrayList;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -20,8 +18,9 @@ import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class Bug252682 extends AbstractProvisioningTest {
@@ -44,9 +43,9 @@ public class Bug252682 extends AbstractProvisioningTest {
}
public void testInstallFeaturePatch() {
- IInstallableUnit p2Feature = (IInstallableUnit) profile.query(new InstallableUnitQuery("org.eclipse.equinox.p2.user.ui.feature.group"), new NullProgressMonitor()).iterator().next();
+ IInstallableUnit p2Feature = (IInstallableUnit) profile.query(QueryUtil.createIUQuery("org.eclipse.equinox.p2.user.ui.feature.group"), new NullProgressMonitor()).iterator().next();
System.out.println(p2Feature);
- IQueryResult c = profile.query(new InstallableUnitQuery("org.eclipse.equinox.p2.core.patch"), new NullProgressMonitor());
+ IQueryResult c = profile.query(QueryUtil.createIUQuery("org.eclipse.equinox.p2.core.patch"), new NullProgressMonitor());
assertEquals(1, queryResultSize(c));
ProvisioningContext ctx = new ProvisioningContext();
ctx.setExtraIUs(newIUs);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet1.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet1.java
index 4b41e815c..6dec96ae4 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet1.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet1.java
@@ -10,17 +10,17 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.io.File;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -46,7 +46,7 @@ public class Bug254481dataSet1 extends AbstractProvisioningTest {
}
public void testInstallFeaturePatch() {
- IQueryResult c = repo.query(new InstallableUnitQuery("RPT_ARM_TEST.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("RPT_ARM_TEST.feature.group"), new NullProgressMonitor());
assertEquals(1, queryResultSize(c));
IInstallableUnit patch = (IInstallableUnit) c.iterator().next();
ProfileChangeRequest request = new ProfileChangeRequest(profile);
@@ -56,10 +56,10 @@ public class Bug254481dataSet1 extends AbstractProvisioningTest {
IProvisioningPlan plan = planner.getProvisioningPlan(request, null, new NullProgressMonitor());
assertInstallOperand(plan, patch);
//[[R]com.ibm.rational.test.lt.arm 7.0.250.v200810021504 --> [R]com.ibm.rational.test.lt.arm 7.0.300.200811041300,
- assertEquals(1, queryResultSize(plan.getAdditions().query(new InstallableUnitQuery("com.ibm.rational.test.lt.arm"), null)));
+ assertEquals(1, queryResultSize(plan.getAdditions().query(QueryUtil.createIUQuery("com.ibm.rational.test.lt.arm"), null)));
//[R]com.ibm.rational.test.lt.armbroker 7.0.250.v200810021504 --> [R]com.ibm.rational.test.lt.armbroker 7.0.300.200811041300,
- assertEquals(1, queryResultSize(plan.getAdditions().query(new InstallableUnitQuery("com.ibm.rational.test.lt.armbroker"), null)));
+ assertEquals(1, queryResultSize(plan.getAdditions().query(QueryUtil.createIUQuery("com.ibm.rational.test.lt.armbroker"), null)));
//[R]com.ibm.rational.test.lt.kernel 7.2.151.v200810021605 --> [R]com.ibm.rational.test.lt.kernel 7.2.200.200811041300,
- assertEquals(1, queryResultSize(plan.getAdditions().query(new InstallableUnitQuery("com.ibm.rational.test.lt.kernel"), null)));
+ assertEquals(1, queryResultSize(plan.getAdditions().query(QueryUtil.createIUQuery("com.ibm.rational.test.lt.kernel"), null)));
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet2.java
index 3fc1debd3..98678da12 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet2.java
@@ -10,17 +10,17 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.io.File;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -46,7 +46,7 @@ public class Bug254481dataSet2 extends AbstractProvisioningTest {
}
public void testInstallFeaturePatch() {
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.jdt.feature.patch.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.jdt.feature.patch.feature.group"), new NullProgressMonitor());
assertEquals(1, queryResultSize(c));
IInstallableUnit patch = (IInstallableUnit) c.iterator().next();
ProfileChangeRequest request = new ProfileChangeRequest(profile);
@@ -55,7 +55,7 @@ public class Bug254481dataSet2 extends AbstractProvisioningTest {
IPlanner planner = createPlanner();
IProvisioningPlan plan = planner.getProvisioningPlan(request, null, new NullProgressMonitor());
assertInstallOperand(plan, patch);
- assertEquals(1, queryResultSize(plan.getAdditions().query(new InstallableUnitQuery("org.eclipse.jdt.core"), null)));
- assertEquals(1, queryResultSize(plan.getAdditions().query(new InstallableUnitQuery("org.eclipse.jdt.core.manipulation"), null)));
+ assertEquals(1, queryResultSize(plan.getAdditions().query(QueryUtil.createIUQuery("org.eclipse.jdt.core"), null)));
+ assertEquals(1, queryResultSize(plan.getAdditions().query(QueryUtil.createIUQuery("org.eclipse.jdt.core.manipulation"), null)));
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug255984.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug255984.java
index 447dcaf96..b96170aed 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug255984.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug255984.java
@@ -10,17 +10,17 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class Bug255984 extends AbstractProvisioningTest {
@@ -54,7 +54,7 @@ public class Bug255984 extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan.getStatus().getSeverity());
engine.perform(plan, null);
assertProfileContainsAll("B is missing", profile1, new IInstallableUnit[] {b});
- assertEquals(1, queryResultSize(profile1.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(1, queryResultSize(profile1.query(QueryUtil.createIUAnyQuery(), null)));
//Install A
ProfileChangeRequest req2 = new ProfileChangeRequest(profile1);
@@ -65,7 +65,7 @@ public class Bug255984 extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan2.getStatus().getSeverity());
engine.perform(plan2, null);
assertProfileContainsAll("A is missing", profile1, new IInstallableUnit[] {a, b});
- assertEquals(2, queryResultSize(profile1.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(2, queryResultSize(profile1.query(QueryUtil.createIUAnyQuery(), null)));
//Uninstall B
ProfileChangeRequest req3 = new ProfileChangeRequest(profile1);
@@ -76,6 +76,6 @@ public class Bug255984 extends AbstractProvisioningTest {
engine.perform(plan3, null);
assertProfileContainsAll("A is missing", profile1, new IInstallableUnit[] {a, b});
assertEquals(1, queryResultSize(profile1.query(new IUProfilePropertyQuery("foo", "bar"), new NullProgressMonitor())));
- assertEquals(2, queryResultSize(profile1.query(InstallableUnitQuery.ANY, null)));
+ assertEquals(2, queryResultSize(profile1.query(QueryUtil.createIUAnyQuery(), null)));
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug262580.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug262580.java
index 15a62f05d..601c47a49 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug262580.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug262580.java
@@ -10,12 +10,11 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.io.File;
import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class Bug262580 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug270656.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug270656.java
index e35ef9fd6..935c59be0 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug270656.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug270656.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class Bug270656 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug270683.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug270683.java
index 17cc145c0..dd7bf5a1b 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug270683.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug270683.java
@@ -10,16 +10,16 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerStatus;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
-import org.eclipse.equinox.p2.engine.*;
+import org.eclipse.equinox.p2.engine.IEngine;
+import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class Bug270683 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271067.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271067.java
index 2eb536dda..151a37888 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271067.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271067.java
@@ -19,8 +19,8 @@ import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -67,7 +67,7 @@ public class Bug271067 extends AbstractProvisioningTest {
}
IInstallableUnit getIU(IMetadataRepository source, String id, String version) {
- IQueryResult c = repo.query(new InstallableUnitQuery(id, Version.create(version)), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery(id, Version.create(version)), new NullProgressMonitor());
assertEquals(1, queryResultSize(c));
return (IInstallableUnit) c.iterator().next();
}
@@ -93,7 +93,7 @@ public class Bug271067 extends AbstractProvisioningTest {
IProvisioningPlan feature1Plan = createPlanner().getProvisioningPlan(installFeature1, new ProvisioningContext(), null);
assertOK("installation of feature1 and patch", createEngine().perform(feature1Plan, new NullProgressMonitor()));
- assertEquals(1, queryResultSize(getProfile(profileLoadedId).query(new InstallableUnitQuery("hello", Version.create("1.0.0.1")), new NullProgressMonitor())));
+ assertEquals(1, queryResultSize(getProfile(profileLoadedId).query(QueryUtil.createIUQuery("hello", Version.create("1.0.0.1")), new NullProgressMonitor())));
IInstallableUnit featureGroup2 = getIU(repo, "hello.feature.2.feature.group", "1.0.0");
IInstallableUnit helloIU2 = getIU(repo, "hello", "1.0.2");
@@ -107,7 +107,7 @@ public class Bug271067 extends AbstractProvisioningTest {
IProvisioningPlan feature2Plan = createPlanner().getProvisioningPlan(installFeature2, new ProvisioningContext(), null);
assertOK("installation of feature2", createEngine().perform(feature2Plan, new NullProgressMonitor()));
- assertEquals(1, queryResultSize(getProfile(profileLoadedId).query(new InstallableUnitQuery("hello", Version.create("1.0.0.1")), new NullProgressMonitor())));
+ assertEquals(1, queryResultSize(getProfile(profileLoadedId).query(QueryUtil.createIUQuery("hello", Version.create("1.0.0.1")), new NullProgressMonitor())));
}
public void testInstallFeaturePatchReverseOrder() {
@@ -123,7 +123,7 @@ public class Bug271067 extends AbstractProvisioningTest {
IProvisioningPlan feature2Plan = createPlanner().getProvisioningPlan(installFeature2, new ProvisioningContext(), null);
assertOK("installation of feature2", createEngine().perform(feature2Plan, new NullProgressMonitor()));
- assertEquals(1, queryResultSize(getProfile(profileLoadedId).query(new InstallableUnitQuery("hello", Version.create("1.0.2")), new NullProgressMonitor())));
+ assertEquals(1, queryResultSize(getProfile(profileLoadedId).query(QueryUtil.createIUQuery("hello", Version.create("1.0.2")), new NullProgressMonitor())));
ProfileChangeRequest installFeature1 = new ProfileChangeRequest(getProfile(profileLoadedId));
IInstallableUnit featureGroup = getIU(repo, "hello.feature.1.feature.group", "1.0.0");
@@ -144,7 +144,7 @@ public class Bug271067 extends AbstractProvisioningTest {
IProvisioningPlan feature1Plan = createPlanner().getProvisioningPlan(installFeature1, new ProvisioningContext(), null);
assertOK("installation of feature1 and patch", createEngine().perform(feature1Plan, new NullProgressMonitor()));
- assertEquals(1, queryResultSize(getProfile(profileLoadedId).query(new InstallableUnitQuery("hello", Version.create("1.0.0.1")), new NullProgressMonitor())));
+ assertEquals(1, queryResultSize(getProfile(profileLoadedId).query(QueryUtil.createIUQuery("hello", Version.create("1.0.0.1")), new NullProgressMonitor())));
}
public void installTogether() {
@@ -174,6 +174,6 @@ public class Bug271067 extends AbstractProvisioningTest {
IProvisioningPlan plan = createPlanner().getProvisioningPlan(installEverything, new ProvisioningContext(), null);
assertOK("installation of feature1 and patch", createEngine().perform(plan, new NullProgressMonitor()));
- assertEquals(1, queryResultSize(getProfile(profileLoadedId).query(new InstallableUnitQuery("hello", Version.create("1.0.0.1")), new NullProgressMonitor())));
+ assertEquals(1, queryResultSize(getProfile(profileLoadedId).query(QueryUtil.createIUQuery("hello", Version.create("1.0.0.1")), new NullProgressMonitor())));
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271954.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271954.java
index da918d722..03ec197d6 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271954.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271954.java
@@ -19,8 +19,8 @@ import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class Bug271954 extends AbstractProvisioningTest {
@@ -74,7 +74,7 @@ public class Bug271954 extends AbstractProvisioningTest {
}
public void testUninstallMyBundle() {
- IQueryResult c = profile.available(new InstallableUnitQuery("A"), new NullProgressMonitor());
+ IQueryResult c = profile.available(QueryUtil.createIUQuery("A"), new NullProgressMonitor());
assertEquals(1, queryResultSize(c));
ProfileChangeRequest req = new ProfileChangeRequest(profile);
req.removeInstallableUnits((IInstallableUnit[]) c.toArray(IInstallableUnit.class));
@@ -83,11 +83,11 @@ public class Bug271954 extends AbstractProvisioningTest {
ctx.setArtifactRepositories(new URI[0]);
IProvisioningPlan plan = createPlanner().getProvisioningPlan(req, ctx, new NullProgressMonitor());
assertOK("Uninstall plan for myBundle", plan.getStatus());
- assertEquals(0, queryResultSize(plan.getInstallerPlan().getAdditions().query(InstallableUnitQuery.ANY, new NullProgressMonitor())));
- assertEquals(0, queryResultSize(plan.getInstallerPlan().getRemovals().query(InstallableUnitQuery.ANY, new NullProgressMonitor())));
+ assertEquals(0, queryResultSize(plan.getInstallerPlan().getAdditions().query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
+ assertEquals(0, queryResultSize(plan.getInstallerPlan().getRemovals().query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
assertUninstallOperand(plan, (IInstallableUnit) c.iterator().next());
- assertEquals(2, queryResultSize(plan.getRemovals().query(InstallableUnitQuery.ANY, new NullProgressMonitor())));
- assertEquals(1, queryResultSize(plan.getRemovals().query(new InstallableUnitQuery("A", Version.createOSGi(1, 0, 0)), new NullProgressMonitor())));
- assertEquals(1, queryResultSize(plan.getRemovals().query(new InstallableUnitQuery("Action1", Version.createOSGi(1, 0, 0)), new NullProgressMonitor())));
+ assertEquals(2, queryResultSize(plan.getRemovals().query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
+ assertEquals(1, queryResultSize(plan.getRemovals().query(QueryUtil.createIUQuery("A", Version.createOSGi(1, 0, 0)), new NullProgressMonitor())));
+ assertEquals(1, queryResultSize(plan.getRemovals().query(QueryUtil.createIUQuery("Action1", Version.createOSGi(1, 0, 0)), new NullProgressMonitor())));
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug272251.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug272251.java
index e757ea649..425ac84d6 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug272251.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug272251.java
@@ -10,18 +10,18 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.io.File;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -47,9 +47,9 @@ public class Bug272251 extends AbstractProvisioningTest {
}
public void testInstallFeaturePatch() {
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.wst.jsdt.feature.patch.feature.group", Version.create("3.0.4.v200904020304-1-8d7w311_15131415")), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.wst.jsdt.feature.patch.feature.group", Version.create("3.0.4.v200904020304-1-8d7w311_15131415")), new NullProgressMonitor());
assertEquals(1, queryResultSize(c));
- IQueryResult expectedIU = repo.query(new InstallableUnitQuery("org.eclipse.wst.jsdt.web.ui", Version.create("1.0.105.v200904020304")), new NullProgressMonitor());
+ IQueryResult expectedIU = repo.query(QueryUtil.createIUQuery("org.eclipse.wst.jsdt.web.ui", Version.create("1.0.105.v200904020304")), new NullProgressMonitor());
assertEquals(1, queryResultSize(expectedIU));
IInstallableUnit patch = (IInstallableUnit) c.iterator().next();
ProfileChangeRequest request = new ProfileChangeRequest(profile);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug278668.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug278668.java
index 0599de39f..fe82615cc 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug278668.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug278668.java
@@ -1,17 +1,17 @@
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.ArrayList;
import java.util.Properties;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -66,9 +66,9 @@ public class Bug278668 extends AbstractProvisioningTest {
}
public void testInstallFeaturePatch() {
- IQueryResult c = repo.query(new InstallableUnitQuery("com.borland.tg.modeling.8.2.0.hotfixexp.patch.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("com.borland.tg.modeling.8.2.0.hotfixexp.patch.feature.group"), new NullProgressMonitor());
assertEquals(1, queryResultSize(c));
- IQueryResult c2 = repo.query(new InstallableUnitQuery("com.borland.tg.modeling.8.2.0.nl.patch.feature.group"), new NullProgressMonitor());
+ IQueryResult c2 = repo.query(QueryUtil.createIUQuery("com.borland.tg.modeling.8.2.0.nl.patch.feature.group"), new NullProgressMonitor());
assertEquals(1, queryResultSize(c2));
ProfileChangeRequest request = new ProfileChangeRequest(profile);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug300104.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug300104.java
index c9aef2329..7f27979e3 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug300104.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug300104.java
@@ -10,17 +10,17 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.io.File;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.core.*;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -43,7 +43,7 @@ public class Bug300104 extends AbstractProvisioningTest {
}
IInstallableUnit getIU(IMetadataRepository source, String id, String version) {
- IQueryResult c = repo.query(new InstallableUnitQuery(id, Version.create(version)), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery(id, Version.create(version)), new NullProgressMonitor());
assertEquals(1, queryResultSize(c));
return (IInstallableUnit) c.iterator().next();
}
@@ -99,7 +99,7 @@ public class Bug300104 extends AbstractProvisioningTest {
IProvisioningPlan feature1Plan = getPlannerService().getProvisioningPlan(installFeature1, new ProvisioningContext(), null);
assertOK("installation of feature1", getEngineService().perform(feature1Plan, new NullProgressMonitor()));
- assertEquals(1, queryResultSize(profileRegistry.getProfile(profileLoadedId).query(new InstallableUnitQuery("hello", Version.create("1.0.0.200911201237")), new NullProgressMonitor())));
+ assertEquals(1, queryResultSize(profileRegistry.getProfile(profileLoadedId).query(QueryUtil.createIUQuery("hello", Version.create("1.0.0.200911201237")), new NullProgressMonitor())));
}
private IEngine getEngineService() {
@@ -137,8 +137,8 @@ public class Bug300104 extends AbstractProvisioningTest {
IProvisioningPlan feature1Plan = getPlannerService().getProvisioningPlan(installFeature1, new ProvisioningContext(), null);
assertOK("installation of feature1", getEngineService().perform(feature1Plan, new NullProgressMonitor()));
- assertEquals(0, queryResultSize(profileRegistry.getProfile(profileLoadedId).query(new InstallableUnitQuery("hello", Version.create("1.0.0.200911201237")), new NullProgressMonitor())));
- assertEquals(1, queryResultSize(profileRegistry.getProfile(profileLoadedId).query(new InstallableUnitQuery("hello", Version.create("1.0.1.200911201237")), new NullProgressMonitor())));
+ assertEquals(0, queryResultSize(profileRegistry.getProfile(profileLoadedId).query(QueryUtil.createIUQuery("hello", Version.create("1.0.0.200911201237")), new NullProgressMonitor())));
+ assertEquals(1, queryResultSize(profileRegistry.getProfile(profileLoadedId).query(QueryUtil.createIUQuery("hello", Version.create("1.0.1.200911201237")), new NullProgressMonitor())));
}
private void applyHelloPatch2() throws ProvisionException {
@@ -169,10 +169,10 @@ public class Bug300104 extends AbstractProvisioningTest {
IProvisioningPlan feature1Plan = getPlannerService().getProvisioningPlan(installFeature1, new ProvisioningContext(), null);
assertOK("installation of feature1", getEngineService().perform(feature1Plan, new NullProgressMonitor()));
- assertEquals(1, queryResultSize(profileRegistry.getProfile(profileLoadedId).query(new InstallableUnitQuery("hello2", Version.create("1.0.0.200911201358")), new NullProgressMonitor())));
+ assertEquals(1, queryResultSize(profileRegistry.getProfile(profileLoadedId).query(QueryUtil.createIUQuery("hello2", Version.create("1.0.0.200911201358")), new NullProgressMonitor())));
- assertEquals(0, queryResultSize(profileRegistry.getProfile(profileLoadedId).query(new InstallableUnitQuery("hello", Version.create("1.0.0.200911201237")), new NullProgressMonitor())));
- assertEquals(0, queryResultSize(profileRegistry.getProfile(profileLoadedId).query(new InstallableUnitQuery("hello", Version.create("1.0.1.200911201237")), new NullProgressMonitor())));
- assertEquals(1, queryResultSize(profileRegistry.getProfile(profileLoadedId).query(new InstallableUnitQuery("hello", Version.create("1.0.1.200911201358")), new NullProgressMonitor())));
+ assertEquals(0, queryResultSize(profileRegistry.getProfile(profileLoadedId).query(QueryUtil.createIUQuery("hello", Version.create("1.0.0.200911201237")), new NullProgressMonitor())));
+ assertEquals(0, queryResultSize(profileRegistry.getProfile(profileLoadedId).query(QueryUtil.createIUQuery("hello", Version.create("1.0.1.200911201237")), new NullProgressMonitor())));
+ assertEquals(1, queryResultSize(profileRegistry.getProfile(profileLoadedId).query(QueryUtil.createIUQuery("hello", Version.create("1.0.1.200911201358")), new NullProgressMonitor())));
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302580.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302580.java
index ac5e4c1ec..4e51bc357 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302580.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302580.java
@@ -14,9 +14,9 @@ import junit.framework.Assert;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
/**
* @since 1.0
@@ -40,7 +40,7 @@ public class Bug302580 extends AbstractPlannerTest {
}
public void testInstall() {
- IQueryResult<IInstallableUnit> ius = repo.query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ IQueryResult<IInstallableUnit> ius = repo.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor());
IPlanner planner = createPlanner();
ProvisioningPlan plan = (ProvisioningPlan) planner.getProvisioningPlan(createProfileChangeRequest(ius.toSet(), null, null), null, new NullProgressMonitor());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302582.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302582.java
index 9a736bffe..55ceab82f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302582.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302582.java
@@ -13,10 +13,10 @@ package org.eclipse.equinox.p2.tests.planner;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
public class Bug302582 extends AbstractPlannerTest {
@@ -34,12 +34,12 @@ public class Bug302582 extends AbstractPlannerTest {
IPlanner planner = createPlanner();
// create the actual plan - install everything in the repo as optional (mimic the dropins folder)
- IQueryResult allIUs = repo.query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ IQueryResult allIUs = repo.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor());
IProfileChangeRequest actualChangeRequest = createProfileChangeRequest(allIUs.toSet(), null, null);
IProvisioningPlan actualPlan = planner.getProvisioningPlan(actualChangeRequest, null, new NullProgressMonitor());
// this is the plan that we expect - highest version only
- IQueryResult queryResult = repo.query(new InstallableUnitQuery("com.dcns.rsm.hello", Version.createOSGi(1, 0, 2, "v20100103")), new NullProgressMonitor());
+ IQueryResult queryResult = repo.query(QueryUtil.createIUQuery("com.dcns.rsm.hello", Version.createOSGi(1, 0, 2, "v20100103")), new NullProgressMonitor());
IProfileChangeRequest expectedChangeRequest = createProfileChangeRequest(queryResult.toSet(), null, null);
IProvisioningPlan expectedPlan = planner.getProvisioningPlan(expectedChangeRequest, null, new NullProgressMonitor());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302582c.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302582c.java
index 390d35ba8..adacf59a0 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302582c.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302582c.java
@@ -13,10 +13,10 @@ package org.eclipse.equinox.p2.tests.planner;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
public class Bug302582c extends Bug302582 {
/* (non-Javadoc)
@@ -46,14 +46,14 @@ public class Bug302582c extends Bug302582 {
IPlanner planner = createPlanner();
// create the actual plan - install everything in the repo as optional (mimic the dropins folder)
- IQueryResult allIUs = repo.query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ IQueryResult allIUs = repo.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor());
// IQueryResult allIUs = repo.query(new InstallableUnitQuery("aaa", new VersionRange("[1.0.2, 1.0.3]")), new NullProgressMonitor());
IProfileChangeRequest actualChangeRequest = createProfileChangeRequest(allIUs.toSet(), null, null);
IProvisioningPlan actualPlan = planner.getProvisioningPlan(actualChangeRequest, null, new NullProgressMonitor());
// this is the plan that we expect - highest version only
- IQueryResult queryResult = repo.query(new InstallableUnitQuery("aaa", Version.createOSGi(1, 0, 3)), new NullProgressMonitor());
+ IQueryResult queryResult = repo.query(QueryUtil.createIUQuery("aaa", Version.createOSGi(1, 0, 3)), new NullProgressMonitor());
IProfileChangeRequest expectedChangeRequest = createProfileChangeRequest(queryResult.toSet(), null, null);
IProvisioningPlan expectedPlan = planner.getProvisioningPlan(expectedChangeRequest, null, new NullProgressMonitor());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302582d.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302582d.java
index 8c0e7532f..3f7a4e33a 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302582d.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug302582d.java
@@ -20,9 +20,9 @@ import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -46,7 +46,7 @@ public class Bug302582d extends AbstractProvisioningTest {
}
IInstallableUnit getIU(IMetadataRepository source, String id, String version) {
- IQueryResult c = repo.query(new InstallableUnitQuery(id, Version.create(version)), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery(id, Version.create(version)), new NullProgressMonitor());
assertEquals(1, queryResultSize(c));
return (IInstallableUnit) c.iterator().next();
}
@@ -58,13 +58,13 @@ public class Bug302582d extends AbstractProvisioningTest {
} catch (ProvisionException e) {
assertNull(e); //This guarantees that the error does not go unnoticed
}
- IQueryResult<IInstallableUnit> ius = repo.query(InstallableUnitQuery.ANY, null);
+ IQueryResult<IInstallableUnit> ius = repo.query(QueryUtil.createIUAnyQuery(), null);
IPlanner planner = getPlanner(agent);
IProvisioningPlan plan = planner.getProvisioningPlan(createRequest(ius), null, new NullProgressMonitor());
IProvisioningPlan expected = planner.getProvisioningPlan(createFilteredRequest(ius), null, new NullProgressMonitor());
- assertEquals("Plan comparison", expected.getAdditions().query(InstallableUnitQuery.ANY, null).toArray(IInstallableUnit.class), plan.getAdditions().query(InstallableUnitQuery.ANY, null).toArray(IInstallableUnit.class), false);
+ assertEquals("Plan comparison", expected.getAdditions().query(QueryUtil.createIUAnyQuery(), null).toArray(IInstallableUnit.class), plan.getAdditions().query(QueryUtil.createIUAnyQuery(), null).toArray(IInstallableUnit.class), false);
}
private ProfileChangeRequest createFilteredRequest(IQueryResult<IInstallableUnit> ius) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/DependencyOnSelf.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/DependencyOnSelf.java
index c0699854d..d38f69aac 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/DependencyOnSelf.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/DependencyOnSelf.java
@@ -10,12 +10,11 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class DependencyOnSelf extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/DisabledExplanation.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/DisabledExplanation.java
index 97e68a078..91eae8071 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/DisabledExplanation.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/DisabledExplanation.java
@@ -10,16 +10,16 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerStatus;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
-import org.eclipse.equinox.p2.engine.*;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.engine.ProvisioningContext;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class DisabledExplanation extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/DropinsScenario.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/DropinsScenario.java
index 4d0df1d4b..93ca40ca0 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/DropinsScenario.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/DropinsScenario.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class DropinsScenario extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationDeepConflict.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationDeepConflict.java
index ab59ecfb0..3771368c4 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationDeepConflict.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationDeepConflict.java
@@ -11,12 +11,11 @@
package org.eclipse.equinox.p2.tests.planner;
import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.equinox.internal.provisional.p2.director.*;
-import org.eclipse.equinox.p2.engine.*;
+import org.eclipse.equinox.p2.engine.IEngine;
+import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class ExplanationDeepConflict extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationForOptionalDependencies.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationForOptionalDependencies.java
index 1338450fd..1ec11c9ed 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationForOptionalDependencies.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationForOptionalDependencies.java
@@ -11,14 +11,13 @@
package org.eclipse.equinox.p2.tests.planner;
import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
-import org.eclipse.equinox.p2.engine.*;
+import org.eclipse.equinox.p2.engine.IEngine;
+import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class ExplanationForOptionalDependencies extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationForPartialInstallation.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationForPartialInstallation.java
index b59f6650b..a7915c0ec 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationForPartialInstallation.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationForPartialInstallation.java
@@ -11,12 +11,11 @@
package org.eclipse.equinox.p2.tests.planner;
import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.equinox.internal.provisional.p2.director.*;
-import org.eclipse.equinox.p2.engine.*;
+import org.eclipse.equinox.p2.engine.IEngine;
+import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class ExplanationForPartialInstallation extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationLargeConflict.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationLargeConflict.java
index f72e88d34..bc6daffe5 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationLargeConflict.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationLargeConflict.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.io.File;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
@@ -20,8 +18,9 @@ import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -50,11 +49,11 @@ public class ExplanationLargeConflict extends AbstractProvisioningTest {
long sTime = System.currentTimeMillis();
//Here we verify that two version of JDT can't be installed together. The SDKProfile is not used
IProfile profile = createProfile("TestProfile." + getName());
- IQueryResult c = repo1.query(new InstallableUnitQuery("org.eclipse.jdt.feature.group"), null);
+ IQueryResult c = repo1.query(QueryUtil.createIUQuery("org.eclipse.jdt.feature.group"), null);
assertEquals(1, queryResultSize(c));
IInstallableUnit jdt1 = (IInstallableUnit) c.iterator().next();
- IQueryResult c2 = repo2.query(new InstallableUnitQuery("org.eclipse.jdt.feature.group"), null);
+ IQueryResult c2 = repo2.query(QueryUtil.createIUQuery("org.eclipse.jdt.feature.group"), null);
assertEquals(1, queryResultSize(c2));
IInstallableUnit jdt2 = (IInstallableUnit) c2.iterator().next();
@@ -102,7 +101,7 @@ public class ExplanationLargeConflict extends AbstractProvisioningTest {
public void testExplanationLargeConflictInSDK() {
long sTime = System.currentTimeMillis();
//Test large conflict. We are trying to install an inappropriate version of CVS over the already installed SDK
- IQueryResult c = repo2.query(new InstallableUnitQuery("org.eclipse.cvs.feature.group"), null);
+ IQueryResult c = repo2.query(QueryUtil.createIUQuery("org.eclipse.cvs.feature.group"), null);
assertEquals(1, queryResultSize(c));
IInstallableUnit cvs = (IInstallableUnit) c.iterator().next();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationSeveralConflictingRoots.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationSeveralConflictingRoots.java
index dcd9548e9..1dc4edc8a 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationSeveralConflictingRoots.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationSeveralConflictingRoots.java
@@ -10,16 +10,16 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.Set;
+import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerStatus;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
-import org.eclipse.equinox.p2.engine.*;
+import org.eclipse.equinox.p2.engine.IEngine;
+import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class ExplanationSeveralConflictingRoots extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/FindingPatchesThroughUpdates.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/FindingPatchesThroughUpdates.java
index 851330f06..0578b3cc7 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/FindingPatchesThroughUpdates.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/FindingPatchesThroughUpdates.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.Properties;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class FindingPatchesThroughUpdates extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/GreedyRequirement.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/GreedyRequirement.java
index 3b34d5c2c..9d85d6187 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/GreedyRequirement.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/GreedyRequirement.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class GreedyRequirement extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUWithFilter.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUWithFilter.java
index 34ccf638d..05fb1ee95 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUWithFilter.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUWithFilter.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class IUWithFilter extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUWithFilter2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUWithFilter2.java
index ea9ce854d..91f9da6d9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUWithFilter2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUWithFilter2.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class IUWithFilter2 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/InclusionRuleTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/InclusionRuleTest.java
index 732a87d4a..b37913882 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/InclusionRuleTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/InclusionRuleTest.java
@@ -8,14 +8,14 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class InclusionRuleTest extends AbstractProvisioningTest {
@@ -51,7 +51,7 @@ public class InclusionRuleTest extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan.getStatus().getSeverity());
engine.perform(plan, null);
assertProfileContainsAll("A1 is missing", profile1, new IInstallableUnit[] {a1});
- assertEquals(queryResultSize(profile1.query(InstallableUnitQuery.ANY, null)), 1);
+ assertEquals(queryResultSize(profile1.query(QueryUtil.createIUAnyQuery(), null)), 1);
//Make a1 optional.
ProfileChangeRequest req2 = new ProfileChangeRequest(profile1);
@@ -60,7 +60,7 @@ public class InclusionRuleTest extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan2.getStatus().getSeverity());
engine.perform(plan2, null);
assertProfileContainsAll("A1 is missing", profile1, new IInstallableUnit[] {a1});
- assertEquals(queryResultSize(profile1.query(InstallableUnitQuery.ANY, null)), 1);
+ assertEquals(queryResultSize(profile1.query(QueryUtil.createIUAnyQuery(), null)), 1);
//Install b1 (this should not change anything for a1)
ProfileChangeRequest req3 = new ProfileChangeRequest(profile1);
@@ -69,7 +69,7 @@ public class InclusionRuleTest extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan3.getStatus().getSeverity());
engine.perform(plan3, null);
assertProfileContainsAll("A1 or B1 is missing", profile1, new IInstallableUnit[] {a1, b1});
- assertEquals(queryResultSize(profile1.query(InstallableUnitQuery.ANY, null)), 2);
+ assertEquals(queryResultSize(profile1.query(QueryUtil.createIUAnyQuery(), null)), 2);
//Add a2, this removes a1.
ProfileChangeRequest req4 = new ProfileChangeRequest(profile1);
@@ -78,8 +78,8 @@ public class InclusionRuleTest extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan4.getStatus().getSeverity());
engine.perform(plan4, null);
assertProfileContainsAll("A2 is missing", profile1, new IInstallableUnit[] {a2});
- assertNotIUs(new IInstallableUnit[] {a1}, profile1.query(InstallableUnitQuery.ANY, null).iterator());
- assertEquals(queryResultSize(profile1.query(InstallableUnitQuery.ANY, null)), 2);
+ assertNotIUs(new IInstallableUnit[] {a1}, profile1.query(QueryUtil.createIUAnyQuery(), null).iterator());
+ assertEquals(queryResultSize(profile1.query(QueryUtil.createIUAnyQuery(), null)), 2);
//Try to add a1 again. This will fail because since a1 has been uninstalled in the previous step and we no longer know about its optional inclusion
ProfileChangeRequest req5 = new ProfileChangeRequest(profile1);
@@ -97,7 +97,7 @@ public class InclusionRuleTest extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan.getStatus().getSeverity());
engine.perform(plan, null);
assertProfileContainsAll("A1 is missing", profile2, new IInstallableUnit[] {a1});
- assertEquals(queryResultSize(profile2.query(InstallableUnitQuery.ANY, null)), 1);
+ assertEquals(queryResultSize(profile2.query(QueryUtil.createIUAnyQuery(), null)), 1);
//Make a1 optional.
ProfileChangeRequest req2 = new ProfileChangeRequest(profile2);
@@ -106,7 +106,7 @@ public class InclusionRuleTest extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan2.getStatus().getSeverity());
engine.perform(plan2, null);
assertProfileContainsAll("A1 is missing", profile2, new IInstallableUnit[] {a1});
- assertEquals(queryResultSize(profile2.query(InstallableUnitQuery.ANY, null)), 1);
+ assertEquals(queryResultSize(profile2.query(QueryUtil.createIUAnyQuery(), null)), 1);
//Install b1 (this should not change anything for a1)
ProfileChangeRequest req3 = new ProfileChangeRequest(profile2);
@@ -116,7 +116,7 @@ public class InclusionRuleTest extends AbstractProvisioningTest {
engine.perform(plan3, null);
profile2 = getProfile(profile2.getProfileId());
assertProfileContainsAll("A1 or B1 is missing", profile2, new IInstallableUnit[] {a1, b1});
- assertEquals(queryResultSize(profile2.query(InstallableUnitQuery.ANY, null)), 2);
+ assertEquals(queryResultSize(profile2.query(QueryUtil.createIUAnyQuery(), null)), 2);
//Remove the optional inclusion rule from a1. a1 and b1 are still here
ProfileChangeRequest req5 = new ProfileChangeRequest(profile2);
@@ -126,7 +126,7 @@ public class InclusionRuleTest extends AbstractProvisioningTest {
engine.perform(plan5, null);
profile2 = getProfile(profile2.getProfileId());
assertProfileContainsAll("A1 or B1 is missing", profile2, new IInstallableUnit[] {a1, b1});
- assertEquals(queryResultSize(profile2.query(InstallableUnitQuery.ANY, null)), 2);
+ assertEquals(queryResultSize(profile2.query(QueryUtil.createIUAnyQuery(), null)), 2);
}
public void testRemoveIUandInclusionRule() {
@@ -137,7 +137,7 @@ public class InclusionRuleTest extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan.getStatus().getSeverity());
engine.perform(plan, null);
assertProfileContainsAll("A1 is missing", profile3, new IInstallableUnit[] {a1});
- assertEquals(queryResultSize(profile3.query(InstallableUnitQuery.ANY, null)), 1);
+ assertEquals(queryResultSize(profile3.query(QueryUtil.createIUAnyQuery(), null)), 1);
//Make a1 optional.
ProfileChangeRequest req2 = new ProfileChangeRequest(profile3);
@@ -146,7 +146,7 @@ public class InclusionRuleTest extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan2.getStatus().getSeverity());
engine.perform(plan2, null);
assertProfileContainsAll("A1 is missing", profile3, new IInstallableUnit[] {a1});
- assertEquals(queryResultSize(profile3.query(InstallableUnitQuery.ANY, null)), 1);
+ assertEquals(queryResultSize(profile3.query(QueryUtil.createIUAnyQuery(), null)), 1);
//Install b1 (this should not change anything for a1)
ProfileChangeRequest req3 = new ProfileChangeRequest(profile3);
@@ -155,7 +155,7 @@ public class InclusionRuleTest extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan3.getStatus().getSeverity());
engine.perform(plan3, null);
assertProfileContainsAll("A1 or B1 is missing", profile3, new IInstallableUnit[] {a1, b1});
- assertEquals(queryResultSize(profile3.query(InstallableUnitQuery.ANY, null)), 2);
+ assertEquals(queryResultSize(profile3.query(QueryUtil.createIUAnyQuery(), null)), 2);
//Remove the a1 and its inclusion rule
ProfileChangeRequest req5 = new ProfileChangeRequest(profile3);
@@ -165,7 +165,7 @@ public class InclusionRuleTest extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan5.getStatus().getSeverity());
engine.perform(plan5, null);
assertProfileContainsAll("bB1 is missing", profile3, new IInstallableUnit[] {b1});
- assertEquals(queryResultSize(profile3.query(InstallableUnitQuery.ANY, null)), 1);
+ assertEquals(queryResultSize(profile3.query(QueryUtil.createIUAnyQuery(), null)), 1);
}
public void testAdditionWithInclusionRule() {
@@ -184,7 +184,7 @@ public class InclusionRuleTest extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan.getStatus().getSeverity());
engine.perform(plan, null);
assertProfileContainsAll("A2 is missing", profile4, new IInstallableUnit[] {a2});
- assertEquals(queryResultSize(profile4.query(InstallableUnitQuery.ANY, null)), 1);
+ assertEquals(queryResultSize(profile4.query(QueryUtil.createIUAnyQuery(), null)), 1);
//Make a1 optional, this is a no-op since a1 is not in the system
ProfileChangeRequest req2 = new ProfileChangeRequest(profile4);
@@ -193,7 +193,7 @@ public class InclusionRuleTest extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan2.getStatus().getSeverity());
engine.perform(plan2, null);
assertProfileContainsAll("A2 is missing", profile4, new IInstallableUnit[] {a2});
- assertEquals(queryResultSize(profile4.query(InstallableUnitQuery.ANY, null)), 1);
+ assertEquals(queryResultSize(profile4.query(QueryUtil.createIUAnyQuery(), null)), 1);
//Install a1, this is expected to fail
ProfileChangeRequest req3 = new ProfileChangeRequest(profile4);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/InclusionRuleTest2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/InclusionRuleTest2.java
index 08ec71cac..ac4962dab 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/InclusionRuleTest2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/InclusionRuleTest2.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.query.UserVisibleRootQuery;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MinimalInstall.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MinimalInstall.java
index 70127e738..a8b1df114 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MinimalInstall.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MinimalInstall.java
@@ -10,12 +10,11 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class MinimalInstall extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingDependency.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingDependency.java
index 173ed9cd3..27adce157 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingDependency.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingDependency.java
@@ -10,18 +10,17 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.Set;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.director.Explanation;
+import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
-import org.eclipse.equinox.p2.engine.*;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class MissingDependency extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingDependency2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingDependency2.java
index de209fec3..0d3c63e67 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingDependency2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingDependency2.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class MissingDependency2 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingDependency3.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingDependency3.java
index 93d7ff799..07c9b410b 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingDependency3.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingDependency3.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class MissingDependency3 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingNonGreedyRequirement.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingNonGreedyRequirement.java
index 9b7ef30f8..b9003c1bf 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingNonGreedyRequirement.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingNonGreedyRequirement.java
@@ -10,18 +10,17 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.Set;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.director.Explanation;
+import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
-import org.eclipse.equinox.p2.engine.*;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class MissingNonGreedyRequirement extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingNonGreedyRequirement2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingNonGreedyRequirement2.java
index 68cd5589b..044f6891c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingNonGreedyRequirement2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingNonGreedyRequirement2.java
@@ -10,18 +10,17 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.Set;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.director.Explanation;
+import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
-import org.eclipse.equinox.p2.engine.*;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class MissingNonGreedyRequirement2 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptional.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptional.java
index 605fbefd8..fab4535c7 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptional.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptional.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class MissingOptional extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalNonGreedyRequirement.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalNonGreedyRequirement.java
index 1a87be48c..1b7299681 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalNonGreedyRequirement.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalNonGreedyRequirement.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class MissingOptionalNonGreedyRequirement extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalWithDependencies.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalWithDependencies.java
index 76863499f..3ecb4095a 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalWithDependencies.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalWithDependencies.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class MissingOptionalWithDependencies extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalWithDependencies2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalWithDependencies2.java
index 2e51c8d37..a72091b92 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalWithDependencies2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalWithDependencies2.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class MissingOptionalWithDependencies2 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalWithDependencies3.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalWithDependencies3.java
index dd3ff9407..b4dd943eb 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalWithDependencies3.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MissingOptionalWithDependencies3.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class MissingOptionalWithDependencies3 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MultipleProvider.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MultipleProvider.java
index 3e778eece..9cf8abc34 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MultipleProvider.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MultipleProvider.java
@@ -10,12 +10,11 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class MultipleProvider extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MultipleSingleton.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MultipleSingleton.java
index f4bf89c3c..f2bbf9a38 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MultipleSingleton.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/MultipleSingleton.java
@@ -10,19 +10,17 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.Set;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.director.Explanation;
+import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class MultipleSingleton extends AbstractProvisioningTest {
@@ -75,7 +73,7 @@ public class MultipleSingleton extends AbstractProvisioningTest {
ProfileChangeRequest req = new ProfileChangeRequest(profile);
req.addInstallableUnits(new IInstallableUnit[] {x});
ProvisioningPlan plan = (ProvisioningPlan) planner.getProvisioningPlan(req, null, null);
- assertEquals(1, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(new InstallableUnitQuery("X"), null)));
+ assertEquals(1, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(QueryUtil.createIUQuery("X"), null)));
assertEquals(IStatus.OK, plan.getStatus().getSeverity());
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NegationTesting.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NegationTesting.java
index a32140deb..fb8d02067 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NegationTesting.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NegationTesting.java
@@ -1,20 +1,20 @@
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.*;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.director.Slicer;
+import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
import org.eclipse.equinox.internal.p2.metadata.ProvidedCapability;
import org.eclipse.equinox.internal.p2.metadata.RequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerStatus;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
-import org.eclipse.equinox.p2.engine.*;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.IQueryable;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -79,7 +79,7 @@ public class NegationTesting extends AbstractProvisioningTest {
// Verify that the slice includes iu3 because the requirement from iu1 is a range including the provided capability of iu3.
Slicer slicer = new Slicer(repo, new Properties(), false);
IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor());
- assertEquals(3, queryResultSize(slice.query(InstallableUnitQuery.ANY, new NullProgressMonitor())));
+ assertEquals(3, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
//Verify that the resolution succeeds and does not return iu3 since it is excluded by the requirement of iu1
IProfile profile = createProfile("TestProfile." + getName());
@@ -87,8 +87,8 @@ public class NegationTesting extends AbstractProvisioningTest {
ProfileChangeRequest changeRequest = new ProfileChangeRequest(profile);
changeRequest.add(iu1);
ProvisioningPlan plan = (ProvisioningPlan) planner.getProvisioningPlan(changeRequest, null, null);
- assertEquals(0, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(new InstallableUnitQuery("ProviderOf1_1_1"), null)));
- assertEquals(2, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(InstallableUnitQuery.ANY, null)));
+ assertEquals(0, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(QueryUtil.createIUQuery("ProviderOf1_1_1"), null)));
+ assertEquals(2, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(QueryUtil.createIUAnyQuery(), null)));
//Verify that the installing iu1 and iu3 will result in a conflict since iu3 is excluded by the requirement of iu1
ProfileChangeRequest changeRequest2 = new ProfileChangeRequest(profile);
@@ -137,8 +137,8 @@ public class NegationTesting extends AbstractProvisioningTest {
//Test the slicer. The slice will not contain iu3 because none of the range of iu1 cause it to be brought in.
Slicer slicer = new Slicer(repo, new Properties(), false);
IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor());
- assertEquals(0, queryResultSize(slice.query(new InstallableUnitQuery("ProviderOf1_1_1"), new NullProgressMonitor())));
- assertEquals(2, queryResultSize(slice.query(InstallableUnitQuery.ANY, new NullProgressMonitor())));
+ assertEquals(0, queryResultSize(slice.query(QueryUtil.createIUQuery("ProviderOf1_1_1"), new NullProgressMonitor())));
+ assertEquals(2, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
}
public void testNot6() {
@@ -169,8 +169,8 @@ public class NegationTesting extends AbstractProvisioningTest {
//Test the slicer. The slice will not contain iu3 because none of the range of iu1 cause it to be brought in.
Slicer slicer = new Slicer(repo, new Properties(), false);
IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor());
- assertEquals(0, queryResultSize(slice.query(new InstallableUnitQuery("ProviderOf1_1_1"), new NullProgressMonitor())));
- assertEquals(2, queryResultSize(slice.query(InstallableUnitQuery.ANY, new NullProgressMonitor())));
+ assertEquals(0, queryResultSize(slice.query(QueryUtil.createIUQuery("ProviderOf1_1_1"), new NullProgressMonitor())));
+ assertEquals(2, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
//Verify that the negation can not fail the resolution when the IUs satisfying the negative requirement are not there
IProfile profile = createProfile("TestProfile." + getName());
@@ -178,8 +178,8 @@ public class NegationTesting extends AbstractProvisioningTest {
ProfileChangeRequest changeRequest = new ProfileChangeRequest(profile);
changeRequest.add(iu1);
ProvisioningPlan plan = (ProvisioningPlan) planner.getProvisioningPlan(changeRequest, null, null);
- assertEquals(0, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(new InstallableUnitQuery("ProviderOf1_1_1"), null)));
- assertEquals(2, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(InstallableUnitQuery.ANY, null)));
+ assertEquals(0, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(QueryUtil.createIUQuery("ProviderOf1_1_1"), null)));
+ assertEquals(2, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(QueryUtil.createIUAnyQuery(), null)));
}
//Test the slicer and the resolver.
@@ -223,7 +223,7 @@ public class NegationTesting extends AbstractProvisioningTest {
// Verify that the slice includes iu3 because the requirement from iu1 is a range including the provided capability of iu3.
Slicer slicer = new Slicer(repo, new Properties(), false);
IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor());
- assertEquals(3, queryResultSize(slice.query(InstallableUnitQuery.ANY, new NullProgressMonitor())));
+ assertEquals(3, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
//Verify that the resolution succeeds and does not return iu3 since it is excluded by the requirement of iu1
IProfile profile = createProfile("TestProfile." + getName());
@@ -231,8 +231,8 @@ public class NegationTesting extends AbstractProvisioningTest {
ProfileChangeRequest changeRequest = new ProfileChangeRequest(profile);
changeRequest.add(iu1);
ProvisioningPlan plan = (ProvisioningPlan) planner.getProvisioningPlan(changeRequest, null, null);
- assertEquals(0, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(new InstallableUnitQuery("ProviderOf1_1_1"), null)));
- assertEquals(2, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(InstallableUnitQuery.ANY, null)));
+ assertEquals(0, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(QueryUtil.createIUQuery("ProviderOf1_1_1"), null)));
+ assertEquals(2, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(QueryUtil.createIUAnyQuery(), null)));
//Verify that the installing iu1 and iu3 will result in a conflict since iu3 is excluded by the requirement of iu1
ProfileChangeRequest changeRequest2 = new ProfileChangeRequest(profile);
@@ -292,12 +292,12 @@ public class NegationTesting extends AbstractProvisioningTest {
// Verify that the slice includes iu3
Slicer slicer = new Slicer(repo, new Properties(), false);
IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1, iu4}, new NullProgressMonitor());
- assertEquals(4, queryResultSize(slice.query(InstallableUnitQuery.ANY, new NullProgressMonitor())));
+ assertEquals(4, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
// Verify that the slice includes iu3
Slicer slicer2 = new Slicer(repo, new Properties(), false);
IQueryable slice2 = slicer2.slice(new IInstallableUnit[] {iu4}, new NullProgressMonitor());
- assertEquals(2, queryResultSize(slice2.query(InstallableUnitQuery.ANY, new NullProgressMonitor())));
+ assertEquals(2, queryResultSize(slice2.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
//Verify that the resolution succeeds and does not return iu3 since it is excluded by the requirement of iu1
IProfile profile = createProfile("TestProfile." + getName());
@@ -305,8 +305,8 @@ public class NegationTesting extends AbstractProvisioningTest {
ProfileChangeRequest changeRequest = new ProfileChangeRequest(profile);
changeRequest.add(iu1);
ProvisioningPlan plan = (ProvisioningPlan) planner.getProvisioningPlan(changeRequest, null, null);
- assertEquals(0, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(new InstallableUnitQuery("ProviderOf1_1_1"), null)));
- assertEquals(2, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(InstallableUnitQuery.ANY, null)));
+ assertEquals(0, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(QueryUtil.createIUQuery("ProviderOf1_1_1"), null)));
+ assertEquals(2, queryResultSize(((PlannerStatus) plan.getStatus()).getPlannedState().query(QueryUtil.createIUAnyQuery(), null)));
//Verify that the installing iu1 and iu4 will result in a conflict since iu3 is excluded by the requirement of iu1
ProfileChangeRequest changeRequest2 = new ProfileChangeRequest(profile);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NoRequirements.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NoRequirements.java
index 8e4b34cd1..62984456d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NoRequirements.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NoRequirements.java
@@ -10,12 +10,11 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class NoRequirements extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState.java
index 528f3b5f3..58d766c9e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState.java
@@ -19,10 +19,9 @@ import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -48,7 +47,7 @@ public class NonMinimalState extends AbstractProvisioningTest {
ProfileChangeRequest request = new ProfileChangeRequest(profile);
IProvisioningPlan plan = planner.getProvisioningPlan(request, null, new NullProgressMonitor());
assertOK("Plan OK", plan.getStatus());
- assertTrue(plan.getAdditions().query(new InstallableUnitQuery("org.eclipse.tptp.platform.agentcontroller"), null).isEmpty());
+ assertTrue(plan.getAdditions().query(QueryUtil.createIUQuery("org.eclipse.tptp.platform.agentcontroller"), null).isEmpty());
why("slf4j.api");
why("slf4j.jcl");
why("org.eclipse.tptp.platform.iac.administrator");
@@ -61,7 +60,7 @@ public class NonMinimalState extends AbstractProvisioningTest {
ProvisioningContext ctx = new ProvisioningContext(new URI[0]);
IProvisioningPlan plan = planner.getProvisioningPlan(request, ctx, new NullProgressMonitor());
assertOK("Plan OK", plan.getStatus());
- assertTrue(plan.getAdditions().query(new InstallableUnitQuery("org.eclipse.tptp.platform.agentcontroller"), null).isEmpty());
+ assertTrue(plan.getAdditions().query(QueryUtil.createIUQuery("org.eclipse.tptp.platform.agentcontroller"), null).isEmpty());
}
private void why(String id) {
@@ -98,7 +97,7 @@ public class NonMinimalState extends AbstractProvisioningTest {
}
private boolean expandRequirement(IInstallableUnit iu, IRequirement req) {
- IQueryResult matches = profile.query(ExpressionQuery.create(req.getMatches()), null);
+ IQueryResult matches = profile.query(QueryUtil.createMatchQuery(req.getMatches()), null);
for (Iterator iterator = matches.iterator(); iterator.hasNext();) {
IInstallableUnit match = (IInstallableUnit) iterator.next();
if (match.getId().equals(searchedId))
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState2.java
index 58edfacd2..1ad689188 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState2.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -19,7 +17,8 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -36,12 +35,12 @@ public class NonMinimalState2 extends AbstractProvisioningTest {
IPlanner planner = createPlanner();
ProfileChangeRequest request = new ProfileChangeRequest(profile);
- request.addInstallableUnits((IInstallableUnit[]) getMetadataRepositoryManager().query(new InstallableUnitQuery("org.mortbay.jetty.server"), null).toArray(IInstallableUnit.class));
+ request.addInstallableUnits((IInstallableUnit[]) getMetadataRepositoryManager().query(QueryUtil.createIUQuery("org.mortbay.jetty.server"), null).toArray(IInstallableUnit.class));
IProvisioningPlan plan = planner.getProvisioningPlan(request, null, new NullProgressMonitor());
assertOK("Plan OK", plan.getStatus());
- assertTrue(plan.getAdditions().query(new InstallableUnitQuery("org.eclipse.tptp.platform.agentcontroller"), null).isEmpty());
- assertTrue(plan.getAdditions().query(new InstallableUnitQuery("org.eclipse.tptp.platform.iac.administrator"), null).isEmpty());
+ assertTrue(plan.getAdditions().query(QueryUtil.createIUQuery("org.eclipse.tptp.platform.agentcontroller"), null).isEmpty());
+ assertTrue(plan.getAdditions().query(QueryUtil.createIUQuery("org.eclipse.tptp.platform.iac.administrator"), null).isEmpty());
}
// public void testp2Source() {
@@ -61,12 +60,12 @@ public class NonMinimalState2 extends AbstractProvisioningTest {
IPlanner planner = createPlanner();
ProfileChangeRequest request = new ProfileChangeRequest(profile);
- request.addInstallableUnits((IInstallableUnit[]) getMetadataRepositoryManager().query(new InstallableUnitQuery("org.mortbay.jetty.server"), null).toArray(IInstallableUnit.class));
+ request.addInstallableUnits((IInstallableUnit[]) getMetadataRepositoryManager().query(QueryUtil.createIUQuery("org.mortbay.jetty.server"), null).toArray(IInstallableUnit.class));
IProvisioningPlan plan = planner.getProvisioningPlan(request, null, new NullProgressMonitor());
assertOK("Plan OK", plan.getStatus());
- assertTrue(plan.getAdditions().query(new InstallableUnitQuery("org.eclipse.tptp.platform.agentcontroller"), null).isEmpty());
- assertTrue(plan.getAdditions().query(new InstallableUnitQuery("org.eclipse.tptp.platform.iac.administrator"), null).isEmpty());
+ assertTrue(plan.getAdditions().query(QueryUtil.createIUQuery("org.eclipse.tptp.platform.agentcontroller"), null).isEmpty());
+ assertTrue(plan.getAdditions().query(QueryUtil.createIUQuery("org.eclipse.tptp.platform.iac.administrator"), null).isEmpty());
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PP2ShouldFailToInstall.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PP2ShouldFailToInstall.java
index 086a3127e..fab00c38d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PP2ShouldFailToInstall.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PP2ShouldFailToInstall.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IEngine;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PP2ShouldFailToInstall extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchFailingToInstall.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchFailingToInstall.java
index 465583654..faa92465c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchFailingToInstall.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchFailingToInstall.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IEngine;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchFailingToInstall extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest1.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest1.java
index 6dbbf4e43..b28ead542 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest1.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest1.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest1 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest10.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest10.java
index 4ed2d65ae..3bd114fac 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest10.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest10.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest10 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest11.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest11.java
index c336b57d7..0c05e8319 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest11.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest11.java
@@ -10,14 +10,14 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest11 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest12.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest12.java
index 794777875..677fc081b 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest12.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest12.java
@@ -10,18 +10,16 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.Set;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.director.Explanation;
+import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest12 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest13.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest13.java
index aecd75ada..cb8ff465e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest13.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest13.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest13 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest1b.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest1b.java
index 4327c53f5..15ce22bcc 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest1b.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest1b.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest1b extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest1c.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest1c.java
index e0a5daf91..d84718deb 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest1c.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest1c.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest1c extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest2.java
index 1e34ddad5..f11424879 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest2.java
@@ -10,18 +10,16 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.Set;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.director.Explanation;
+import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest2 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest3.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest3.java
index ce4d56648..bbc1f79cf 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest3.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest3.java
@@ -10,14 +10,14 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest3 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest4.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest4.java
index 1c53e88d8..1a2409a3e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest4.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest4.java
@@ -10,14 +10,14 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest4 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest5.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest5.java
index 19b4f8bb2..a1f3e0f09 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest5.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest5.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest5 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest6.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest6.java
index b5158b811..95a89fe65 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest6.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest6.java
@@ -10,18 +10,16 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.Set;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.director.Explanation;
+import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest6 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest7.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest7.java
index eaa016629..a6c93da70 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest7.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest7.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest7 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest7b.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest7b.java
index c165363c6..e038966f1 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest7b.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest7b.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest7b extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest8.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest8.java
index e8a18998a..51a6bd586 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest8.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest8.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest8 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest9.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest9.java
index fa9c57977..e799ea241 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest9.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTest9.java
@@ -10,18 +10,16 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.Set;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.director.Explanation;
+import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTest9 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestMultiplePatch.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestMultiplePatch.java
index 8a66e3415..b2c19b977 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestMultiplePatch.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestMultiplePatch.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IEngine;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTestMultiplePatch extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestMultiplePatch2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestMultiplePatch2.java
index 09d34bf03..55a73c155 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestMultiplePatch2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestMultiplePatch2.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTestMultiplePatch2 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestMultiplePatch3.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestMultiplePatch3.java
index e18d7128f..66296d9be 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestMultiplePatch3.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestMultiplePatch3.java
@@ -10,14 +10,14 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTestMultiplePatch3 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestOptional.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestOptional.java
index 861b444e9..5a4656f63 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestOptional.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestOptional.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IEngine;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTestOptional extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestOptional2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestOptional2.java
index e5faac04c..2d8a9ef23 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestOptional2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestOptional2.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IEngine;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTestOptional2 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestOptional3.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestOptional3.java
index ddfefbc59..c0e0174b9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestOptional3.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestOptional3.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IEngine;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTestOptional3 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUninstall.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUninstall.java
index b5dd777e8..f57318c9e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUninstall.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUninstall.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IEngine;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTestUninstall extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate.java
index e63b67a59..f94e10e41 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate.java
@@ -10,18 +10,16 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.util.Set;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.director.Explanation;
+import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTestUpdate extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate2.java
index 1498b0ec5..03cb146ae 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate2.java
@@ -10,14 +10,14 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTestUpdate2 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate3.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate3.java
index 3942f2919..2eaac0eaf 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate3.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate3.java
@@ -10,15 +10,15 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.net.URI;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTestUpdate3 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate4.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate4.java
index 949339b66..94e268313 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate4.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate4.java
@@ -10,14 +10,14 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTestUpdate4 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate5.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate5.java
index 8e11846c1..bc4990494 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate5.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PatchTestUpdate5.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IEngine;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class PatchTestUpdate5 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java
index 77f5e0f35..02442b3a7 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java
@@ -17,9 +17,7 @@ import org.eclipse.equinox.internal.p2.director.PermissiveSlicer;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
-import org.eclipse.equinox.p2.query.IQueryResult;
-import org.eclipse.equinox.p2.query.IQueryable;
+import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -35,36 +33,36 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
public void testSliceRCPOut() {
PermissiveSlicer slicer = new PermissiveSlicer(repo, new Properties(), true, false, true, false, false);
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
assertNotNull(result);
- queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor()));
- assertEquals(66, queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor())));
- assertEquals(1, queryResultSize(result.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor())));
+ queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()));
+ assertEquals(66, queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
+ assertEquals(1, queryResultSize(result.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor())));
// assertOK("1.0", slicer.getStatus());
}
//Test with and without optional pieces
public void testSliceRCPWithOptionalPieces() {
PermissiveSlicer slicer = new PermissiveSlicer(repo, new Properties(), false, false, true, false, false);
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
assertNotNull(result);
- queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor()));
- assertEquals(64, queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor())));
+ queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()));
+ assertEquals(64, queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
// assertOK("1.0", slicer.getStatus());
}
public void testSliceRCPWithIgnoringGreed() {
PermissiveSlicer slicer = new PermissiveSlicer(repo, new Properties(), false, true, true, false, false);
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
assertNotNull(result);
- queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor()));
- assertEquals(64, queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor())));
+ queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()));
+ assertEquals(64, queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
// assertOK("1.0", slicer.getStatus());
}
@@ -74,13 +72,13 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
p.setProperty("osgi.ws", "win32");
p.setProperty("osgi.arch", "x86");
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, true, false, false, false);
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
assertNotNull(result);
- queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor()));
- assertEquals(0, queryResultSize(result.query(new InstallableUnitQuery("org.eclipse.swt.motif.linux.x86"), new NullProgressMonitor())));
- assertEquals(34, queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor())));
+ queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()));
+ assertEquals(0, queryResultSize(result.query(QueryUtil.createIUQuery("org.eclipse.swt.motif.linux.x86"), new NullProgressMonitor())));
+ assertEquals(34, queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
// assertOK("1.0", slicer.getStatus());
}
@@ -90,25 +88,25 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
p.setProperty("osgi.ws", "win32");
p.setProperty("osgi.arch", "x86");
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, false, false, true, false);
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
assertNotNull(result);
- queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor()));
- assertEquals(0, queryResultSize(result.query(new InstallableUnitQuery("org.eclipse.ecf"), new NullProgressMonitor())));
- assertEquals(29, queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor())));
+ queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()));
+ assertEquals(0, queryResultSize(result.query(QueryUtil.createIUQuery("org.eclipse.ecf"), new NullProgressMonitor())));
+ assertEquals(29, queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
// assertOK("1.0", slicer.getStatus());
}
public void testExtractPlatformIndependentPieces() {
PermissiveSlicer slicer = new PermissiveSlicer(repo, new Properties(), true, false, false, false, false);
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
assertNotNull(result);
- queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor()));
- assertEquals(32, queryResultSize(result.query(InstallableUnitQuery.ANY, new NullProgressMonitor())));
- assertEquals(1, queryResultSize(result.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor())));
+ queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()));
+ assertEquals(32, queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
+ assertEquals(1, queryResultSize(result.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor())));
// assertOK("1.0", slicer.getStatus());
}
@@ -121,7 +119,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
PermissiveSlicer slicer = new PermissiveSlicer(createTestMetdataRepository(new IInstallableUnit[] {a, act1}), new Properties(), true, false, false, false, false);
IQueryable result = slicer.slice(new IInstallableUnit[] {a}, new NullProgressMonitor());
- assertEquals(1, queryResultSize(result.query(new InstallableUnitQuery("Action1"), null)));
+ assertEquals(1, queryResultSize(result.query(QueryUtil.createIUQuery("Action1"), null)));
}
public void testValidateIU() {
@@ -130,7 +128,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
p.setProperty("osgi.ws", "win32");
p.setProperty("osgi.arch", "x86");
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, false, false, true, false);
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.swt.cocoa.macosx"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.swt.cocoa.macosx"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
assertNull(slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()));
assertNotOK(slicer.getStatus());
@@ -151,18 +149,18 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
p.setProperty("osgi.ws", "win32");
p.setProperty("osgi.arch", "x86");
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, false, false, false, true);
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
- IQueryResult resultCollector = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()).query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ IQueryResult resultCollector = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()).query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor());
assertEquals(3, queryResultSize(resultCollector));
}
public void testExtractOnlyPlatformSpecific() {
Properties p = new Properties();
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, false, true, false, true);
- IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
- IQueryResult resultCollector = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()).query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ IQueryResult resultCollector = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()).query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor());
assertEquals(35, queryResultSize(resultCollector));
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ProvisioningPlanQueryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ProvisioningPlanQueryTest.java
index f653eab69..f14552cad 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ProvisioningPlanQueryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ProvisioningPlanQueryTest.java
@@ -13,34 +13,34 @@ package org.eclipse.equinox.p2.tests.planner;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.p2.engine.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class ProvisioningPlanQueryTest extends AbstractProvisioningTest {
public void testNull() {
- IQueryResult c = new ProvisioningPlan(Status.OK_STATUS, null, null, null).getAdditions().query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ IQueryResult c = new ProvisioningPlan(Status.OK_STATUS, null, null, null).getAdditions().query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor());
assertTrue(c.isEmpty());
}
public void testAddition() {
Operand[] ops = new Operand[] {new InstallableUnitOperand(null, createIU("A"))};
- IQueryResult c = new ProvisioningPlan(null, ops, null).getAdditions().query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ IQueryResult c = new ProvisioningPlan(null, ops, null).getAdditions().query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor());
assertEquals(1, queryResultSize(c));
- assertTrue(new ProvisioningPlan(null, ops, null).getRemovals().query(InstallableUnitQuery.ANY, new NullProgressMonitor()).isEmpty());
+ assertTrue(new ProvisioningPlan(null, ops, null).getRemovals().query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()).isEmpty());
}
public void testRemoval() {
Operand[] ops = new Operand[] {new InstallableUnitOperand(createIU("A"), null)};
- IQueryResult c = new ProvisioningPlan(null, ops, null).getRemovals().query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ IQueryResult c = new ProvisioningPlan(null, ops, null).getRemovals().query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor());
assertEquals(1, queryResultSize(c));
- assertTrue(new ProvisioningPlan(null, ops, null).getAdditions().query(InstallableUnitQuery.ANY, new NullProgressMonitor()).isEmpty());
+ assertTrue(new ProvisioningPlan(null, ops, null).getAdditions().query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()).isEmpty());
}
public void testUpdate() {
Operand[] ops = new Operand[] {new InstallableUnitOperand(createIU("A"), createIU("B"))};
- IQueryResult c = new ProvisioningPlan(null, ops, null).getRemovals().query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ IQueryResult c = new ProvisioningPlan(null, ops, null).getRemovals().query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor());
assertEquals(1, queryResultSize(c));
- assertEquals(1, queryResultSize(new ProvisioningPlan(null, ops, null).getAdditions().query(InstallableUnitQuery.ANY, new NullProgressMonitor())));
+ assertEquals(1, queryResultSize(new ProvisioningPlan(null, ops, null).getAdditions().query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SDKPatchingTest1.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SDKPatchingTest1.java
index 219bcf557..f54d22d5b 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SDKPatchingTest1.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SDKPatchingTest1.java
@@ -10,18 +10,18 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.io.File;
import java.util.ArrayList;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SDKPatchingTest1 extends AbstractProvisioningTest {
@@ -38,7 +38,7 @@ public class SDKPatchingTest1 extends AbstractProvisioningTest {
profile = registry.getProfile("SDKPatchingTest");
assertNotNull(profile);
- MetadataFactory.InstallableUnitDescription newCommon = createIUDescriptor((IInstallableUnit) profile.query(new InstallableUnitQuery("org.eclipse.equinox.common"), new NullProgressMonitor()).iterator().next());
+ MetadataFactory.InstallableUnitDescription newCommon = createIUDescriptor((IInstallableUnit) profile.query(QueryUtil.createIUQuery("org.eclipse.equinox.common"), new NullProgressMonitor()).iterator().next());
Version newVersionCommon = Version.createOSGi(3, 5, 0, "zeNewVersion");
changeVersion(newCommon, newVersionCommon);
newIUs.add(MetadataFactory.createInstallableUnit(newCommon));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SDKPatchingTest2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SDKPatchingTest2.java
index b78202d0f..a4324e234 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SDKPatchingTest2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SDKPatchingTest2.java
@@ -10,18 +10,18 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.io.File;
import java.util.ArrayList;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SDKPatchingTest2 extends AbstractProvisioningTest {
@@ -40,7 +40,7 @@ public class SDKPatchingTest2 extends AbstractProvisioningTest {
assertNotNull(profile);
//create a patch to install a new version of jdt.launching
- MetadataFactory.InstallableUnitDescription newJDTLaunching = createIUDescriptor((IInstallableUnit) profile.query(new InstallableUnitQuery("org.eclipse.jdt.launching"), new NullProgressMonitor()).iterator().next());
+ MetadataFactory.InstallableUnitDescription newJDTLaunching = createIUDescriptor((IInstallableUnit) profile.query(QueryUtil.createIUQuery("org.eclipse.jdt.launching"), new NullProgressMonitor()).iterator().next());
Version newJDTLaunchingVersion = Version.createOSGi(3, 5, 0, "zeNewVersion");
changeVersion(newJDTLaunching, newJDTLaunchingVersion);
newIUs.add(MetadataFactory.createInstallableUnit(newJDTLaunching));
@@ -52,7 +52,7 @@ public class SDKPatchingTest2 extends AbstractProvisioningTest {
newIUs.add(patchInstallingJDTLaunching);
//create a patch to install a new version of jdt.debug.ui
- MetadataFactory.InstallableUnitDescription newDebugUI = createIUDescriptor((IInstallableUnit) profile.query(new InstallableUnitQuery("org.eclipse.jdt.debug.ui"), new NullProgressMonitor()).iterator().next());
+ MetadataFactory.InstallableUnitDescription newDebugUI = createIUDescriptor((IInstallableUnit) profile.query(QueryUtil.createIUQuery("org.eclipse.jdt.debug.ui"), new NullProgressMonitor()).iterator().next());
Version newDebugVersion = Version.createOSGi(3, 3, 0, "zeNewVersion");
changeVersion(newDebugUI, newDebugVersion);
newIUs.add(MetadataFactory.createInstallableUnit(newDebugUI));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SWTFragment.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SWTFragment.java
index d3b9c032d..2124d3b0b 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SWTFragment.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SWTFragment.java
@@ -10,16 +10,15 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.Collector;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SWTFragment extends AbstractProvisioningTest {
@@ -51,8 +50,8 @@ public class SWTFragment extends AbstractProvisioningTest {
IProvisioningPlan plan = planner.getProvisioningPlan(req, null, null);
assertOK("plan", plan.getStatus());
Collector c = new Collector();
- c.addAll(plan.getAdditions().query(new InstallableUnitQuery("SWT"), null));
- c.addAll(plan.getAdditions().query(new InstallableUnitQuery("SWT.WIN32"), null));
+ c.addAll(plan.getAdditions().query(QueryUtil.createIUQuery("SWT"), null));
+ c.addAll(plan.getAdditions().query(QueryUtil.createIUQuery("SWT.WIN32"), null));
assertEquals(2, c.size());
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies.java
index 5af37e424..ad85e0af0 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SeveralOptionalDependencies extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies2.java
index e79d2a29e..0ace9032c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies2.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SeveralOptionalDependencies2 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies3.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies3.java
index 642ddb544..b7f17a1d8 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies3.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies3.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SeveralOptionalDependencies3 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies4.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies4.java
index aa1145f00..d9e4faf48 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies4.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies4.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SeveralOptionalDependencies4 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies5.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies5.java
index 12218dbff..bd3623606 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies5.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SeveralOptionalDependencies5.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SeveralOptionalDependencies5 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest.java
index 26608fa48..cf8c4a579 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SimpleOptionalTest extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest2.java
index 1987c1ca7..756c81c1e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest2.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SimpleOptionalTest2 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest3.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest3.java
index ea92c9bea..fb429f971 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest3.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest3.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SimpleOptionalTest3 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest4.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest4.java
index d2dba8f8e..37c05dc42 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest4.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest4.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
@@ -17,6 +15,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SimpleOptionalTest4 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest5.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest5.java
index 1dd586d35..a2d47b656 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest5.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleOptionalTest5.java
@@ -10,13 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SimpleOptionalTest5 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleSingleton.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleSingleton.java
index 524909dab..15ed5d02f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleSingleton.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimpleSingleton.java
@@ -10,17 +10,15 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
-
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.director.Explanation;
+import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SimpleSingleton extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimulatedSharedInstallTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimulatedSharedInstallTest.java
index 600e6b1f2..9be39863c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimulatedSharedInstallTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimulatedSharedInstallTest.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import java.net.URI;
import java.util.*;
import org.eclipse.core.runtime.*;
@@ -21,7 +19,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -54,7 +52,7 @@ public class SimulatedSharedInstallTest extends AbstractProvisioningTest {
final ProvisioningContext context = new ProvisioningContext(new URI[0]);
IProvisioningPlan plan = planner.getProvisioningPlan(request, context, new NullProgressMonitor());
assertEquals(IStatus.OK, engine.perform(plan, new NullProgressMonitor()).getSeverity());
- assertContains(profile.query(InstallableUnitQuery.ANY, null), a1);
+ assertContains(profile.query(QueryUtil.createIUAnyQuery(), null), a1);
ProfileChangeRequest req = new ProfileChangeRequest(profile);
req.removeInstallableUnits(new IInstallableUnit[] {a1});
@@ -62,7 +60,7 @@ public class SimulatedSharedInstallTest extends AbstractProvisioningTest {
IProvisioningPlan plan2 = planner.getProvisioningPlan(req, null, null);
assertEquals(IStatus.OK, plan2.getStatus().getSeverity());
assertEquals(IStatus.OK, PlanExecutionHelper.executePlan(plan2, engine, context, new NullProgressMonitor()).getSeverity());
- assertNotContains(profile.query(InstallableUnitQuery.ANY, null), a1);
+ assertNotContains(profile.query(QueryUtil.createIUAnyQuery(), null), a1);
}
public void testAvailableVsQueryInProfile() {
@@ -73,7 +71,7 @@ public class SimulatedSharedInstallTest extends AbstractProvisioningTest {
final ProvisioningContext context = new ProvisioningContext(new URI[0]);
IProvisioningPlan plan = planner.getProvisioningPlan(request, context, new NullProgressMonitor());
assertEquals(IStatus.OK, engine.perform(plan, new NullProgressMonitor()).getSeverity());
- assertContains(profile.query(InstallableUnitQuery.ANY, null), c1);
+ assertContains(profile.query(QueryUtil.createIUAnyQuery(), null), c1);
IProfile availableWrapper = new IProfile() {
public IQueryResult<IInstallableUnit> available(IQuery<IInstallableUnit> query, IProgressMonitor monitor) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SingletonOptionallyInstalled.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SingletonOptionallyInstalled.java
index 23361ee1a..4edbfac3d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SingletonOptionallyInstalled.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SingletonOptionallyInstalled.java
@@ -10,13 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SingletonOptionallyInstalled extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SingletonOptionallyInstalled2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SingletonOptionallyInstalled2.java
index 5e048cf72..3d71179d2 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SingletonOptionallyInstalled2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SingletonOptionallyInstalled2.java
@@ -10,13 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
+import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SingletonOptionallyInstalled2 extends AbstractProvisioningTest {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/TwoVersionsOfWSDL.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/TwoVersionsOfWSDL.java
index 40d52fe24..3f43f7327 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/TwoVersionsOfWSDL.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/TwoVersionsOfWSDL.java
@@ -8,15 +8,15 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.p2.planner.IPlanner;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.equinox.internal.provisional.p2.director.*;
+import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
+import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.VersionRange;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.planner.IPlanner;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -32,8 +32,8 @@ public class TwoVersionsOfWSDL extends AbstractProvisioningTest {
super.setUp();
IMetadataRepositoryManager repoMan = (IMetadataRepositoryManager) getAgent().getService(IMetadataRepositoryManager.SERVICE_NAME);
IMetadataRepository repo = repoMan.loadRepository(getTestData("repository for wsdl test", "testData/metadataRepo/wsdlTestRepo/").toURI(), new NullProgressMonitor());
- wsdl15 = repo.query(new InstallableUnitQuery("javax.wsdl", new VersionRange("[1.5, 1.6)")), null).iterator().next();
- wsdl14 = repo.query(new InstallableUnitQuery("javax.wsdl", new VersionRange("[1.4, 1.5)")), null).iterator().next();
+ wsdl15 = repo.query(QueryUtil.createIUQuery("javax.wsdl", new VersionRange("[1.5, 1.6)")), null).iterator().next();
+ wsdl14 = repo.query(QueryUtil.createIUQuery("javax.wsdl", new VersionRange("[1.4, 1.5)")), null).iterator().next();
profile1 = createProfile("TestProfile." + getName());
planner = createPlanner();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/UninstallEverything.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/UninstallEverything.java
index ed911c968..f1f5b321e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/UninstallEverything.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/UninstallEverything.java
@@ -14,7 +14,7 @@ import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class UninstallEverything extends AbstractProvisioningTest {
@@ -41,7 +41,7 @@ public class UninstallEverything extends AbstractProvisioningTest {
ProfileChangeRequest req2 = new ProfileChangeRequest(profile);
req2.removeInstallableUnits(new IInstallableUnit[] {a});
assertEquals(IStatus.OK, director.provision(req2, null, null).getSeverity());
- assertNotIUs(new IInstallableUnit[] {a}, profile.query(InstallableUnitQuery.ANY, null).iterator());
+ assertNotIUs(new IInstallableUnit[] {a}, profile.query(QueryUtil.createIUAnyQuery(), null).iterator());
}
}
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 17d8dab2d..16efaa492 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
@@ -16,8 +16,8 @@ import org.eclipse.equinox.internal.p2.metadata.RequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.FragmentQuery;
import org.eclipse.equinox.p2.publisher.eclipse.AdviceFileParser;
+import org.eclipse.equinox.p2.query.QueryUtil;
public class AdviceFileParserTest extends TestCase {
public void testNoAdvice() {
@@ -269,7 +269,7 @@ public class AdviceFileParserTest extends TestCase {
assertEquals("testid0", iu0.getId());
assertEquals(Version.create("1.2.3"), iu0.getVersion());
assertFalse(iu0.isSingleton());
- assertFalse(FragmentQuery.isFragment(iu0));
+ assertFalse(QueryUtil.isFragment(iu0));
assertEquals(0, iu0.getArtifacts().size());
assertEquals(null, iu0.getCopyright());
assertEquals(null, iu0.getFilter());
@@ -364,7 +364,7 @@ public class AdviceFileParserTest extends TestCase {
assertEquals(2, iu1.getUpdateDescriptor().getSeverity());
assertEquals("some description", iu1.getUpdateDescriptor().getDescription());
- assertTrue(FragmentQuery.isFragment(iu1));
+ assertTrue(QueryUtil.isFragment(iu1));
IRequirement[] hostRequired = ((IInstallableUnitFragment) iu1).getHost();
assertEquals(2, hostRequired.length);
assertEquals("testNamespace1", RequiredCapability.extractNamespace(hostRequired[0].getMatches()));
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 1adee224d..35d271c67 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
@@ -22,12 +22,12 @@ import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
import org.eclipse.equinox.internal.p2.metadata.TranslationSupport;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
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.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
import org.eclipse.equinox.p2.tests.TestActivator;
import org.eclipse.equinox.p2.tests.TestData;
@@ -118,7 +118,7 @@ public class BundlesActionTest extends ActionTest {
ius = results.getIUs(null, null);
assertEquals("2.0", 1, ius.size());
QueryableArray queryableArray = new QueryableArray((IInstallableUnit[]) ius.toArray(new IInstallableUnit[ius.size()]));
- IQueryResult result = queryableArray.query(new InstallableUnitQuery("foo"), null);
+ IQueryResult result = queryableArray.query(QueryUtil.createIUQuery("foo"), null);
assertEquals("3.1", 1, queryResultSize(result));
IInstallableUnit iu = (IInstallableUnit) result.iterator().next();
TranslationSupport utils = new TranslationSupport();
@@ -130,7 +130,7 @@ public class BundlesActionTest extends ActionTest {
ius = results.getIUs(null, null);
assertEquals("2.0", 3, ius.size());
queryableArray = new QueryableArray((IInstallableUnit[]) ius.toArray(new IInstallableUnit[ius.size()]));
- result = queryableArray.query(new InstallableUnitQuery("foo"), null);
+ result = queryableArray.query(QueryUtil.createIUQuery("foo"), null);
assertEquals("2.1", 1, queryResultSize(result));
iu = (IInstallableUnit) result.iterator().next();
utils.setTranslationSource(queryableArray);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalizationTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalizationTests.java
index 5a69e5c5a..a9c32c38e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalizationTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalizationTests.java
@@ -19,12 +19,12 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.metadata.TranslationSupport;
import org.eclipse.equinox.internal.p2.updatesite.SiteXMLAction;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.publisher.PublisherInfo;
import org.eclipse.equinox.p2.publisher.PublisherResult;
import org.eclipse.equinox.p2.publisher.eclipse.BundlesAction;
import org.eclipse.equinox.p2.publisher.eclipse.FeaturesAction;
import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.tests.TestData;
/**
@@ -38,7 +38,7 @@ public class LocalizationTests extends TestCase {
private TranslationSupport getTranslationSupport() {
TranslationSupport utils = new TranslationSupport();
- utils.setTranslationSource(results.query(new InstallableUnitQuery((String) null), monitor));
+ utils.setTranslationSource(results.query(QueryUtil.createIUQuery((String) null), monitor));
return utils;
}
@@ -57,7 +57,7 @@ public class LocalizationTests extends TestCase {
BundlesAction action = new BundlesAction(new File[] {file});
action.perform(info, results, monitor);
TranslationSupport utils = getTranslationSupport();
- IQueryResult queryResult = results.query(new InstallableUnitQuery("foobundle"), monitor);
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("foobundle"), monitor);
IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo German Bundle", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN.toString()));
assertEquals("1.1", "Foo German Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN.toString()));
@@ -68,7 +68,7 @@ public class LocalizationTests extends TestCase {
BundlesAction action = new BundlesAction(new File[] {file});
action.perform(info, results, monitor);
TranslationSupport utils = getTranslationSupport();
- IQueryResult queryResult = results.query(new InstallableUnitQuery("barbundle"), monitor);
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("barbundle"), monitor);
IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Bar German Bundle", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN.toString()));
assertEquals("1.1", "Bar German Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN.toString()));
@@ -81,7 +81,7 @@ public class LocalizationTests extends TestCase {
action.perform(info, results, monitor);
TranslationSupport utils = getTranslationSupport();
- IQueryResult queryResult = results.query(new InstallableUnitQuery("barbundle2"), monitor);
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("barbundle2"), monitor);
IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Bar German Bundle - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN.toString()));
assertEquals("1.1", "Bar German Provider - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN.toString()));
@@ -94,7 +94,7 @@ public class LocalizationTests extends TestCase {
action.perform(info, results, monitor);
TranslationSupport utils = getTranslationSupport();
- IQueryResult queryResult = results.query(new InstallableUnitQuery("foobundle2"), monitor);
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("foobundle2"), monitor);
IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo German Bundle - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN.toString()));
assertEquals("1.1", "Foo German Provider - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN.toString()));
@@ -105,7 +105,7 @@ public class LocalizationTests extends TestCase {
BundlesAction action = new BundlesAction(new File[] {file});
action.perform(info, results, monitor);
TranslationSupport utils = getTranslationSupport();
- IQueryResult queryResult = results.query(new InstallableUnitQuery("foobundle"), monitor);
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("foobundle"), monitor);
IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo English Bundle", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.ENGLISH.toString()));
assertEquals("1.1", "Foo English Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH.toString()));
@@ -116,7 +116,7 @@ public class LocalizationTests extends TestCase {
BundlesAction action = new BundlesAction(new File[] {file});
action.perform(info, results, monitor);
TranslationSupport utils = getTranslationSupport();
- IQueryResult queryResult = results.query(new InstallableUnitQuery("barbundle"), monitor);
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("barbundle"), monitor);
IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Bar English Bundle", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.ENGLISH.toString()));
assertEquals("1.1", "Bar English Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH.toString()));
@@ -129,7 +129,7 @@ public class LocalizationTests extends TestCase {
action.perform(info, results, monitor);
TranslationSupport utils = getTranslationSupport();
- IQueryResult queryResult = results.query(new InstallableUnitQuery("barbundle2"), monitor);
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("barbundle2"), monitor);
IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Bar English Bundle - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.ENGLISH.toString()));
assertEquals("1.1", "Bar English Provider - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH.toString()));
@@ -142,7 +142,7 @@ public class LocalizationTests extends TestCase {
action.perform(info, results, monitor);
TranslationSupport utils = getTranslationSupport();
- IQueryResult queryResult = results.query(new InstallableUnitQuery("foobundle2"), monitor);
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("foobundle2"), monitor);
IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo English Bundle - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.ENGLISH.toString()));
assertEquals("1.1", "Foo English Provider - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH.toString()));
@@ -153,7 +153,7 @@ public class LocalizationTests extends TestCase {
FeaturesAction featuresAction = new FeaturesAction(new File[] {file});
featuresAction.perform(info, results, monitor);
TranslationSupport utils = getTranslationSupport();
- IQueryResult queryResult = results.query(new InstallableUnitQuery("fooFeature.feature.jar"), monitor);
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("fooFeature.feature.jar"), monitor);
IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo German Feature", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN.toString()));
assertEquals("1.1", "Foo German Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN.toString()));
@@ -167,7 +167,7 @@ public class LocalizationTests extends TestCase {
FeaturesAction featuresAction = new FeaturesAction(new File[] {file});
featuresAction.perform(info, results, monitor);
TranslationSupport utils = getTranslationSupport();
- IQueryResult queryResult = results.query(new InstallableUnitQuery("fooFeature.feature.jar"), monitor);
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("fooFeature.feature.jar"), monitor);
IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo English Feature", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME));
assertEquals("1.1", "Foo English Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER));
@@ -181,7 +181,7 @@ public class LocalizationTests extends TestCase {
FeaturesAction featuresAction = new FeaturesAction(new File[] {file});
featuresAction.perform(info, results, monitor);
TranslationSupport utils = getTranslationSupport();
- IQueryResult queryResult = results.query(new InstallableUnitQuery("fooFeature.feature.jar"), monitor);
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("fooFeature.feature.jar"), monitor);
IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo English Feature", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.ENGLISH.toString()));
assertEquals("1.1", "Foo English Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH.toString()));
@@ -195,7 +195,7 @@ public class LocalizationTests extends TestCase {
FeaturesAction featuresAction = new FeaturesAction(new File[] {file});
featuresAction.perform(info, results, monitor);
TranslationSupport utils = getTranslationSupport();
- IQueryResult queryResult = results.query(new InstallableUnitQuery("fooFeature.feature.group"), monitor);
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("fooFeature.feature.group"), monitor);
IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo German Feature", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN.toString()));
assertEquals("1.1", "Foo German Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN.toString()));
@@ -209,7 +209,7 @@ public class LocalizationTests extends TestCase {
FeaturesAction featuresAction = new FeaturesAction(new File[] {file});
featuresAction.perform(info, results, monitor);
TranslationSupport utils = getTranslationSupport();
- IQueryResult queryResult = results.query(new InstallableUnitQuery("fooFeature.feature.group"), monitor);
+ IQueryResult queryResult = results.query