Plugin test = Plugin.factory("test");
File file = testFolder.newFile("test-1.0.jar");
file.createNewFile();
- Release test10 = new Release(test, "1.0").setDownloadUrl("file://" + separatorsToUnix(file.getCanonicalPath()));
+ Release test10 = new Release(test, "1.0").setDownloadUrl("file://" + separatorsToUnix(file.getAbsolutePath()));
test.addRelease(test10);
when(updateCenter.findInstallablePlugins("foo", create("1.0"))).thenReturn(newArrayList(test10));
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
+import java.nio.file.LinkOption;
import java.nio.file.Path;
import org.junit.Rule;
import org.junit.Test;
assertThat(module.key()).isEqualTo("moduleKey");
assertThat(module.definition()).isEqualTo(def);
- assertThat(module.getBaseDir()).isEqualTo(baseDir.toPath());
+ assertThat(module.getBaseDir())
+ .isEqualTo(baseDir.toPath().toRealPath(LinkOption.NOFOLLOW_LINKS));
assertThat(module.getWorkDir()).isEqualTo(workDir.toPath());
assertThat(module.getEncoding()).isEqualTo(Charset.defaultCharset());
- assertThat(module.getSourceDirsOrFiles().get()).containsExactlyInAnyOrder(src);
- assertThat(module.getTestDirsOrFiles().get()).containsExactlyInAnyOrder(test);
+ assertThat(module.getSourceDirsOrFiles().get()).containsExactlyInAnyOrder(src.toRealPath(LinkOption.NOFOLLOW_LINKS));
+ assertThat(module.getTestDirsOrFiles().get()).containsExactlyInAnyOrder(test.toRealPath(LinkOption.NOFOLLOW_LINKS));
assertThat(module.getEncoding()).isEqualTo(Charset.defaultCharset());
assertThat(module.isFile()).isFalse();
assertThat(module.key()).isEqualTo("moduleKey");
assertThat(module.definition()).isEqualTo(def);
- assertThat(module.getBaseDir()).isEqualTo(baseDir.toPath());
+ assertThat(module.getBaseDir()).isEqualTo(baseDir.toPath().toRealPath(LinkOption.NOFOLLOW_LINKS));
assertThat(module.getWorkDir()).isEqualTo(workDir.toPath());
assertThat(module.getEncoding()).isEqualTo(Charset.defaultCharset());
assertThat(module.getSourceDirsOrFiles()).isNotPresent();
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
+import java.nio.file.LinkOption;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
assertThat(project.getName()).isEqualTo("projectName");
assertThat(project.getOriginalName()).isEqualTo("projectName");
assertThat(project.definition()).isEqualTo(def);
- assertThat(project.getBaseDir()).isEqualTo(baseDir.toPath());
+ assertThat(project.getBaseDir()).isEqualTo(baseDir.toPath().toRealPath(LinkOption.NOFOLLOW_LINKS));
assertThat(project.getDescription()).isEqualTo("desc");
assertThat(project.getWorkDir()).isEqualTo(workDir.toPath());
assertThat(project.getEncoding()).isEqualTo(Charset.defaultCharset());
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
+import java.nio.file.LinkOption;
import org.apache.commons.io.IOUtils;
import org.junit.Rule;
import org.junit.Test;
File baseDir = temp.newFolder();
AbstractProjectOrModule module = TestInputFileBuilder.newDefaultInputModule("key", baseDir);
assertThat(module.key()).isEqualTo("key");
- assertThat(module.getBaseDir()).isEqualTo(baseDir.toPath());
+ assertThat(module.getBaseDir()).isEqualTo(baseDir.toPath().toRealPath(LinkOption.NOFOLLOW_LINKS));
}
}