@Test public void doAction_pageNotFound() throws PersistenceException, AecuException { when(pageManager.getContainingPage(resource)).thenReturn(null); String result = action.doAction(resource); assertTrue(result.contains("Unable to find a page")); }
@Override public String doAction(Resource resource) throws PersistenceException, AecuException { Page page = context.getPageManager().getContainingPage(resource); if (page == null) { return "Unable to find a page for resource " + resource.getPath(); } String skip = skipDeactivated ? "skipping" : "not skipping"; try { performActivation(page); } catch (ReplicationException e) { throw new PersistenceException("Unable to replicate tree " + page.getPath(), e); } return "Replicated page tree " + page.getPath() + " " + skip + " deactivated pages (" + count + " pages)"; }
TreeActivatePageAction implements Action { @Override public String doAction(Resource resource) throws PersistenceException, AecuException { Page page = context.getPageManager().getContainingPage(resource); if (page == null) { return "Unable to find a page for resource " + resource.getPath(); } String skip = skipDeactivated ? "skipping" : "not skipping"; try { performActivation(page); } catch (ReplicationException e) { throw new PersistenceException("Unable to replicate tree " + page.getPath(), e); } return "Replicated page tree " + page.getPath() + " " + skip + " deactivated pages (" + count + " pages)"; } }
TreeActivatePageAction implements Action { @Override public String doAction(Resource resource) throws PersistenceException, AecuException { Page page = context.getPageManager().getContainingPage(resource); if (page == null) { return "Unable to find a page for resource " + resource.getPath(); } String skip = skipDeactivated ? "skipping" : "not skipping"; try { performActivation(page); } catch (ReplicationException e) { throw new PersistenceException("Unable to replicate tree " + page.getPath(), e); } return "Replicated page tree " + page.getPath() + " " + skip + " deactivated pages (" + count + " pages)"; } TreeActivatePageAction(boolean skipDeactivated, BindingContext context); }
TreeActivatePageAction implements Action { @Override public String doAction(Resource resource) throws PersistenceException, AecuException { Page page = context.getPageManager().getContainingPage(resource); if (page == null) { return "Unable to find a page for resource " + resource.getPath(); } String skip = skipDeactivated ? "skipping" : "not skipping"; try { performActivation(page); } catch (ReplicationException e) { throw new PersistenceException("Unable to replicate tree " + page.getPath(), e); } return "Replicated page tree " + page.getPath() + " " + skip + " deactivated pages (" + count + " pages)"; } TreeActivatePageAction(boolean skipDeactivated, BindingContext context); @Override String doAction(Resource resource); }
TreeActivatePageAction implements Action { @Override public String doAction(Resource resource) throws PersistenceException, AecuException { Page page = context.getPageManager().getContainingPage(resource); if (page == null) { return "Unable to find a page for resource " + resource.getPath(); } String skip = skipDeactivated ? "skipping" : "not skipping"; try { performActivation(page); } catch (ReplicationException e) { throw new PersistenceException("Unable to replicate tree " + page.getPath(), e); } return "Replicated page tree " + page.getPath() + " " + skip + " deactivated pages (" + count + " pages)"; } TreeActivatePageAction(boolean skipDeactivated, BindingContext context); @Override String doAction(Resource resource);  }