Search in sources :

Example 1 with JarRepo

use of org.wso2.ballerinalang.compiler.packaging.repo.JarRepo in project ballerina by ballerina-lang.

the class JarIntegrationTest method balInsideJar.

@Test
public void balInsideJar() throws IOException {
    Patten balPatten = new Patten(path("very"), Patten.WILDCARD_SOURCE);
    JarRepo repo = new JarRepo(tempJar.toUri());
    Converter<Path> subject = repo.getConverterInstance();
    List<PackageSourceEntry> sources = balPatten.convertToSources(subject, null).collect(Collectors.toList());
    Assert.assertEquals(sources.size(), 1);
    Assert.assertEquals(sources.get(0).getCode(), BAL_CONTENT);
}
Also used : Path(java.nio.file.Path) PackageSourceEntry(org.ballerinalang.repository.PackageSourceEntry) Patten(org.wso2.ballerinalang.compiler.packaging.Patten) JarRepo(org.wso2.ballerinalang.compiler.packaging.repo.JarRepo) Test(org.testng.annotations.Test)

Aggregations

Path (java.nio.file.Path)1 PackageSourceEntry (org.ballerinalang.repository.PackageSourceEntry)1 Test (org.testng.annotations.Test)1 Patten (org.wso2.ballerinalang.compiler.packaging.Patten)1 JarRepo (org.wso2.ballerinalang.compiler.packaging.repo.JarRepo)1