protoj.lang
Class VerifyTarFeature

java.lang.Object
  extended by protoj.lang.VerifyTarFeature

public final class VerifyTarFeature
extends java.lang.Object

StandardProject helper. Verifies the correct functionality of a project tar file by expanding, then building and executing the unit tests inside. This can prevent the situation where extreme care has been taken over the project source code, but correct functionality of the subsequently released tar file is left to chance. Here are the basic steps that are taken:

  1. The tar file is extracted into the target/verify-tar directory, resulting in a failure if this goes wrong for some reason.
  2. If there is no source directory then this results in a failure to avoid the situation where the caller mistakenly believes the tests to have been executed.
  3. Maximum 'rwx' permissions are applied to the extracted files, since tighter restrictions can prevent compilation from working. One consequence is that the unmodified file permissions don't get tested.
  4. The extracted project script is then executed using the compile, assemble and test commands. A failure of this execution results in command failure.

Author:
Ashley Williams

Constructor Summary
VerifyTarFeature(StandardProject project)
           
 
Method Summary
 void extractTarFiles()
          Extracts the tar file from the target directory, throwing an exception if it doesn't exist.
 StandardProject getExtractedProject()
          Creates a project instance representing the project being verified in the target directory.
 void verifyTar()
          Starts the verification process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VerifyTarFeature

public VerifyTarFeature(StandardProject project)
Parameters:
project -
Method Detail

verifyTar

public void verifyTar()
Starts the verification process. See VerifyTarFeature for a complete description.


extractTarFiles

public void extractTarFiles()
Extracts the tar file from the target directory, throwing an exception if it doesn't exist.


getExtractedProject

public StandardProject getExtractedProject()
Creates a project instance representing the project being verified in the target directory.

Returns: