/**
   * Check that the extension is properly reported to be installed in the given namespace.
   *
   * @param installedExtension the local extension to check
   * @param namespace the namespace where it has been installed
   */
  private void checkInstallStatus(InstalledExtension installedExtension, String namespace) {
    // check extension status
    Assert.assertNotNull(installedExtension);
    Assert.assertNotNull(installedExtension.getFile());
    Assert.assertTrue(new File(installedExtension.getFile().getAbsolutePath()).exists());
    Assert.assertTrue(installedExtension.isInstalled(namespace));
    if (namespace != null) {
      Assert.assertFalse(installedExtension.isInstalled(null));
    }

    // check repository status
    Assert.assertNotNull(
        this.installedExtensionRepository.getInstalledExtension(
            installedExtension.getId().getId(), namespace));
    if (namespace != null) {
      Assert.assertNull(
          this.installedExtensionRepository.getInstalledExtension(
              installedExtension.getId().getId(), null));
    }
  }