use of org.wso2.ballerinalang.compiler.packaging.converters.PathConverter in project ballerina by ballerina-lang.
the class PathConverterIntegrationTest method testWildcard.
@Test
public void testWildcard() {
Patten patten = new Patten(WILDCARD_DIR, path("deep"), WILDCARD_DIR, path("dir.bal", "tempFile.bal"));
PathConverter subject = new PathConverter(tempDirectory);
Stream<Path> pathStream = patten.convert(subject);
List<Path> paths = pathStream.collect(Collectors.toList());
Assert.assertEquals(paths.size(), 1);
Assert.assertEquals(paths.get(0).toString(), tempFile.toString());
}
use of org.wso2.ballerinalang.compiler.packaging.converters.PathConverter in project ballerina by ballerina-lang.
the class RepoTest method testProjectSourceRepo.
@Test
public void testProjectSourceRepo() {
PackageID pkg = newPackageID("best_org", "this.pkg", "1.8.3");
ProjectSourceRepo subject = new ProjectSourceRepo((PathConverter) null);
Patten prospect = subject.calculate(pkg);
Assert.assertEquals(prospect.toString(), "$/this.pkg/**~test~resources/*.bal");
}
use of org.wso2.ballerinalang.compiler.packaging.converters.PathConverter in project ballerina by ballerina-lang.
the class RepoTest method testCacheRepo.
@Test
public void testCacheRepo() {
PackageID pkg = newPackageID("nice_org", "any.pkg", "10.2.3");
CacheRepo subject = new CacheRepo((PathConverter) null);
Patten patten = subject.calculate(pkg);
Assert.assertEquals(patten.toString(), "$/caches/*/nice_org/any.pkg/10.2.3/src/**~test~resources/*.bal");
}
use of org.wso2.ballerinalang.compiler.packaging.converters.PathConverter in project ballerina by ballerina-lang.
the class PathConverterIntegrationTest method testBalSearch.
@Test
public void testBalSearch() {
Patten patten = new Patten(path("very"), Patten.WILDCARD_SOURCE);
PathConverter subject = new PathConverter(tempDirectory);
Stream<Path> pathStream = patten.convert(subject);
List<Path> paths = pathStream.collect(Collectors.toList());
Assert.assertEquals(paths.size(), 1);
Assert.assertEquals(paths.get(0).toString(), tempFile.toString());
}
use of org.wso2.ballerinalang.compiler.packaging.converters.PathConverter in project ballerina by ballerina-lang.
the class RepoTest method testProjectObjRepo.
@Test
public void testProjectObjRepo() {
PackageID pkg = newPackageID("my_org", "my.pkg", "1.2.3");
ObjRepo subject = new ObjRepo((PathConverter) null);
Patten patten = subject.calculate(pkg);
Assert.assertEquals(patten.toString(), "$/repo/my_org/my.pkg/1.2.3/obj/my.pkg.balo");
}
Aggregations