@Test public void testRegister() throws Exception { final DefaultErrorListener errorListener = new DefaultErrorListener(); final CNDURLInstaller installer = new CNDURLInstaller(errorListener, Arrays.asList(cndFUrl, cndEUrl, cndDUrl, cndCUrl, cndBUrl, cndAUrl), Arrays.asList(cndYUrl, cndZUrl)); new OakMachine.Builder().build().adminInitAndInspect(session -> { installer.register(session); NodeTypeManager ntManager = session.getWorkspace().getNodeTypeManager(); assertTrue("has a:primaryType", ntManager.hasNodeType("a:primaryType")); assertTrue("has b:primaryType", ntManager.hasNodeType("b:primaryType")); assertTrue("has c:primaryType", ntManager.hasNodeType("c:primaryType")); assertTrue("has d:primaryType", ntManager.hasNodeType("d:primaryType")); assertTrue("has e:primaryType", ntManager.hasNodeType("e:primaryType")); assertFalse("does not have f:primaryType", ntManager.hasNodeType("f:primaryType")); assertFalse("does not have y:primaryType", ntManager.hasNodeType("y:primaryType")); assertTrue("has z:primaryType", ntManager.hasNodeType("z:primaryType")); }); assertEquals("f and y should report errors: " + errorListener.getReportedViolations(), 2, errorListener.getReportedViolations().size()); }
public void register(Session session) throws RepositoryException { register(session, unorderedCnds); registerByUrl(session, postInstallCnds); }
CNDURLInstaller { public void register(Session session) throws RepositoryException { register(session, unorderedCnds); registerByUrl(session, postInstallCnds); } }
CNDURLInstaller { public void register(Session session) throws RepositoryException { register(session, unorderedCnds); registerByUrl(session, postInstallCnds); } CNDURLInstaller(final @Nullable ErrorListener errorListener,
                    final @NotNull List<URL> unorderedCnds,
                    final @Nullable List<URL> postInstallCnds); }
CNDURLInstaller { public void register(Session session) throws RepositoryException { register(session, unorderedCnds); registerByUrl(session, postInstallCnds); } CNDURLInstaller(final @Nullable ErrorListener errorListener,
                    final @NotNull List<URL> unorderedCnds,
                    final @Nullable List<URL> postInstallCnds); void register(Session session); void register(Session session, List<URL> nodeTypeResources); void registerByUrl(Session session, List<URL> nodeTypeUrls); }
CNDURLInstaller { public void register(Session session) throws RepositoryException { register(session, unorderedCnds); registerByUrl(session, postInstallCnds); } CNDURLInstaller(final @Nullable ErrorListener errorListener,
                    final @NotNull List<URL> unorderedCnds,
                    final @Nullable List<URL> postInstallCnds); void register(Session session); void register(Session session, List<URL> nodeTypeResources); void registerByUrl(Session session, List<URL> nodeTypeUrls);  }