use PathUtils for unpackDirectory
authorOliver Lietz <olli@apache.org>
Thu, 26 Jan 2017 20:09:49 +0000 (20:09 +0000)
committerOliver Lietz <olli@apache.org>
Thu, 26 Jan 2017 20:09:49 +0000 (20:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1780466 13f79535-47bb-0310-9956-ffa450edef68

src/main/java/org/apache/sling/karaf/testing/KarafTestSupport.java

index 3457c47..6f74087 100644 (file)
@@ -28,6 +28,7 @@ import org.apache.karaf.features.BootFinished;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
 import org.ops4j.pax.exam.util.Filter;
+import org.ops4j.pax.exam.util.PathUtils;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
@@ -128,12 +129,13 @@ public abstract class KarafTestSupport {
         final int rmiServerPort = findFreePort();
         final int sshPort = findFreePort();
         final int httpPort = findFreePort();
+        final String unpackDirectory = String.format("%s/target/paxexam/%s", PathUtils.getBaseDir(), getClass().getSimpleName());
         return options(
             karafDistributionConfiguration()
                 .frameworkUrl(maven().groupId(karafGroupId()).artifactId(karafArtifactId()).versionAsInProject().type("tar.gz"))
                 .useDeployFolder(false)
                 .name(karafName())
-                .unpackDirectory(new File("target/paxexam/" + getClass().getSimpleName())),
+                .unpackDirectory(new File(unpackDirectory)),
             keepRuntimeFolder(),
             editConfigurationFilePut("etc/org.apache.sling.jcr.base.internal.LoginAdminWhitelist.config", "whitelist.bundles.regexp", "^PAXEXAM.*$"),
             editConfigurationFilePut("etc/org.ops4j.pax.logging.cfg", "log4j2.rootLogger.level", "DEBUG"),