dion        02/05/14 21:37:41

  Modified:    src/test/org/apache/maven/j2ee WarValidatorTest.java
  Log:
  Added a test for an empty war file which should fail validation
  
  Revision  Changes    Path
  1.4       +22 -1     
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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WarValidatorTest.java     15 May 2002 03:49:41 -0000      1.3
  +++ WarValidatorTest.java     15 May 2002 04:37:41 -0000      1.4
  @@ -55,12 +55,13 @@
    */
   
   import junit.framework.TestCase;
  +import org.apache.tools.ant.BuildException;
   
   /** 
    * Unit test for <code>WarValidator</code>.
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]";>dIon Gillard</a>
  - * @version $Id: WarValidatorTest.java,v 1.3 2002/05/15 03:49:41 dion Exp $
  + * @version $Id: WarValidatorTest.java,v 1.4 2002/05/15 04:37:41 dion Exp $
    */
   public class WarValidatorTest extends TestCase
   {
  @@ -106,6 +107,26 @@
               fail("war validator executed without a war file");
           } 
           catch (NullPointerException e) 
  +        {
  +            // this is the expected behaviour
  +        }
  +    }
  +    
  +    /** 
  +     * test that an empty war file produces an error
  +     * @throws Exception when there is an unexpected problem
  +     */
  +    public void testEmptyWar() throws Exception
  +    {
  +        try
  +        {
  +            validator.setWarFileName(emptyWarFile);
  +            validator.addFormatter(new ValidationFormatter() );
  +            validator.execute();
  +            fail("Empty war file (with no META-INF, or WEB-INF/web.xml) has" +
  +                " succeeded");
  +        }
  +        catch (BuildException be)
           {
               // this is the expected behaviour
           }
  
  
  

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

Reply via email to