@Test public void testLookupPackageSourceForMultiPkgs() { Path filePath = RES_DIR.resolve("source").resolve("multipackages").resolve("sample").resolve("main.bal"); Pair pair = compileAndGetWorkspacePackageRepo(filePath); Names names = pair.getNames(); WorkspacePackageRepository workspacePackageRepository = pair.getWorkspacePackageRepository(); Name orgName = names.fromString("demo"); Name print = names.fromString("print"); Name sample = names.fromString("sample"); Name version = names.fromString("0.0.1"); PackageID printPackageId = new PackageID(orgName, print, version); PackageID samplePackageId = new PackageID(orgName, sample, version); PackageSource packageSource = workspacePackageRepository.lookupPackageSource(printPackageId, "io-printer.bal"); Assert.assertNotNull(packageSource); Assert.assertEquals(packageSource.getPackageId(), printPackageId); Assert.assertNotNull(packageSource.getPackageSourceEntries()); packageSource = workspacePackageRepository.lookupPackageSource(samplePackageId, "main.bal"); Assert.assertNotNull(packageSource); Assert.assertEquals(packageSource.getPackageId(), samplePackageId); Assert.assertNotNull(packageSource.getPackageSourceEntries()); }
protected PackageSource lookupPackageSource(PackageID pkgID) { Path path = this.generatePath(pkgID); return new WorkspacePackageSource(pkgID, path); }
WorkspacePackageRepository extends GeneralFSPackageRepository { protected PackageSource lookupPackageSource(PackageID pkgID) { Path path = this.generatePath(pkgID); return new WorkspacePackageSource(pkgID, path); } }
WorkspacePackageRepository extends GeneralFSPackageRepository { protected PackageSource lookupPackageSource(PackageID pkgID) { Path path = this.generatePath(pkgID); return new WorkspacePackageSource(pkgID, path); } WorkspacePackageRepository(String programDirRoot, WorkspaceDocumentManager documentManager); }
WorkspacePackageRepository extends GeneralFSPackageRepository { protected PackageSource lookupPackageSource(PackageID pkgID) { Path path = this.generatePath(pkgID); return new WorkspacePackageSource(pkgID, path); } WorkspacePackageRepository(String programDirRoot, WorkspaceDocumentManager documentManager);  }
WorkspacePackageRepository extends GeneralFSPackageRepository { protected PackageSource lookupPackageSource(PackageID pkgID) { Path path = this.generatePath(pkgID); return new WorkspacePackageSource(pkgID, path); } WorkspacePackageRepository(String programDirRoot, WorkspaceDocumentManager documentManager);   }