Fix Spring 4.2.x features itest
@@ -18,14 +18,36 @@ import org.apache.karaf.itests.KarafTestSupport;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.MavenUtils;
+import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
+
@RunWith(PaxExam.class)
@ExamReactorStrategy(PerClass.class)
public class Spring42FeaturesTest extends KarafTestSupport {
+ @Configuration
+ public Option[] config() {
+ String version = MavenUtils.getArtifactVersion("org.apache.karaf", "apache-karaf");
+ List<Option> result = new LinkedList<>(Arrays.asList(super.config()));
+ result.add(editConfigurationFilePut("etc/org.apache.karaf.features.cfg", "featuresRepositories",
+ "mvn:org.apache.karaf.features/framework/" + version + "/xml/features, " +
+ "mvn:org.apache.karaf.features/spring/" + version + "/xml/features, " +
+ "mvn:org.apache.karaf.features/spring-legacy/" + version + "/xml/features, " +
+ "mvn:org.apache.karaf.features/enterprise/" + version + "/xml/features, " +
+ "mvn:org.apache.karaf.features/enterprise-legacy/" + version + "/xml/features, " +
+ "mvn:org.apache.karaf.features/standard/" + version + "/xml/features"));
+ return result.toArray(new Option[result.size()]);
+ }
@Test
public void installSpringFeature() throws Exception {
