DefaultPackagingService implements Packaging { @Override public JcrPackage open(final Node node, final boolean allowInvalid) throws RepositoryException { return PackagingService.open(node, allowInvalid); } @SuppressWarnings("WeakerAccess")  DefaultPackagingService();   DefaultPackagingService(final @NotNull ClassLoader classLoader); @Override PackageManager getPackageManager(); @Override JcrPackageManager getPackageManager(final Session session); @Override JcrPackageDefinition createPackageDefinition(final Node defNode); @Override JcrPackage open(final Node node, final boolean allowInvalid);  }
@Test public void testOpen() throws Exception { final DefaultPackagingService service = new DefaultPackagingService(); File testPack = TestPackageUtil.prepareTestPackage("test-package-with-etc.zip"); new OakMachine.Builder().build().adminInitAndInspect(session -> { JcrPackageManager manager = service.getPackageManager(session); JcrPackage uploaded = null; JcrPackage opened = null; try { uploaded = manager.upload(testPack, false, true, null); opened = service.open(uploaded.getNode(), false); assertTrue("should be valid package", opened.isValid()); } finally { if (uploaded != null) { uploaded.close(); } if (opened != null) { opened.close(); } } }); }