Class AntTestBase

  • Direct Known Subclasses:
    CodeComplianceTest

    abstract class AntTestBase
    extends TestCase
    Base class for tests that execute Ant targets. Sub-classes should invoke runAntTest(String) to run an Ant target. If the Ant sub-process cannot be started of if it returns an exit code that indicates error, the test fails.

    AntTestBase makes the following assumptions about its run-time environment:

    1. Ant can be invoked by executing ant. That is, ant is on the current PATH.
    2. The version of Ant on the PATH is new enough to execute the build.xml script.
    3. The test is being invoked in the root directory (e.g. //open/mondrian) as the current directory or a subdirectory of it.
     REVIEW: SWZ: 3/11/2006: This class is not portable to Windows.  Potential
     solutions:
     1) Check for Windows via System properties and invoke
        "command.com ant.bat [target]" (or whatever's necessary) when the OS is
        Windows.
     2) Require Ant libraries be on the classpath and invoke Ant's API
        directly.  This is preferred, since it should be OS neutral.
     
    Since:
    Mar 11, 2006
    Author:
    Stephan Zuercher
    • Constructor Summary

      Constructors 
      Constructor Description
      AntTestBase​(java.lang.String name)
      Creates an AntTestBase.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void runAntTest​(java.lang.String target)
      Runs an ant task.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AntTestBase

        AntTestBase​(java.lang.String name)
        Creates an AntTestBase.
        Parameters:
        name - Test name
    • Method Detail

      • runAntTest

        protected void runAntTest​(java.lang.String target)
                           throws java.io.IOException,
                                  java.lang.InterruptedException
        Runs an ant task.
        Parameters:
        target - Name of ant target
        Throws:
        java.io.IOException
        java.lang.InterruptedException