use of org.apache.karaf.features.internal.model.processing.BundleReplacements in project karaf by apache.
the class FeaturesProcessorTest method readingLegacyOverrides.
@Test
public void readingLegacyOverrides() {
FeaturesProcessorImpl processor = new FeaturesProcessorImpl(new FeaturesServiceConfig("file:src/test/resources/org/apache/karaf/features/internal/service/overrides2.properties", null, null, null));
FeaturesProcessing instructions = processor.getInstructions();
BundleReplacements bundleReplacements = instructions.getBundleReplacements();
assertThat(bundleReplacements.getOverrideBundles().size(), equalTo(5));
BundleReplacements.OverrideBundle o1 = bundleReplacements.getOverrideBundles().get(0);
assertThat(o1.getOriginalUri(), equalTo("mvn:org.apache.karaf.admin/org.apache.karaf.admin.command/[2.3.0,2.3.0.61033X)"));
assertThat(o1.getReplacement(), equalTo("mvn:org.apache.karaf.admin/org.apache.karaf.admin.command/2.3.0.61033X"));
BundleReplacements.OverrideBundle o2 = bundleReplacements.getOverrideBundles().get(1);
assertThat(o2.getOriginalUri(), equalTo("mvn:org.apache.karaf.admin/org.apache.karaf.admin.core/[2.2.0,2.4.0)"));
assertThat(o2.getReplacement(), equalTo("mvn:org.apache.karaf.admin/org.apache.karaf.admin.core/2.3.0.61033X"));
BundleReplacements.OverrideBundle o3 = bundleReplacements.getOverrideBundles().get(2);
assertThat(o3.getOriginalUri(), equalTo("mvn:org.apache.karaf.admin/org.apache.karaf.admin.resources/[2.3.0,2.3.14)"));
assertThat(o3.getReplacement(), equalTo("mvn:org.apache.karaf.admin/org.apache.karaf.admin.resources/2.3.14"));
BundleReplacements.OverrideBundle o4 = bundleReplacements.getOverrideBundles().get(3);
assertThat(o4.getOriginalUri(), equalTo("mvn:org.apache.karaf.admin/org.apache.karaf.admin.kernel/[2.0.0,2.0.0]"));
assertThat(o4.getReplacement(), equalTo("mvn:org.apache.karaf.admin/org.apache.karaf.admin.kernel/2.3.14"));
BundleReplacements.OverrideBundle o5 = bundleReplacements.getOverrideBundles().get(4);
assertThat(o5.getOriginalUri(), equalTo("mvn:org.apache.karaf.admin/org.apache.karaf.admin.infinity/[1.0.0,*)"));
assertThat(o5.getReplacement(), equalTo("mvn:org.apache.karaf.admin/org.apache.karaf.admin.infinity/2.3.14"));
}
Aggregations