Search in sources :

Example 1 with DefaultInstalledExtension

use of org.xwiki.extension.repository.internal.installed.DefaultInstalledExtension in project xwiki-platform by xwiki.

the class JARTranslationBundleFactoryTest method mockInstalledExtension.

private DefaultInstalledExtension mockInstalledExtension(ExtensionId extensionId, String namespace) {
    DefaultLocalExtension localExtension = new DefaultLocalExtension(null, extensionId, "jar");
    localExtension.setFile(this.extensionPackager.getExtensionFile(extensionId));
    DefaultInstalledExtension installedExtension = new DefaultInstalledExtension(localExtension, null);
    installedExtension.setInstalled(true, namespace);
    return installedExtension;
}
Also used : DefaultLocalExtension(org.xwiki.extension.repository.internal.local.DefaultLocalExtension) DefaultInstalledExtension(org.xwiki.extension.repository.internal.installed.DefaultInstalledExtension)

Example 2 with DefaultInstalledExtension

use of org.xwiki.extension.repository.internal.installed.DefaultInstalledExtension in project xwiki-platform by xwiki.

the class JARTranslationBundleFactoryTest method mockUninstallExtension.

private void mockUninstallExtension(ExtensionId extensionId, String namespace) throws ComponentLookupException {
    DefaultInstalledExtension installedExtension = mockInstalledExtension(extensionId, namespace);
    getObservationManager().notify(new ExtensionUninstalledEvent(extensionId, namespace), installedExtension);
}
Also used : ExtensionUninstalledEvent(org.xwiki.extension.event.ExtensionUninstalledEvent) DefaultInstalledExtension(org.xwiki.extension.repository.internal.installed.DefaultInstalledExtension)

Example 3 with DefaultInstalledExtension

use of org.xwiki.extension.repository.internal.installed.DefaultInstalledExtension in project xwiki-platform by xwiki.

the class JARTranslationBundleFactoryTest method mockUpgradeExtension.

private void mockUpgradeExtension(ExtensionId previousExtensionId, ExtensionId newExtensionId, String namespace) throws ComponentLookupException {
    DefaultInstalledExtension previousInstalledExtension = mockInstalledExtension(previousExtensionId, namespace);
    DefaultInstalledExtension newInstalledExtension = mockInstalledExtension(newExtensionId, namespace);
    getObservationManager().notify(new ExtensionUpgradedEvent(newExtensionId, namespace), newInstalledExtension, Arrays.asList(previousInstalledExtension));
}
Also used : ExtensionUpgradedEvent(org.xwiki.extension.event.ExtensionUpgradedEvent) DefaultInstalledExtension(org.xwiki.extension.repository.internal.installed.DefaultInstalledExtension)

Example 4 with DefaultInstalledExtension

use of org.xwiki.extension.repository.internal.installed.DefaultInstalledExtension in project xwiki-platform by xwiki.

the class JARTranslationBundleFactoryTest method mockInstallExtension.

private void mockInstallExtension(ExtensionId extensionId, String namespace) throws ComponentLookupException {
    DefaultInstalledExtension installedExtension = mockInstalledExtension(extensionId, namespace);
    getObservationManager().notify(new ExtensionInstalledEvent(extensionId, namespace), installedExtension);
}
Also used : DefaultInstalledExtension(org.xwiki.extension.repository.internal.installed.DefaultInstalledExtension) ExtensionInstalledEvent(org.xwiki.extension.event.ExtensionInstalledEvent)

Aggregations

DefaultInstalledExtension (org.xwiki.extension.repository.internal.installed.DefaultInstalledExtension)4 ExtensionInstalledEvent (org.xwiki.extension.event.ExtensionInstalledEvent)1 ExtensionUninstalledEvent (org.xwiki.extension.event.ExtensionUninstalledEvent)1 ExtensionUpgradedEvent (org.xwiki.extension.event.ExtensionUpgradedEvent)1 DefaultLocalExtension (org.xwiki.extension.repository.internal.local.DefaultLocalExtension)1