Author: snicoll
Date: Sat Aug  2 07:47:40 2008
New Revision: 681990

URL: http://svn.apache.org/viewvc?rev=681990&view=rev
Log:
MWAR-133: Added an IT to validate the scenario reported in the issue

Added:
    maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/   (with props)
    maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/goals.txt
      - copied unchanged from r681962, 
maven/plugins/trunk/maven-war-plugin/src/it/MWAR-129/goals.txt
    maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/pom.xml
      - copied, changed from r681962, 
maven/plugins/trunk/maven-war-plugin/src/it/MWAR-129/pom.xml
    maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/src/
    maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/src/main/
    maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/src/main/webapp/
    
maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/src/main/webapp/WEB-INF/
    
maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/src/main/webapp/WEB-INF/web.xml
    maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/src/main/webresources/
    
maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/src/main/webresources/filtered.properties
    maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/verify.bsh
      - copied, changed from r681962, 
maven/plugins/trunk/maven-war-plugin/src/it/MWAR-129/verify.bsh

Propchange: maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug  2 07:47:40 2008
@@ -0,0 +1,2 @@
+target
+build.log

Copied: maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/pom.xml (from 
r681962, maven/plugins/trunk/maven-war-plugin/src/it/MWAR-129/pom.xml)
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/pom.xml?p2=maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/pom.xml&p1=maven/plugins/trunk/maven-war-plugin/src/it/MWAR-129/pom.xml&r1=681962&r2=681990&rev=681990&view=diff
==============================================================================
--- maven/plugins/trunk/maven-war-plugin/src/it/MWAR-129/pom.xml (original)
+++ maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/pom.xml Sat Aug  2 
07:47:40 2008
@@ -20,102 +20,43 @@
 <project xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' 
xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd' 
xmlns='http://maven.apache.org/POM/4.0.0'>
   <modelVersion>4.0.0</modelVersion>
   <groupId>testwar</groupId>
-  <artifactId>MWAR-129</artifactId>
+  <artifactId>MWAR-133</artifactId>
   <packaging>war</packaging>
   <version>1.0-SNAPSHOT</version>
-  <name>MWAR-129 Maven Webapp</name>
-  <url>http://maven.apache.org</url>
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
- <build>
-    <defaultGoal>package</defaultGoal>
+  <name>MWAR-133 Maven Webapp</name>
+  <description>MWAR-133 it</description>
+
+  <properties>
+    <node.version>2.0</node.version>
+  </properties>
+  <build>
     <resources>
       <resource>
-        <filtering>true</filtering>
         <directory>src/main/resources</directory>
