felipeal    2004/10/19 19:29:56

  Modified:    ear/src/plugin-test maven.xml project.xml
  Added:       ear/src/plugin-test/test01 LICENSE.txt maven.xml
                        project.properties project.xml
               ear/src/plugin-test/test01/src/application/META-INF
                        .cvsignore MANIFEST.MF
               ear/src/plugin-test/test01/src/resources resource.txt
  Removed:     ear/src/plugin-test LICENSE.txt
               ear/src/plugin-test/src/application/META-INF .cvsignore
                        MANIFEST.MF
               ear/src/plugin-test/src/resources resource.txt
  Log:
  change test layout to allow multiple test-cases (one per sub-directory)
  
  Revision  Changes    Path
  1.8       +3 -50     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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- maven.xml 15 Mar 2004 11:51:29 -0000      1.7
  +++ maven.xml 20 Oct 2004 02:29:56 -0000      1.8
  @@ -15,55 +15,8 @@
    * limitations under the License.
    */
    -->
  -<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"/>
  -  </goal>
  -  
  -  <goal name="test-ear">
  -    <attainGoal name="ear"/>
  -
  -    <!-- tests that the ear is generated -->
  -    <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" 
  -      value="${maven.build.dir}/test-maven-ear-plugin-1.0-SNAPSHOT.ear"/>
  -    <j:set var="unzipDir" value= "${maven.build.dir}/eartest"/>
  -    <mkdir dir="${unzipDir}"/>
  -    <unzip src="${earFile}" dest="${unzipDir}"/>
  -
  -    <!-- check for commons-logging -->
  -    <assert:assertFileExists file="${unzipDir}/commons-logging-1.0.3.jar"
  -      msg="commons logging was not bundled"/>
  -    
  -    <!-- check for commons-collections -->
  -    <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"/>
  -    <j:new var="saxReader" className="org.dom4j.io.SAXReader" />
  -    <j2ee:resolver var="resolver" />
  -    ${saxReader.setEntityResolver(resolver)}
  -    <x:parse var="applicationDoc" xml="${appXml.toURL()}" SAXReader="${saxReader}" 
/>
  -    <x:set var="firstJavaModule" 
select="string($applicationDoc/application/module/java)"/>
  -
  -    <assert:assertEquals 
  -      expected="commons-collections-2.1.jar" 
  -      value="${firstJavaModule}"
  -      msg="commons collections was not the first java module"/>
  -
  -    <!-- check for resources -->
  -    <assert:assertFileExists file="${unzipDir}/resource.txt"/>
  -
  -    <!-- check for the LICENSE -->
  -    <assert:assertFileExists file="${unzipDir}/META-INF/LICENSE.txt"/>
  -
  +<project xmlns:util="jelly:util" xmlns:maven="jelly:maven" xmlns:j="jelly:core" 
xmlns:assert="assert" xmlns:ant="jelly:ant">
  +  <goal name="testPlugin">
  +    <maven:reactor basedir="${basedir}" includes="test*/project.xml" 
goals="testPlugin" banner="Test" ignoreFailures="false"/>
     </goal>
   </project>
  
  
  
  1.11      +15 -72    maven-plugins/ear/src/plugin-test/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/ear/src/plugin-test/project.xml,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- project.xml       15 Oct 2004 05:01:54 -0000      1.10
  +++ project.xml       20 Oct 2004 02:29:56 -0000      1.11
  @@ -21,79 +21,22 @@
   <project>
     <pomVersion>3</pomVersion>
     <name>Test project for Maven Ear Plugin</name>
  -  <id>test-maven-ear-plugin</id>
  -  <currentVersion>1.0-SNAPSHOT</currentVersion>
  +  <groupId>maven</groupId>
  +  <currentVersion>1.0</currentVersion>
     <organization>
  -    <name>Nettec</name>
  -    <url>http://www.nettec.net</url>
  +    <name>Apache Software Foundation</name>
  +    <url>http://www.apache.org/</url>
  +    <logo>http://maven.apache.org/images/apache-maven-project.png</logo>
     </organization>
  -  <inceptionYear>2002</inceptionYear>
  -  <package>net.nettec.marsh.begin</package>
  -  <shortDescription>Marsh Begin TTS Maven</shortDescription>
  -  <description>TTS Begin</description>
  -  <url/>
  -  <issueTrackingUrl>http://bugzilla</issueTrackingUrl>
  -  <siteAddress>www.nettec.net</siteAddress>
  -  <siteDirectory/>
  -  <distributionDirectory/>
  +  <inceptionYear>2001</inceptionYear>
  +  <package>org.apache.maven</package>
  +  <logo>http://maven.apache.org/images/maven.gif</logo>
  +  <description>Test for Maven Ear plugin</description>
  +  <shortDescription>Test for Maven Ear plugin</shortDescription>
  +  <url>http://maven.apache.org/reference/plugins/ear/</url>
  +  <siteDirectory>/www/maven.apache.org/reference/plugins/ear/</siteDirectory>
     <repository>
  -    <connection>scm:cvs:pserver:[EMAIL PROTECTED]:/home/cvspublic:maven</connection>
  -    <url>http://cvs.apache.org/viewcvs/maven/</url>
  +    <connection>scm:cvs:pserver:[EMAIL 
PROTECTED]:/home/cvspublic:maven-plugins/ear/</connection>
  +    <url>http://cvs.apache.org/viewcvs/maven-plugins/ear/</url>
     </repository>
  -  <versions/>
  -  <mailingLists/>
  -  <developers>
  -    <developer>
  -      <name>Nathan Coast</name>
  -      <id>nathanc</id>
  -      <email>[EMAIL PROTECTED]</email>
  -      <organization>Shadow Solutions</organization>
  -      <role>Java Developer</role>
  -    </developer>
  -  </developers>
  -  <dependencies>
  -    <dependency>
  -      <groupId>commons-logging</groupId>
  -      <artifactId>commons-logging</artifactId>
  -      <version>1.0.3</version>
  -      <url>http://jakarta.apache.org/commons/logging.html</url>
  -      <properties>
  -        <ear.bundle>true</ear.bundle>
  -      </properties>
  -    </dependency>
  -    <dependency>
  -      <groupId>commons-collections</groupId>
  -      <artifactId>commons-collections</artifactId>
  -      <version>2.1</version>
  -      <url>http://jakarta.apache.org/commons/collections/</url>
  -      <properties>
  -        <ear.module>true</ear.module>
  -      </properties>
  -    </dependency>
  -    <dependency>
  -      <groupId>commons-jelly</groupId>
  -      <artifactId>commons-jelly-tags-xml</artifactId>
  -      <version>20030211.142705</version>
  -    </dependency>
  -    <!-- Needed for the entity resolver -->
  -    <dependency>
  -      <groupId>maven</groupId>
  -      <artifactId>maven-j2ee-plugin</artifactId>
  -      <version>1.4</version>
  -      <type>plugin</type>
  -    </dependency>
  -  </dependencies>
  -  <build>
  -    <nagEmailAddress>[EMAIL PROTECTED]</nagEmailAddress>
  -    <sourceDirectory>src</sourceDirectory>
  -    <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
  -    <!-- Resources that are packaged up inside the JAR file -->
  -    <resources>
  -      <resource>
  -        <directory>src/resources</directory>
  -        <targetPath></targetPath>
  -        <includes><include>*.txt</include></includes>
  -      </resource>
  -    </resources>
  -  </build>
  -</project>
  +</project>
  \ No newline at end of file
  
  
  
  1.1                  maven-plugins/ear/src/plugin-test/test01/LICENSE.txt
  
  Index: LICENSE.txt
  ===================================================================
  mung beans
  
  
  1.1                  maven-plugins/ear/src/plugin-test/test01/maven.xml
  
  Index: maven.xml
  ===================================================================
  <!-- 
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
   -->
  <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"/>
    </goal>
    
    <goal name="test-ear">
      <attainGoal name="ear"/>
  
      <!-- tests that the ear is generated -->
      <assert:assertFileExists file="${maven.build.dir}/${maven.final.name}.ear"/>
      
      <!-- unzip the ear and look for the jars -->
      <j:set var="earFile" 
        value="${maven.build.dir}/${maven.final.name}.ear"/>
      <j:set var="unzipDir" value= "${maven.build.dir}/eartest"/>
      <mkdir dir="${unzipDir}"/>
      <unzip src="${earFile}" dest="${unzipDir}"/>
  
      <!-- check for commons-logging -->
      <assert:assertFileExists file="${unzipDir}/commons-logging-1.0.3.jar"
        msg="commons logging was not bundled"/>
      
      <!-- check for commons-collections -->
      <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"/>
      <j:new var="saxReader" className="org.dom4j.io.SAXReader" />
      <j2ee:resolver var="resolver" />
      ${saxReader.setEntityResolver(resolver)}
      <x:parse var="applicationDoc" xml="${appXml.toURL()}" SAXReader="${saxReader}" />
      <x:set var="firstJavaModule" 
