@Test public void testBuildWithErrorListener() throws Exception { final CompletableFuture<Map.Entry<String, String>> latch = new CompletableFuture<>(); final ErrorListener errorListener = mock(ErrorListener.class); doAnswer(call -> latch.complete(toEntry(call.getArgument(1), call.getArgument(2)))) .when(errorListener) .onJcrNamespaceRegistrationError(any(Throwable.class), anyString(), anyString()); builder().withErrorListener(null).withErrorListener(errorListener) .withInitStage(new InitStage.Builder().withNs("jcr", "http: .build().initAndInspect(session -> { assertEquals("jcr namespace is mapped correctly", NamespaceRegistry.NAMESPACE_JCR, session.getNamespaceURI("jcr")); }); assertEquals("latch entry equals", toEntry("jcr", "http: }
@SuppressWarnings("WeakerAccess") public <E extends Throwable> void initAndInspect(final InspectBody<E> inspectBody) throws AbortedScanException, RepositoryException, E { adminInitAndInspect(admin -> { final Session inspectSession = Util.wrapSessionReadOnly(admin); inspectBody.tryAccept(inspectSession); }); }
OakMachine { @SuppressWarnings("WeakerAccess") public <E extends Throwable> void initAndInspect(final InspectBody<E> inspectBody) throws AbortedScanException, RepositoryException, E { adminInitAndInspect(admin -> { final Session inspectSession = Util.wrapSessionReadOnly(admin); inspectBody.tryAccept(inspectSession); }); } }
OakMachine { @SuppressWarnings("WeakerAccess") public <E extends Throwable> void initAndInspect(final InspectBody<E> inspectBody) throws AbortedScanException, RepositoryException, E { adminInitAndInspect(admin -> { final Session inspectSession = Util.wrapSessionReadOnly(admin); inspectBody.tryAccept(inspectSession); }); } private  OakMachine(final Packaging packagingService,
                       final List<ProgressCheck> progressChecks,
                       final ErrorListener errorListener,
                       final List<URL> preInstallUrls,
                       final List<InitStage> initStages,
                       final JcrCustomizer jcrCustomizer,
                       final InstallHookProcessorFactory installHookProcessorFactory,
                       final ClassLoader installHookClassLoader,
                       final boolean enablePreInstallHooks,
                       final InstallHookPolicy scanInstallHookPolicy,
                       final Supplier<NodeStore> nodeStoreSupplier,
                       final SubpackageSilencer subpackageSilencer,
                       final RepoInitProcessor repoInitProcessor,
                       final SlingSimulatorBackend slingSimulator,
                       final Set<String> runModes); }
OakMachine { @SuppressWarnings("WeakerAccess") public <E extends Throwable> void initAndInspect(final InspectBody<E> inspectBody) throws AbortedScanException, RepositoryException, E { adminInitAndInspect(admin -> { final Session inspectSession = Util.wrapSessionReadOnly(admin); inspectBody.tryAccept(inspectSession); }); } private  OakMachine(final Packaging packagingService,
                       final List<ProgressCheck> progressChecks,
                       final ErrorListener errorListener,
                       final List<URL> preInstallUrls,
                       final List<InitStage> initStages,
                       final JcrCustomizer jcrCustomizer,
                       final InstallHookProcessorFactory installHookProcessorFactory,
                       final ClassLoader installHookClassLoader,
                       final boolean enablePreInstallHooks,
                       final InstallHookPolicy scanInstallHookPolicy,
                       final Supplier<NodeStore> nodeStoreSupplier,
                       final SubpackageSilencer subpackageSilencer,
                       final RepoInitProcessor repoInitProcessor,
                       final SlingSimulatorBackend slingSimulator,
                       final Set<String> runModes); List<ProgressCheck> getProgressChecks(); ErrorListener getErrorListener(); @Deprecated List<File> getPreInstallFiles(); List<URL> getPreInstallUrls(); @SuppressWarnings("WeakerAccess") void initAndInspect(final InspectBody<E> inspectBody); void adminInitAndInspect(final InspectBody<E> inspectBody); List<CheckReport> scanPackage(final @NotNull File... file); List<CheckReport> scanPackages(final List<File> files); static Packaging newOakpalPackagingService(); static Packaging newOakpalPackagingService(final @NotNull ClassLoader classLoader); }
OakMachine { @SuppressWarnings("WeakerAccess") public <E extends Throwable> void initAndInspect(final InspectBody<E> inspectBody) throws AbortedScanException, RepositoryException, E { adminInitAndInspect(admin -> { final Session inspectSession = Util.wrapSessionReadOnly(admin); inspectBody.tryAccept(inspectSession); }); } private  OakMachine(final Packaging packagingService,
                       final List<ProgressCheck> progressChecks,
                       final ErrorListener errorListener,
                       final List<URL> preInstallUrls,
                       final List<InitStage> initStages,
                       final JcrCustomizer jcrCustomizer,
                       final InstallHookProcessorFactory installHookProcessorFactory,
                       final ClassLoader installHookClassLoader,
                       final boolean enablePreInstallHooks,
                       final InstallHookPolicy scanInstallHookPolicy,
                       final Supplier<NodeStore> nodeStoreSupplier,
                       final SubpackageSilencer subpackageSilencer,
                       final RepoInitProcessor repoInitProcessor,
                       final SlingSimulatorBackend slingSimulator,
                       final Set<String> runModes); List<ProgressCheck> getProgressChecks(); ErrorListener getErrorListener(); @Deprecated List<File> getPreInstallFiles(); List<URL> getPreInstallUrls(); @SuppressWarnings("WeakerAccess") void initAndInspect(final InspectBody<E> inspectBody); void adminInitAndInspect(final InspectBody<E> inspectBody); List<CheckReport> scanPackage(final @NotNull File... file); List<CheckReport> scanPackages(final List<File> files); static Packaging newOakpalPackagingService(); static Packaging newOakpalPackagingService(final @NotNull ClassLoader classLoader); static final String NS_URI_OAKPAL; static final String NS_PREFIX_OAKPAL; static final String LN_UNDECLARED; static final String NT_UNDECLARED; }