2
0
Fork 0
mirror of https://github.com/ethauvin/bld.git synced 2025-04-26 08:37:11 -07:00

More Windows tweaks

This commit is contained in:
Geert Bevin 2023-10-01 14:42:04 -04:00
parent 35887e7d06
commit 7face792f2
2 changed files with 19 additions and 1 deletions

View file

@ -5,6 +5,8 @@
package rife.bld.dependencies;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.OS;
import rife.ioc.HierarchicalProperties;
import java.nio.file.Path;
@ -78,11 +80,25 @@ public class TestRepository {
assertEquals("/local/repo/groupId3/artifactId3/", repository3.getArtifactLocation("groupId3", "artifactId3"));
}
@Test
@EnabledOnOs(OS.WINDOWS)
void testArtifactLocationWindows() {
var repository1 = new Repository("c:\\local\\repo");
assertNotNull(repository1);
assertEquals("c:\\local\\repo\\groupId1\\artifactId1\\", repository1.getArtifactLocation("groupId1", "artifactId1"));
var repository2 = new Repository("E:\\local\\repo");
assertNotNull(repository2);
assertEquals("E:\\local\\repo\\groupId2\\artifactId2\\", repository2.getArtifactLocation("groupId2", "artifactId2"));
}
@Test
void testIsLocal() {
assertFalse(new Repository("http://my.repo").isLocal());
assertTrue(new Repository("file:///local/repo").isLocal());
assertTrue(new Repository("//local/repo").isLocal());
assertTrue(new Repository("c:\\local\\repo").isLocal());
assertTrue(new Repository("E:\\local\\repo").isLocal());
}
@Test