JcrPackageManagerImpl extends PackageManagerImpl implements JcrPackageManager { @Override public List<JcrPackage> listPackages() throws RepositoryException { return listPackages(null); } JcrPackageManagerImpl(@NotNull Session session, @Nullable String[] roots);  JcrPackageManagerImpl(@NotNull Session session, @Nullable String[] roots, @Nullable String[] authIdsForHookExecution, @Nullable String[] authIdsForRootInstallation); protected  JcrPackageManagerImpl(JcrPackageRegistry registry); PackageRegistry getRegistry(); JcrPackageRegistry getInternalRegistry(); @Override JcrPackage open(PackageId id); @Override JcrPackage open(Node node); @Override JcrPackage open(Node node, boolean allowInvalid); @Override PackageId resolve(Dependency dependency, boolean onlyInstalled); @Override PackageId[] usage(PackageId id); @Override JcrPackage upload(InputStream in, boolean replace); @Override JcrPackage upload(InputStream in, boolean replace, boolean strict); @NotNull @Override PackageId[] extract(@NotNull Archive archive, @NotNull ImportOptions options, boolean replace); @Override JcrPackage upload(File file, boolean isTmpFile, boolean replace, String nameHint); @Override JcrPackage upload(File file, boolean isTmpFile, boolean replace, String nameHint, boolean strict); @Override JcrPackage create(Node folder, String name); @Override JcrPackage create(String group, String name); @Override JcrPackage create(String group, String name, String version); @Override void remove(JcrPackage pack); @Override JcrPackage rename(JcrPackage pack, String group, String name); @Override JcrPackage rename(JcrPackage pack, String group, String name, String version); @Override void assemble(JcrPackage pack, ProgressTrackerListener listener); @Override void assemble(Node packNode, JcrPackageDefinition definition,
                         ProgressTrackerListener listener); @Override void assemble(JcrPackageDefinition definition,
                         ProgressTrackerListener listener, OutputStream out); @Override void rewrap(JcrPackage pack, ProgressTrackerListener listener); @Override Node getPackageRoot(); @Override Node getPackageRoot(boolean noCreate); @Override List<JcrPackage> listPackages(); @Override List<JcrPackage> listPackages(WorkspaceFilter filter); @Override List<JcrPackage> listPackages(String group, boolean built); @Override void setDispatcher(@Nullable PackageEventDispatcher dispatcher); final static String ARCHIVE_PACKAGE_ROOT_PATH; }
@Test public void testListPackages() throws IOException, PackageException, RepositoryException { assertTrue("initially the packages set is empty", packMgr.listPackages().isEmpty()); packMgr.upload(getStream("/test-packages/tmp.zip"), false); assertEquals("package list contains 1 element", 1, packMgr.listPackages().size()); JcrPackage pkg = packMgr.listPackages().get(0); assertEquals("contains new package", TMP_PACKAGE_ID, pkg.getDefinition().getId()); }