/**
   * Tests that a simple install feature works. The package to be installed by the package manager
   * contains a dummy jar file to be installed at JBOSS_HOME/common/lib and a build script for the
   * pre-install phase.
   *
   * <p>The package does *not* have any dependencies, system-requirements, pre-install or
   * post-install steps
   *
   * @throws Exception
   */
  @Test
  public void testSimpleInstall() throws Exception {
    File simplePackage = this.createSimplePackage("simple-package");

    // run the package manager
    pkgMgr.installPackage(simplePackage.toURI().toURL());

    // now check that the file was installed in that location
    this.assertFileExistenceUnderJBossHome(this.jbossHome, "common/lib/dummy.jar");
  }
  /**
   * Tests that the post-install script runs during the install process
   *
   * @throws Exception
   */
  @Test
  public void testPostInstallScriptExecution() throws Exception {
    File postInstallScriptPackage =
        this.createPackageWithPostInstallScript("basic-post-install-test-package");

    // As a sanity check, ensure that the file supposed to be created by our post-install
    // step is not already present
    this.assertFileAbsenceUnderJBossHome(jbossHome, "bin/post-install.txt");

    // first install
    pkgMgr.installPackage(postInstallScriptPackage.getAbsolutePath());

    // simple check to ensure installation was successful
    this.assertFileExistenceUnderJBossHome(jbossHome, "server/default/deploy/dummy.jar");

    // check that post-install script was run
    this.assertFileExistenceUnderJBossHome(jbossHome, "bin/post-install.txt");
  }