maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r692561 - in /maven/plugins/trunk/maven-resources-plugin: pom.xml src/it/filter/pom.xml src/it/filter/verify.bsh src/it/settings.xml
Date Fri, 05 Sep 2008 21:53:57 GMT
Author: olamy
Date: Fri Sep  5 14:53:57 2008
New Revision: 692561

URL: http://svn.apache.org/viewvc?rev=692561&view=rev
Log:
enable it

Added:
    maven/plugins/trunk/maven-resources-plugin/src/it/filter/verify.bsh   (with props)
    maven/plugins/trunk/maven-resources-plugin/src/it/settings.xml   (with props)
Modified:
    maven/plugins/trunk/maven-resources-plugin/pom.xml
    maven/plugins/trunk/maven-resources-plugin/src/it/filter/pom.xml

Modified: maven/plugins/trunk/maven-resources-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/pom.xml?rev=692561&r1=692560&r2=692561&view=diff
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-resources-plugin/pom.xml Fri Sep  5 14:53:57 2008
@@ -94,19 +94,26 @@
         <plugins>
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-antrun-plugin</artifactId>
+            <artifactId>maven-invoker-plugin</artifactId>
+            <configuration>
+              <projectsDirectory>src/it</projectsDirectory>
+              <pomIncludes>
+                <pomInclude>**/**/pom.xml</pomInclude>
+              </pomIncludes>
+              <postBuildHookScript>verify.bsh</postBuildHookScript>
+              <localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath>
+              <goals>
+                <goal>clean</goal>
+                <goal>process-test-resources</goal>
+              </goals>
+              <settingsFile>src/it/settings.xml</settingsFile>  
+              <cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo>
           
+            </configuration>
             <executions>
               <execution>
                 <id>integration-test</id>
-                <phase>integration-test</phase>
-                <configuration>
-                  <tasks>
-                    <echo/><echo/><echo/><echo/><echo/>
-                    <echo level="warning">NO INTEGRATION TESTS DEFINED</echo>
-                    <echo/><echo/><echo/><echo/><echo/>
-                  </tasks>
-                </configuration>
                 <goals>
+                  <goal>install</goal>
                   <goal>run</goal>
                 </goals>
               </execution>

Modified: maven/plugins/trunk/maven-resources-plugin/src/it/filter/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/filter/pom.xml?rev=692561&r1=692560&r2=692561&view=diff
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/it/filter/pom.xml (original)
+++ maven/plugins/trunk/maven-resources-plugin/src/it/filter/pom.xml Fri Sep  5 14:53:57 2008
@@ -36,6 +36,14 @@
     <filters>
       <filter>src/main/filters/my.filter</filter>
     </filters>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-resources-plugin</artifactId>
+          <version>@pom.version@</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
   </build>
 
   <!--

Added: maven/plugins/trunk/maven-resources-plugin/src/it/filter/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/filter/verify.bsh?rev=692561&view=auto
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/it/filter/verify.bsh (added)
+++ maven/plugins/trunk/maven-resources-plugin/src/it/filter/verify.bsh Fri Sep  5 14:53:57
2008
@@ -0,0 +1,102 @@
+
+/*
+ * 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.
+ */
+
+import java.io.*;
+
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    File target = new File( basedir, "target" );
+    if ( !target.exists() || !target.isDirectory() )
+    {
+        System.err.println( "target file is missing or a directory." );
+        return false;
+    }
+    
+    File someResource = new File( target, "/classes/SomeResource.txt" );
+    if ( !someResource.exists() || someResource.isDirectory() )
+    {
+        System.err.println( "SomeResource.txt is missing or not a file." );
+        return false;
+    }    
+    
+    FileInputStream fis = new FileInputStream ( someResource );
+    String paramContent = IOUtil.toString ( fis );
+    
+    //test:direct resolution project.version=1.0-SNAPSHOT
+    int indexOf = paramContent.indexOf( "test:direct resolution project.version=1.0-SNAPSHOT"
);
+    if ( indexOf < 0)
+    {
+      System.err.println( "SomeResource.txt not contains test:direct resolution project.version=1.0-SNAPSHOT"
);
+      return false;
+    }    
+    
+
+    //test:filter resolution project.version=1.0-SNAPSHOT
+    indexOf = paramContent.indexOf( "test:filter resolution project.version=1.0-SNAPSHOT"
);
+    if ( indexOf < 0)
+    {
+      System.err.println( "SomeResource.txt not contains test:filter resolution project.version=1.0-SNAPSHOT"
);
+      return false;
+    } 
+    
+    //test:filter direct projectProperty=foo-projectProperty-bar
+    indexOf = paramContent.indexOf( "test:filter direct projectProperty=foo-projectProperty-bar"
);
+    if ( indexOf < 0)
+    {
+      System.err.println( "SomeResource.txt not contains test:filter direct projectProperty=foo-projectProperty-bar"
);
+      return false;
+    }    
+    
+    //test:filter resolution projectProperty=foo-projectProperty-bar
+    indexOf = paramContent.indexOf( "test:filter resolution projectProperty=foo-projectProperty-bar"
);
+    if ( indexOf < 0)
+    {
+      System.err.println( "SomeResource.txt not contains test:filter resolution projectProperty=foo-projectProperty-bar"
);
+      return false;
+    }         
+    
+    //test:filter direct profileProperty=foo-profileProperty-bar    
+    indexOf = paramContent.indexOf( "test:filter direct profileProperty=foo-profileProperty-bar"
);
+    if ( indexOf < 0)
+    {
+      System.err.println( "SomeResource.txt not contains test:filter direct profileProperty=foo-profileProperty-bar"
);
+      return false;
+    }     
+    
+    //test:filter resolution profileProperty=foo-profileProperty-bar    
+    indexOf = paramContent.indexOf( "test:filter resolution profileProperty=foo-profileProperty-bar"
);
+    if ( indexOf < 0)
+    {
+      System.err.println( "SomeResource.txt not contains test:filter resolution profileProperty=foo-profileProperty-bar"
);
+      return false;
+    }
+            
+}
+catch( IOException e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;

Propchange: maven/plugins/trunk/maven-resources-plugin/src/it/filter/verify.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-resources-plugin/src/it/filter/verify.bsh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-resources-plugin/src/it/settings.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/settings.xml?rev=692561&view=auto
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/it/settings.xml (added)
+++ maven/plugins/trunk/maven-resources-plugin/src/it/settings.xml Fri Sep  5 14:53:57 2008
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<settings>
+  <profiles>
+    <profile>
+      <id>it-repo</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <repositories>
+        <repository>
+          <id>local.central</id>
+          <url>file:///@localRepository@</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </repository>
+        <repository>
+          <id>apache.snapshots</id>
+          <name>Apache Snapshot Repository</name>
+          <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+          <releases>
+            <enabled>false</enabled>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </repository>
+      </repositories>
+      <pluginRepositories>
+        <pluginRepository>
+          <id>local.central</id>
+          <url>file:///@localRepository@</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </pluginRepository>
+      </pluginRepositories>
+    </profile>
+  </profiles>
+</settings>

Propchange: maven/plugins/trunk/maven-resources-plugin/src/it/settings.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-resources-plugin/src/it/settings.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



Mime
View raw message