SLING-2847 : Installer integration tests fail due to unresolvable
authorRobert Munteanu <rombert@apache.org>
Tue, 30 Apr 2013 23:17:37 +0000 (23:17 +0000)
committerRobert Munteanu <rombert@apache.org>
Tue, 30 Apr 2013 23:17:37 +0000 (23:17 +0000)
artifacts

Since pax-exam does not support the maven.repo.local system property,
add support for it in OsgiInstallerTestBase.

git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1477870 13f79535-47bb-0310-9956-ffa450edef68

src/test/java/org/apache/sling/installer/it/OsgiInstallerTestBase.java

index 1bf5ed7..0c45c14 100644 (file)
@@ -24,6 +24,7 @@ import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.options;
 import static org.ops4j.pax.exam.CoreOptions.provision;
 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+import static org.ops4j.pax.exam.CoreOptions.when;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -39,6 +40,7 @@ import javax.inject.Inject;
 
 import org.apache.sling.installer.api.InstallableResource;
 import org.apache.sling.installer.api.OsgiInstaller;
+import org.ops4j.pax.exam.CoreOptions;
 import org.ops4j.pax.exam.Option;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -391,8 +393,13 @@ class OsgiInstallerTestBase implements FrameworkListener {
                vmOpt += " -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=" + paxDebugPort;
        }
 
+       String localRepo = System.getProperty("maven.repo.local", "");
+
        return options(
                 junitBundles(),
+                when( localRepo.length() > 0 ).useOptions(
+                        systemProperty("org.ops4j.pax.url.mvn.localRepository").value(localRepo)
+                ),
                 systemProperty( "org.ops4j.pax.logging.DefaultServiceLog.level" ).value(paxDebugLevel),
                 provision(
                            mavenBundle("org.apache.felix", "org.apache.felix.scr", "1.6.0"),