@Test public void testInstallOnNamespaceThenUpgradeOnRoot() throws Throwable { doReturn(Arrays.asList("wiki1", "wiki2")).when(this.oldcore.getWikiDescriptorManager()).getAllIds(); install(this.localXarExtensiontId1, "wiki1", this.contextUser); XWikiDocument pageWiki1 = this.oldcore.getSpyXWiki().getDocument(new DocumentReference("wiki1", "space", "page"), getXWikiContext()); Assert.assertFalse(pageWiki1.isNew()); Assert.assertEquals("1.1", pageWiki1.getVersion()); pageWiki1 = this.oldcore.getSpyXWiki().getDocument(new DocumentReference("wiki1", "samespace", "samepage"), getXWikiContext()); Assert.assertFalse(pageWiki1.isNew()); Assert.assertEquals("1.1", pageWiki1.getVersion()); XWikiDocument pageWiki2 = this.oldcore.getSpyXWiki().getDocument(new DocumentReference("wiki2", "space", "page"), getXWikiContext()); assertTrue(pageWiki2.isNew()); pageWiki2 = this.oldcore.getSpyXWiki().getDocument(new DocumentReference("wiki2", "samespace", "samepage"), getXWikiContext()); assertTrue(pageWiki2.isNew()); install(this.localXarExtensiontId2, null, this.contextUser); pageWiki1 = this.oldcore.getSpyXWiki().getDocument(new DocumentReference("wiki1", "space", "page"), getXWikiContext()); Assert.assertFalse(pageWiki1.isNew()); Assert.assertEquals("2.1", pageWiki1.getVersion()); pageWiki1 = this.oldcore.getSpyXWiki().getDocument(new DocumentReference("wiki1", "samespace", "samepage"), getXWikiContext()); Assert.assertFalse(pageWiki1.isNew()); Assert.assertEquals("1.1", pageWiki1.getVersion()); pageWiki2 = this.oldcore.getSpyXWiki().getDocument(new DocumentReference("wiki2", "space", "page"), getXWikiContext()); Assert.assertFalse(pageWiki2.isNew()); Assert.assertEquals("1.1", pageWiki1.getVersion()); pageWiki2 = this.oldcore.getSpyXWiki().getDocument(new DocumentReference("wiki2", "samespace", "samepage"), getXWikiContext()); Assert.assertFalse(pageWiki2.isNew()); Assert.assertEquals("1.1", pageWiki2.getVersion()); }
@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; }