@Test public void testCreateNewWiki() throws Throwable { doReturn(Arrays.asList("wiki1", "wiki2")).when(this.oldcore.getWikiDescriptorManager()).getAllIds(); install(this.localXarExtensiontId1, null, this.contextUser); Assert.assertFalse(this.oldcore.getSpyXWiki() .getDocument(new DocumentReference("wiki1", "space1", "page1"), getXWikiContext()).isNew()); Assert.assertFalse(this.oldcore.getSpyXWiki() .getDocument(new DocumentReference("wiki2", "space1", "page1"), getXWikiContext()).isNew()); assertTrue(this.oldcore.getSpyXWiki() .getDocument(new DocumentReference("newwiki", "space1", "page1"), getXWikiContext()).isNew()); this.observation.notify(new WikiCreatingEvent("newwiki"), null, this.oldcore.getXWikiContext()); this.observation.notify(new WikiCreatedEvent("newwiki"), null, this.oldcore.getXWikiContext()); Assert.assertFalse(this.oldcore.getSpyXWiki() .getDocument(new DocumentReference("wiki1", "space1", "page1"), getXWikiContext()).isNew()); Assert.assertFalse(this.oldcore.getSpyXWiki() .getDocument(new DocumentReference("wiki2", "space1", "page1"), getXWikiContext()).isNew()); Assert.assertFalse(this.oldcore.getSpyXWiki() .getDocument(new DocumentReference("newwiki", "space1", "page1"), getXWikiContext()).isNew()); }
@Override public void install(LocalExtension localExtension, String namespace, Request request) throws InstallException { if (!request.isRemote()) { String wiki; try { wiki = XarHandlerUtils.getWikiFromNamespace(namespace); } catch (UnsupportedNamespaceException e) { throw new InstallException("Failed to extract wiki id from namespace", e); } installInternal(localExtension, wiki, request); } }
XarExtensionHandler extends AbstractExtensionHandler { @Override public void install(LocalExtension localExtension, String namespace, Request request) throws InstallException { if (!request.isRemote()) { String wiki; try { wiki = XarHandlerUtils.getWikiFromNamespace(namespace); } catch (UnsupportedNamespaceException e) { throw new InstallException("Failed to extract wiki id from namespace", e); } installInternal(localExtension, wiki, request); } } }
XarExtensionHandler extends AbstractExtensionHandler { @Override public void install(LocalExtension localExtension, String namespace, Request request) throws InstallException { if (!request.isRemote()) { String wiki; try { wiki = XarHandlerUtils.getWikiFromNamespace(namespace); } catch (UnsupportedNamespaceException e) { throw new InstallException("Failed to extract wiki id from namespace", e); } installInternal(localExtension, wiki, request); } }  }
XarExtensionHandler extends AbstractExtensionHandler { @Override public void install(LocalExtension localExtension, String namespace, Request request) throws InstallException { if (!request.isRemote()) { String wiki; try { wiki = XarHandlerUtils.getWikiFromNamespace(namespace); } catch (UnsupportedNamespaceException e) { throw new InstallException("Failed to extract wiki id from namespace", e); } installInternal(localExtension, wiki, request); } }  @Override void install(LocalExtension localExtension, String namespace, Request request); @Override void upgrade(Collection<InstalledExtension> previousLocalExtensions, LocalExtension newLocalExtension,
        String namespace, Request request); @Override void uninstall(InstalledExtension installedExtension, String namespace, Request request); }
XarExtensionHandler extends AbstractExtensionHandler { @Override public void install(LocalExtension localExtension, String namespace, Request request) throws InstallException { if (!request.isRemote()) { String wiki; try { wiki = XarHandlerUtils.getWikiFromNamespace(namespace); } catch (UnsupportedNamespaceException e) { throw new InstallException("Failed to extract wiki id from namespace", e); } installInternal(localExtension, wiki, request); } }  @Override void install(LocalExtension localExtension, String namespace, Request request); @Override void upgrade(Collection<InstalledExtension> previousLocalExtensions, LocalExtension newLocalExtension,
        String namespace, Request request); @Override void uninstall(InstalledExtension installedExtension, String namespace, Request request); static final String TYPE; }