### Question:
DefaultPageManager implements PageManager { @Override public void deletePage( final String pageName ) throws ProviderException { final Page p = getPage( pageName ); if( p != null ) { if( p instanceof Attachment ) { m_engine.getManager( AttachmentManager.class ).deleteAttachment( ( Attachment )p ); } else { final Collection< String > refTo = m_engine.getManager( ReferenceManager.class ).findRefersTo( pageName ); if( m_engine.getManager( AttachmentManager.class ).hasAttachments( p ) ) { final List< Attachment > attachments = m_engine.getManager( AttachmentManager.class ).listAttachments( p ); for( final Attachment attachment : attachments ) { if( refTo != null ) { refTo.remove( attachment.getName() ); } m_engine.getManager( AttachmentManager.class ).deleteAttachment( attachment ); } } deletePage( p ); fireEvent( WikiPageEvent.PAGE_DELETED, pageName ); } } } DefaultPageManager(final Engine engine, final Properties props); @Override PageProvider getProvider(); @Override Collection< Page > getAllPages(); @Override String getPageText( final String pageName, final int version ); @Override String getPureText( final String page, final int version ); @Override String getText( final String page, final int version ); @Override void saveText( final Context context, final String text ); @Override void putPageText( final Page page, final String content ); @Override PageLock lockPage( final Page page, final String user ); @Override void unlockPage( final PageLock lock ); @Override PageLock getCurrentLock( final Page page ); @Override List< PageLock > getActiveLocks(); @Override Page getPage( final String pagereq ); @Override Page getPage( final String pagereq, final int version ); @Override Page getPageInfo( final String pageName, final int version); @Override @SuppressWarnings( "unchecked" ) List< T > getVersionHistory( final String pageName ); @Override String getCurrentProvider(); @Override String getProviderDescription(); @Override int getTotalPageCount(); @Override Set< Page > getRecentChanges(); @Override boolean pageExists( final String pageName ); @Override boolean pageExists( final String pageName, final int version ); @Override boolean wikiPageExists( final String page ); @Override boolean wikiPageExists( final String page, final int version ); @Override void deleteVersion( final Page page ); @Override void deletePage( final String pageName ); @Override void deletePage( final Page page ); @Override void actionPerformed( final WikiEvent event ); @Override PageSorter getPageSorter();  }### Answer:
@Test public void testDeletePage() throws Exception { engine.saveText( NAME1, "Test" ); final String files = engine.getWikiProperties().getProperty( FileSystemProvider.PROP_PAGEDIR ); final File saved = new File( files, NAME1+FileSystemProvider.FILE_EXT ); Assertions.assertTrue( saved.exists(), "Didn't create it!" ); final Page page = engine.getManager( PageManager.class ).getPage( NAME1, WikiProvider.LATEST_VERSION ); engine.getManager( PageManager.class ).deletePage( page.getName() ); Assertions.assertFalse( saved.exists(), "Page has not been removed!" ); }