-      </resource>
-      <resource>
-        <directory>src/main/java</directory>
-        <includes>
-          <include>**/*.xml</include>
-        </includes>
+        <filtering>true</filtering>
       </resource>
     </resources>
-    <testResources>
-      <testResource>
-        <directory>src/test/resources</directory>
-      </testResource>
-      <testResource>
-        <directory>src/main/webapp</directory>
-        <includes>
-          <include>**/*.xml</include>
-        </includes>
-      </testResource>
-      <testResource>
-        <directory>src/test/webapp</directory>
-        <includes>
-          <include>**/*.xml</include>
-        </includes>
-      </testResource>
-    </testResources>
-    <finalName>${project.artifactId}</finalName>
     <plugins>
       <plugin>
         <artifactId>maven-war-plugin</artifactId>
-        <!--version>2.0.2</version-->
-        <!--version>2.1-alpha-2-SNAPSHOT</version-->
-        <version>@pom.version@</version>
+        <!--<version>@pom.version@</version>   -->
+        <version>2.1-alpha-2-SNAPSHOT</version>
         <configuration>
-          <warSourceDirectory>src/main/webapp</warSourceDirectory>
           <webResources>
             <resource>
+              <directory>src/main/webresources</directory>
               <filtering>true</filtering>
-              <directory>src/main/webapp</directory>
-              <targetPath>.</targetPath>
-              <includes>
-                <include>param.jsp</include>
-              </includes>
             </resource>
           </webResources>
         </configuration>
       </plugin>
     </plugins>
   </build>
-  <profiles>
-    <profile>
-      <id>profile1</id>
-      <activation>
-        <property>
-          <name>profile1</name>
-        </property>
-      </activation>
-      <build>
-        <finalName>profile1</finalName>
-      </build>
-      <properties>
-        <app.mainStyleSheet>profile1.css</app.mainStyleSheet>
-      </properties>
-    </profile>
-    <profile>
-      <id>profile2</id>
-      <activation>
-        <activeByDefault>true</activeByDefault>
-        <property>
-          <name>profile2</name>
-        </property>
-      </activation>
-      <build>
-        <finalName>profile2</finalName>
-      </build>
-      <properties>
-        <app.mainStyleSheet>profile2.css</app.mainStyleSheet>
-      </properties>
-    </profile>
-  </profiles>
+  <dependencies>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+      <version>1.4.6</version>
+    </dependency>
+  </dependencies>
 </project>

Added: 
maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/src/main/webapp/WEB-INF/web.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/src/main/webapp/WEB-INF/web.xml?rev=681990&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/src/main/webapp/WEB-INF/web.xml
 (added)
+++ 
maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/src/main/webapp/WEB-INF/web.xml
 Sat Aug  2 07:47:40 2008
@@ -0,0 +1,24 @@
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd"; >
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+-->
+<web-app>
+  <display-name>Archetype Created Web Application</display-name>
+</web-app>

Added: 
maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/src/main/webresources/filtered.properties
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/src/main/webresources/filtered.properties?rev=681990&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/src/main/webresources/filtered.properties
 (added)
+++ 
maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/src/main/webresources/filtered.properties
 Sat Aug  2 07:47:40 2008
@@ -0,0 +1,4 @@
+#
+# Replaced with the version in the pom
+#
+app.version=${node.version}
\ No newline at end of file

Copied: maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/verify.bsh (from 
r681962, maven/plugins/trunk/maven-war-plugin/src/it/MWAR-129/verify.bsh)
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/verify.bsh?p2=maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/verify.bsh&p1=maven/plugins/trunk/maven-war-plugin/src/it/MWAR-129/verify.bsh&r1=681962&r2=681990&rev=681990&view=diff
==============================================================================
--- maven/plugins/trunk/maven-war-plugin/src/it/MWAR-129/verify.bsh (original)
+++ maven/plugins/trunk/maven-war-plugin/src/it/MWAR-133/verify.bsh Sat Aug  2 
07:47:40 2008
@@ -32,28 +32,28 @@
         return false;
     }
     
-    File webappDirectory = new File( target, "profile2" );
+    File webappDirectory = new File( target, "MWAR-133-1.0-SNAPSHOT" );
     if ( !webappDirectory.exists() || !webappDirectory.isDirectory() )
     {
         System.err.println( "webappDirectory is missing or not a directory." );
         return false;
     }    
     
-    File param = new File ( webappDirectory, "param.jsp" );
-    if ( !param.exists() || param.isDirectory() )
+    File filtered = new File ( webappDirectory, "filtered.properties" );
+    if ( !filtered.exists() || filtered.isDirectory() )
     {
-        System.err.println( "param.jsp file is missing or a directory." );
+        System.err.println( "filtered.properties file is missing or a 
directory." );
         return false;
     }    
     System.out.println (" before reading param " );
-    FileInputStream fis = new FileInputStream ( param );
+    FileInputStream fis = new FileInputStream ( filtered );
     String paramContent = IOUtil.toString ( fis );
     
     
-    int indexOf = paramContent.indexOf( "<c:set var=\"app_version\" 
value=\"1.0-SNAPSHOT\"/>" );
+    int indexOf = paramContent.indexOf( "app.version=2.0" );
     if ( indexOf < 0)
     {
-       System.err.println( "param.jsp not contains <c:set var=\"app_version\" 
value=\"1.0-SNAPSHOT\"/>" );
+       System.err.println( "filtered.properties was not filtered with the 
value of ${node.version}" );
        return false;
     }
     


Reply via email to