dion        02/05/14 21:57:54

  Modified:    src/test/org/apache/maven/j2ee WarValidatorTest.java
  Log:
  Added test for war file with no web.xml
  
  Revision  Changes    Path
  1.5       +18 -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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- WarValidatorTest.java     15 May 2002 04:37:41 -0000      1.4
  +++ WarValidatorTest.java     15 May 2002 04:57:54 -0000      1.5
  @@ -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.4 2002/05/15 04:37:41 dion Exp $
  + * @version $Id: WarValidatorTest.java,v 1.5 2002/05/15 04:57:54 dion Exp $
    */
   public class WarValidatorTest extends TestCase
   {
  @@ -70,6 +70,8 @@
       private WarValidator validator = null;
       /** file name for the empty war used during testing */
       private String emptyWarFile = null;
  +    /** file name for manifest-only war used during testing */
  +    private String manifestOnlyWarFile = null;
       
       /** 
        * Creates a new instance of WarValidatorTest
  @@ -93,6 +95,7 @@
           assertNotNull("The system property file.separator was not defined.", 
               fs);
           emptyWarFile = baseDir + fs + "src/test-j2ee/empty.war";
  +        manifestOnlyWarFile = baseDir + fs + "src/test-j2ee/manifest-only.war";
       }
       
       /** 
  @@ -131,4 +134,18 @@
               // this is the expected behaviour
           }
       }
  +    
  +    /** 
  +     * test that a manifest only war file produces a warning
  +     * @throws Exception when there is an unexpected problem
  +     */
  +    public void testManifestOnlyWar() throws Exception
  +    {
  +        validator.setWarFileName(manifestOnlyWarFile);
  +        validator.addFormatter(new ValidationFormatter() );
  +        validator.execute();
  +        assertTrue("Manifest only war file (with no WEB-INF/web.xml) has" +
  +            " succeeded without a warning", validator.getStatus().isWarning());
  +    }
  +
   }
  
  
  

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

Reply via email to