@Test public void testExportSystemViewOutputStream() throws Exception { Session delegate = mock(Session.class); SessionFacade<Session> facade = getFacade(delegate); final OutputStream handler = mock(OutputStream.class); final String path = "/correct/path"; final CompletableFuture<String> latch = new CompletableFuture<>(); doAnswer(invoked -> latch.complete("done")).when(delegate) .exportSystemView(path, handler, true, true); assertFalse("should not be done", latch.isDone()); facade.exportSystemView(path, handler, true, true); assertEquals("should be done", "done", latch.getNow("")); }
@Override public final void exportSystemView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) throws SAXException, RepositoryException { delegate.exportSystemView(absPath, contentHandler, skipBinary, noRecurse); }
SessionFacade implements Session { @Override public final void exportSystemView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) throws SAXException, RepositoryException { delegate.exportSystemView(absPath, contentHandler, skipBinary, noRecurse); } }
SessionFacade implements Session { @Override public final void exportSystemView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) throws SAXException, RepositoryException { delegate.exportSystemView(absPath, contentHandler, skipBinary, noRecurse); } SessionFacade(final @NotNull S delegate, final boolean notProtected); }
SessionFacade implements Session { @Override public final void exportSystemView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) throws SAXException, RepositoryException { delegate.exportSystemView(absPath, contentHandler, skipBinary, noRecurse); } SessionFacade(final @NotNull S delegate, final boolean notProtected); static @Nullable Session findBestWrapper(final @Nullable Session session, final boolean notProtected); @Override final Repository getRepository(); @Override final AccessControlManager getAccessControlManager(); @Override final RetentionManager getRetentionManager(); @Override final Workspace getWorkspace(); @Override final String getUserID(); @Override final String[] getAttributeNames(); @Override final Object getAttribute(final String name); @Override final Node getRootNode(); @Override final Session impersonate(Credentials credentials); @SuppressWarnings("deprecation") @Override final Node getNodeByUUID(String uuid); @Override final Node getNodeByIdentifier(String id); @Override final Item getItem(String absPath); @Override final Node getNode(String absPath); @Override final Property getProperty(String absPath); @Override final boolean itemExists(String absPath); @Override final boolean nodeExists(String absPath); @Override final boolean propertyExists(String absPath); @Override final void refresh(boolean keepChanges); @Override final void logout(); @Override final boolean isLive(); @Override final boolean hasPendingChanges(); @Override final ValueFactory getValueFactory(); @Override final boolean hasPermission(String absPath, String actions); @Override final void checkPermission(String absPath, String actions); @Override final boolean hasCapability(String methodName, Object target, Object[] arguments); @Override final void exportSystemView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse); @Override final void exportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse); @Override final void exportDocumentView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse); @Override final void exportDocumentView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse); @Override final String[] getNamespacePrefixes(); @Override final String getNamespaceURI(String prefix); @Override final String getNamespacePrefix(String uri); @Override final void addLockToken(String lt); @SuppressWarnings("deprecation") @Override final String[] getLockTokens(); @Override final void removeLockToken(String lt); @Override final void move(String srcAbsPath, String destAbsPath); @Override final void removeItem(String absPath); @Override final void save(); @Override final ContentHandler getImportContentHandler(String parentAbsPath, int uuidBehavior); @Override final void importXML(String parentAbsPath, InputStream in, int uuidBehavior); @Override final void setNamespacePrefix(String prefix, String uri); }
SessionFacade implements Session { @Override public final void exportSystemView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) throws SAXException, RepositoryException { delegate.exportSystemView(absPath, contentHandler, skipBinary, noRecurse); } SessionFacade(final @NotNull S delegate, final boolean notProtected); static @Nullable Session findBestWrapper(final @Nullable Session session, final boolean notProtected); @Override final Repository getRepository(); @Override final AccessControlManager getAccessControlManager(); @Override final RetentionManager getRetentionManager(); @Override final Workspace getWorkspace(); @Override final String getUserID(); @Override final String[] getAttributeNames(); @Override final Object getAttribute(final String name); @Override final Node getRootNode(); @Override final Session impersonate(Credentials credentials); @SuppressWarnings("deprecation") @Override final Node getNodeByUUID(String uuid); @Override final Node getNodeByIdentifier(String id); @Override final Item getItem(String absPath); @Override final Node getNode(String absPath); @Override final Property getProperty(String absPath); @Override final boolean itemExists(String absPath); @Override final boolean nodeExists(String absPath); @Override final boolean propertyExists(String absPath); @Override final void refresh(boolean keepChanges); @Override final void logout(); @Override final boolean isLive(); @Override final boolean hasPendingChanges(); @Override final ValueFactory getValueFactory(); @Override final boolean hasPermission(String absPath, String actions); @Override final void checkPermission(String absPath, String actions); @Override final boolean hasCapability(String methodName, Object target, Object[] arguments); @Override final void exportSystemView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse); @Override final void exportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse); @Override final void exportDocumentView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse); @Override final void exportDocumentView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse); @Override final String[] getNamespacePrefixes(); @Override final String getNamespaceURI(String prefix); @Override final String getNamespacePrefix(String uri); @Override final void addLockToken(String lt); @SuppressWarnings("deprecation") @Override final String[] getLockTokens(); @Override final void removeLockToken(String lt); @Override final void move(String srcAbsPath, String destAbsPath); @Override final void removeItem(String absPath); @Override final void save(); @Override final ContentHandler getImportContentHandler(String parentAbsPath, int uuidBehavior); @Override final void importXML(String parentAbsPath, InputStream in, int uuidBehavior); @Override final void setNamespacePrefix(String prefix, String uri);  }