Fixing test path assumptions on OSX

This commit is contained in:
Joakim Erdfelt 2015-04-30 17:20:01 -07:00
parent 0a16705947
commit 2fce87ee2f
5 changed files with 16 additions and 9 deletions

View File

@ -64,7 +64,14 @@ public class StartIni extends TextFile
@Override
public void init()
{
basedir = getFile().getParent().toAbsolutePath();
try
{
basedir = getFile().getParent().toRealPath();
}
catch (IOException e)
{
basedir = getFile().getParent().normalize().toAbsolutePath();
}
}
public Path getBaseDir()

View File

@ -73,7 +73,7 @@ public class ConfigSources implements Iterable<ConfigSource>
{
String ref = getValue(arg.getLine());
String dirName = props.expand(ref);
Path dir = FS.toPath(dirName);
Path dir = FS.toPath(dirName).normalize().toAbsolutePath();
DirConfigSource dirsource = new DirConfigSource(ref,dir,sourceWeight.incrementAndGet(),true);
add(dirsource);
}

View File

@ -100,7 +100,7 @@ public class DirConfigSource implements ConfigSource
if (canHaveArgs)
{
Path iniFile = dir.resolve("start.ini");
Path iniFile = dir.resolve("start.ini").toRealPath();
if (FS.canReadFile(iniFile))
{
StartIni ini = new StartIni(iniFile);

View File

@ -53,7 +53,7 @@ public class ConfigurationAssert
*/
public static void assertConfiguration(BaseHome baseHome, StartArgs args, String filename) throws FileNotFoundException, IOException
{
Path testResourcesDir = MavenTestingUtils.getTestResourcesDir().toPath().toAbsolutePath();
Path testResourcesDir = MavenTestingUtils.getTestResourcesDir().toPath().toRealPath();
File file = MavenTestingUtils.getTestResourceFile(filename);
TextFile textFile = new TextFile(file.toPath());

View File

@ -18,7 +18,7 @@
package org.eclipse.jetty.start;
import java.io.File;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
@ -65,13 +65,13 @@ public class TestUseCases
@Test
public void testUseCase() throws Exception
{
File homeDir = MavenTestingUtils.getTestResourceDir("dist-home");
File baseDir = MavenTestingUtils.getTestResourceDir("usecases/" + caseName);
Path homeDir = MavenTestingUtils.getTestResourceDir("dist-home").toPath().toRealPath();
Path baseDir = MavenTestingUtils.getTestResourceDir("usecases/" + caseName).toPath().toRealPath();
Main main = new Main();
List<String> cmdLine = new ArrayList<>();
cmdLine.add("jetty.home=" + homeDir.getAbsolutePath());
cmdLine.add("jetty.base=" + baseDir.getAbsolutePath());
cmdLine.add("jetty.home=" + homeDir.toString());
cmdLine.add("jetty.base=" + baseDir.toString());
// cmdLine.add("--debug");
if (commandLineArgs != null)