dion        02/05/14 23:06:06

  Modified:    src/test/org/apache/maven/j2ee WarValidatorTest.java
  Log:
  Added test for new failOnError property
  
  Revision  Changes    Path
  1.7       +26 -2     
jakarta-turbine-maven/src/test/org/apache/maven/j2ee/WarValidatorTest.java
  
  Index: WarValidatorTest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/test/org/apache/maven/j2ee/WarValidatorTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- WarValidatorTest.java     15 May 2002 05:58:53 -0000      1.6
  +++ WarValidatorTest.java     15 May 2002 06:06:06 -0000      1.7
  @@ -61,7 +61,7 @@
    * Unit test for <code>WarValidator</code>.
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]";>dIon Gillard</a>
  - * @version $Id: WarValidatorTest.java,v 1.6 2002/05/15 05:58:53 dion Exp $
  + * @version $Id: WarValidatorTest.java,v 1.7 2002/05/15 06:06:06 dion Exp $
    */
   public class WarValidatorTest extends TestCase
   {
  @@ -135,7 +135,31 @@
               // this is the expected behaviour
           }
       }
  -    
  +
  +    /** 
  +     * test that the failOnError property when set to false doesn't throw
  +     * an exception.
  +     * @throws Exception when there is an unexpected problem
  +     */
  +    public void testFailOnError() throws Exception
  +    {
  +        try
  +        {
  +            validator.setFailOnError(false);
  +            validator.setWarFileName(emptyWarFile);
  +            validator.addFormatter(new ValidationFormatter() );
  +            validator.execute();
  +            assertTrue("Error not fired for an empty war file " + 
  +                "(with no META-INF, or WEB-INF/web.xml)", 
  +                validator.getStatus().isError()); 
  +        }
  +        catch (BuildException be)
  +        {
  +            fail("Empty war file (with no META-INF, or WEB-INF/web.xml) failed"
  +                + " the build process with failOnError=false");
  +        }
  +    }
  +
       /** 
        * test that a manifest only war file produces a warning
        * @throws Exception when there is an unexpected problem
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to