@Test public void testLookupPackageSourceForSinglePkg() { Path filePath = RES_DIR.resolve("source").resolve("singlepackage").resolve("io-sample.bal"); Pair pair = compileAndGetWorkspacePackageRepo(filePath); WorkspacePackageRepository workspacePackageRepository = pair.getWorkspacePackageRepository(); String sourceFileName = filePath.getFileName().toString(); PackageID packageId = new PackageID(sourceFileName); PackageSource packageSource = workspacePackageRepository.lookupPackageSource(packageId); Assert.assertEquals(packageId, packageSource.getPackageId()); boolean found = packageSource.getPackageSourceEntries().stream().anyMatch( compilerInput -> compilerInput.getEntryName().equals(sourceFileName) ); Assert.assertTrue(found, "PackageSource should contain '" + sourceFileName + "'"); }
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);   }