ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant BuildFileTest.java
Date Sat, 09 Feb 2002 23:23:23 GMT
stevel      02/02/09 15:23:23

  Modified:    src/testcases/org/apache/tools/ant BuildFileTest.java
  Log:
  Adding javadocs for the main methods that testcases are likely to call
  
  Revision  Changes    Path
  1.8       +67 -0     jakarta-ant/src/testcases/org/apache/tools/ant/BuildFileTest.java
  
  Index: BuildFileTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/BuildFileTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- BuildFileTest.java	3 Feb 2002 22:21:08 -0000	1.7
  +++ BuildFileTest.java	9 Feb 2002 23:23:23 -0000	1.8
  @@ -79,10 +79,21 @@
       private StringBuffer errBuffer;
       private BuildException buildException;
       
  +    /**
  +     *  Constructor for the BuildFileTest object
  +     *
  +     *@param  name string to pass up to TestCase constructor
  +     */    
       public BuildFileTest(String name) {
           super(name);
       }
       
  +    /**
  +     *  run a target, expect for any build exception 
  +     *
  +     *@param  target target to run
  +     *@param  cause  information string to reader of report
  +     */    
       protected void expectBuildException(String target, String cause) { 
           expectSpecificBuildException(target, cause, null);
       }
  @@ -97,6 +108,13 @@
           assertEquals(log, realLog);
       }
   
  +    /**
  +     *  Gets the log the BuildFileTest object.
  +     *  only valid if configureProject() has
  +     *  been called.
  +     * @pre logBuffer!=null
  +     * @return    The log value
  +     */    
       protected String getLog() { 
           return logBuffer.toString();
       }
  @@ -111,16 +129,38 @@
           assertEquals(log, realLog);
       }
   
  +    /**
  +     *  Gets the log the BuildFileTest object.
  +     *  only valid if configureProject() has
  +     *  been called.
  +     * @pre fullLogBuffer!=null
  +     * @return    The log value
  +     */
       protected String getFullLog() { 
           return fullLogBuffer.toString();
       }
   
  +    /**
  +     *  execute the target, verify output matches expectations
  +     *
  +     *@param  target  target to execute
  +     *@param  output  output to look for
  +     */
  +    
       protected void expectOutput(String target, String output) { 
           executeTarget(target);
           String realOutput = getOutput();
           assertEquals(output, realOutput);
       }
   
  +    /**
  +     *  execute the target, verify output matches expectations
  +     *  and that we got the named error at the end
  +     *@param  target  target to execute
  +     *@param  output  output to look for
  +     *@param  error   Description of Parameter
  +     */
  +     
       protected void expectOutputAndError(String target, String output, String error) { 
           executeTarget(target);
           String realOutput = getOutput();
  @@ -160,6 +200,11 @@
           return cleanedBuffer.toString();
       }
       
  +    /**
  +     *  set up to run the named project
  +     *
  +     *@param  filename name of project file to run
  +     */    
       protected void configureProject(String filename) { 
           logBuffer = new StringBuffer();
           fullLogBuffer = new StringBuffer();
  @@ -170,6 +215,11 @@
           ProjectHelper.configureProject(project, new File(filename));
       }
       
  +    /**
  +     *  execute a target we have set up
  +     *@pre configureProject has been called
  +     *@param  targetName  target to run
  +     */    
       protected void executeTarget(String targetName) { 
           PrintStream sysOut = System.out;
           PrintStream sysErr = System.err;
  @@ -197,6 +247,14 @@
           return project.getBaseDir();
       }
   
  +    /**
  +     *  run a target, wait for a build exception 
  +     *
  +     *@param  target target to run
  +     *@param  cause  information string to reader of report
  +     *@param  msg    the message value of the build exception we are waiting for
  +              set to null for any build exception to be valid
  +     */    
       protected void expectSpecificBuildException(String target, String cause, String msg)
{ 
           try {
               executeTarget(target);
  @@ -209,6 +267,15 @@
           fail("Should throw BuildException because: " + cause);
       }
       
  +    /**
  +     *  run a target, expect an exception string
  +     *  containing the substring we look for (case sensitive match)
  +     *
  +     *@param  target target to run
  +     *@param  cause  information string to reader of report
  +     *@param  msg    the message value of the build exception we are waiting for
  +     *@param  contains  substring of the build exception to look for
  +     */
       protected void expectBuildExceptionContaining(String target, String cause, String contains)
{ 
           try {
               executeTarget(target);
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message