dion        2004/03/15 03:51:29

  Modified:    ear/src/plugin-test project.properties maven.xml
  Log:
  - Add a test for the license being included in the EAR

  - Add a property so that the license is included in the test project

  - Use the assert tags from the plugin plugin
  
  Revision  Changes    Path
  1.4       +3 -0      maven-plugins/ear/src/plugin-test/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/maven-plugins/ear/src/plugin-test/project.properties,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- project.properties        4 Mar 2004 18:04:27 -0000       1.3
  +++ project.properties        15 Mar 2004 11:51:29 -0000      1.4
  @@ -17,3 +17,6 @@
   maven.deployable.component=${maven.final.name}.ear
   maven.j2ee.ear.appxml=${maven.conf.dir}/application.xml
   maven.ear.appxml.generate=true
  +# note the override below is needed, as the ear plugin redefines the licenseFile in
  +# it's own project.properties, and running plugin:test would otherwise fail
  +maven.license.licenseFile=${basedir}/LICENSE.txt
  \ No newline at end of file
  
  
  
  1.7       +20 -27    maven-plugins/ear/src/plugin-test/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/ear/src/plugin-test/maven.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- maven.xml 15 Mar 2004 10:54:10 -0000      1.6
  +++ maven.xml 15 Mar 2004 11:51:29 -0000      1.7
  @@ -15,7 +15,11 @@
    * limitations under the License.
    */
    -->
  -<project xmlns:j="jelly:core" xmlns:u="jelly:util" xmlns:x="jelly:xml" 
xmlns:j2ee="j2ee">
  +<project xmlns:j="jelly:core" 
  +         xmlns:u="jelly:util" 
  +         xmlns:x="jelly:xml"
  +         xmlns:assert="assert"
  +         xmlns:j2ee="j2ee">
   
     <goal name="testPlugin" prereqs="test-ear">
       <attainGoal name="clean"/>
  @@ -25,12 +29,7 @@
       <attainGoal name="ear"/>
   
       <!-- tests that the ear is generated -->
  -    <j:set var="expectedFile" 
  -      value="${maven.build.dir}/test-maven-ear-plugin-1.0-SNAPSHOT.ear"/>
  -    <u:file var="file" name="${expectedFile}" />
  -    <j:if test="${!(file.exists())}">
  -      <fail>${expectedFile} not generated</fail>
  -    </j:if>
  +    <assert:assertFileExists 
file="${maven.build.dir}/test-maven-ear-plugin-1.0-SNAPSHOT.ear"/>
       
       <!-- unzip the ear and look for the jars -->
       <j:set var="earFile" 
  @@ -38,18 +37,14 @@
       <j:set var="unzipDir" value= "${maven.build.dir}/eartest"/>
       <mkdir dir="${unzipDir}"/>
       <unzip src="${earFile}" dest="${unzipDir}"/>
  +
       <!-- check for commons-logging -->
  -    <j:set var="expectedFile" value="${unzipDir}/commons-logging-1.0.3.jar"/>
  -    <u:file var="file" name="${expectedFile}" />
  -    <j:if test="${!(file.exists())}">
  -      <fail>${expectedFile} not bundled</fail>
  -    </j:if>
  +    <assert:assertFileExists file="${unzipDir}/commons-logging-1.0.3.jar"
  +      msg="commons logging was not bundled"/>
  +    
       <!-- check for commons-collections -->
  -    <j:set var="expectedFile" value="${unzipDir}/commons-collections-2.1.jar"/>
  -    <u:file var="file" name="${expectedFile}" />
  -    <j:if test="${!(file.exists())}">
  -      <fail>${expectedFile} not bundled</fail>
  -    </j:if>
  +    <assert:assertFileExists file="${unzipDir}/commons-collections-2.1.jar"
  +      msg="commons collections was not bundled"/>
   
       <!-- check application.xml got a java module in it -->
       <u:file var="appXml" name="${unzipDir}/META-INF/application.xml"/>
  @@ -59,18 +54,16 @@
       <x:parse var="applicationDoc" xml="${appXml.toURL()}" SAXReader="${saxReader}" 
/>
       <x:set var="firstJavaModule" 
select="string($applicationDoc/application/module/java)"/>
   
  -    <j:if test="${firstJavaModule != 'commons-collections-2.1.jar'}">
  -      <fail>
  -        commons-collections-2.1.jar not bundled as a java module found 
'${firstJavaModule}' instead
  -      </fail>
  -    </j:if>
  +    <assert:assertEquals 
  +      expected="commons-collections-2.1.jar" 
  +      value="${firstJavaModule}"
  +      msg="commons collections was not the first java module"/>
   
       <!-- check for resources -->
  -    <j:set var="expectedFile" value="${unzipDir}/resource.txt"/>
  -    <u:file var="file" name="${expectedFile}" />
  -    <j:if test="${!(file.exists())}">
  -      <fail>${expectedFile} not bundled as a resource</fail>
  -    </j:if>
  +    <assert:assertFileExists file="${unzipDir}/resource.txt"/>
  +
  +    <!-- check for the LICENSE -->
  +    <assert:assertFileExists file="${unzipDir}/META-INF/LICENSE.txt"/>
   
     </goal>
   </project>
  
  
  

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

Reply via email to