use of org.ballerinalang.model.elements.PackageID in project ballerina by ballerina-lang.
the class RepoTest method testSystemOrgIsReserved.
@Test
public void testSystemOrgIsReserved() {
PackageID pkg = newPackageID("ballerina", "any.pkg", "10.2.3");
Repo subject = new NonSysRepo<String>(null) {
@Override
public Patten calculateNonSysPkg(PackageID pkg) {
Assert.fail("Tried to calculate path for system packages");
return null;
}
};
Patten patten = subject.calculate(pkg);
Assert.assertEquals(patten, Patten.NULL);
}
use of org.ballerinalang.model.elements.PackageID in project ballerina by ballerina-lang.
the class RepoTest method testHomeRepo.
@Test
public void testHomeRepo() {
PackageID pkg = newPackageID("my_org", "my.pkg", "10.2.3");
HomeRepo subject = new HomeRepo((PathConverter) null);
Patten patten = subject.calculate(pkg);
Assert.assertEquals(patten.toString(), "$/repo/my_org/my.pkg/10.2.3/src/**~test~resources/*.bal");
}
use of org.ballerinalang.model.elements.PackageID in project ballerina by ballerina-lang.
the class LSPackageCache method loadPackagesMap.
private void loadPackagesMap() {
CompilerContext tempCompilerContext = CommonUtil.prepareTempCompilerContext();
for (String staticPkgName : staticPkgNames) {
PackageID packageID = new PackageID(new org.wso2.ballerinalang.compiler.util.Name("ballerina"), new org.wso2.ballerinalang.compiler.util.Name(staticPkgName), new org.wso2.ballerinalang.compiler.util.Name("0.0.0"));
this.packageMap.put(getPackageName(packageID), LSPackageLoader.getPackageById(tempCompilerContext, packageID));
}
}
Aggregations