select="string($applicationDoc/application/module/java)"/>
  
      <assert:assertEquals 
        expected="commons-collections-2.1.jar" 
        value="${firstJavaModule}"
        msg="commons collections was not the first java module"/>
  
      <!-- check for resources -->
      <assert:assertFileExists file="${unzipDir}/resource.txt"/>
  
      <!-- check for the LICENSE -->
      <assert:assertFileExists file="${unzipDir}/META-INF/LICENSE.txt"/>
  
    </goal>
  </project>
  
  
  
  1.1                  maven-plugins/ear/src/plugin-test/test01/project.properties
  
  Index: project.properties
  ===================================================================
  # -------------------------------------------------------------------
  # Copyright 2001-2004 The Apache Software Foundation.
  # 
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  # 
  #      http://www.apache.org/licenses/LICENSE-2.0
  #  
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  # -------------------------------------------------------------------
  
  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
  
  
  1.1                  maven-plugins/ear/src/plugin-test/test01/project.xml
  
  Index: project.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!-- 
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
   -->
  
  
  <project>
    <pomVersion>3</pomVersion>
    <name>Test project for Maven Ear Plugin 01</name>
    <artifactId>test-maven-ear-plugin-01</artifactId>
    <organization>
      <name>Nettec</name>
      <url>http://www.nettec.net</url>
    </organization>
    <inceptionYear>2002</inceptionYear>
    <package>net.nettec.marsh.begin</package>
    <shortDescription>Marsh Begin TTS Maven</shortDescription>
    <description>TTS Begin</description>
    <url/>
    <developers>
      <developer>
        <name>Nathan Coast</name>
        <id>nathanc</id>
        <email>[EMAIL PROTECTED]</email>
        <organization>Shadow Solutions</organization>
        <role>Java Developer</role>
      </developer>
    </developers>
    <dependencies>
      <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.0.3</version>
        <url>http://jakarta.apache.org/commons/logging.html</url>
        <properties>
          <ear.bundle>true</ear.bundle>
        </properties>
      </dependency>
      <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>2.1</version>
        <url>http://jakarta.apache.org/commons/collections/</url>
        <properties>
          <ear.module>true</ear.module>
        </properties>
      </dependency>
      <dependency>
        <groupId>commons-jelly</groupId>
        <artifactId>commons-jelly-tags-xml</artifactId>
        <version>20030211.142705</version>
      </dependency>
      <!-- Needed for the entity resolver -->
      <dependency>
        <groupId>maven</groupId>
        <artifactId>maven-j2ee-plugin</artifactId>
        <version>1.4</version>
        <type>plugin</type>
      </dependency>
    </dependencies>
    <build>
      <sourceDirectory>src</sourceDirectory>
      <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
      <!-- Resources that are packaged up inside the JAR file -->
      <resources>
        <resource>
          <directory>src/resources</directory>
          <targetPath></targetPath>
          <includes><include>*.txt</include></includes>
        </resource>
      </resources>
    </build>
  </project>
  
  
  
  1.1                  
maven-plugins/ear/src/plugin-test/test01/src/application/META-INF/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  application.xml
  
  
  
  1.1                  
maven-plugins/ear/src/plugin-test/test01/src/application/META-INF/MANIFEST.MF
  
  Index: MANIFEST.MF
  ===================================================================
  mung: beans
  
  
  
  1.1                  
maven-plugins/ear/src/plugin-test/test01/src/resources/resource.txt
  
  Index: resource.txt
  ===================================================================
  This is a dummy file
  
  

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

Reply via email to