You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2008/09/09 03:59:07 UTC

svn commit: r693340 - in /maven/core-integration-testing/trunk/core-integration-tests/src/test: java/org/apache/maven/integrationtests/ resources/mng-3747-prefixedPathExpression/ resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/ resources...

Author: jdcasey
Date: Mon Sep  8 18:59:06 2008
New Revision: 693340

URL: http://svn.apache.org/viewvc?rev=693340&view=rev
Log:
[MNG-3747] integration test.

Added:
    maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3747PrefixedPathExpressionTest.java   (with props)
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/src/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/src/main/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/src/main/java/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/src/main/java/jar/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/src/main/java/jar/MyMojo.java   (with props)
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/project/
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/project/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/readme.txt   (with props)
Modified:
    maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java

Modified: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java?rev=693340&r1=693339&r2=693340&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java (original)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java Mon Sep  8 18:59:06 2008
@@ -76,6 +76,7 @@
 MavenITmng3645POMSyntaxErrorTest
 */
 
+        suite.addTestSuite( MavenITmng3747PrefixedPathExpressionTest.class );
         suite.addTestSuite( MavenITmng3746POMPropertyOverrideTest.class );
         suite.addTestSuite( MavenITmng3743ForkWithPluginManagementTest.class );
         suite.addTestSuite( MavenITmng3740SelfReferentialReactorProjectsTest.class );

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3747PrefixedPathExpressionTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3747PrefixedPathExpressionTest.java?rev=693340&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3747PrefixedPathExpressionTest.java (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3747PrefixedPathExpressionTest.java Mon Sep  8 18:59:06 2008
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+
+package org.apache.maven.integrationtests;
+
+import java.io.File;
+
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-3747">MNG-3747</a>.
+ *
+ * @todo Fill in a better description of what this test verifies!
+ * 
+ * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
+ * @author jdcasey
+ * 
+ */
+public class MavenITmng3747PrefixedPathExpressionTest
+    extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng3747PrefixedPathExpressionTest()
+        throws InvalidVersionSpecificationException
+    {
+        super( "(2.0.8,)" ); // only test in 2.0.9+
+    }
+
+    public void testitMNG3747 ()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3747-prefixedPathExpression" );
+        File pluginDir = new File( testDir, "maven-mng3747-plugin" );
+        File projectDir = new File( testDir, "project" );
+
+        Verifier verifier;
+
+        verifier = new Verifier( pluginDir.getAbsolutePath() );
+        verifier.executeGoal( "install" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+        
+        verifier = new Verifier( projectDir.getAbsolutePath() );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+        
+    }
+}

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3747PrefixedPathExpressionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/pom.xml?rev=693340&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/pom.xml Mon Sep  8 18:59:06 2008
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.mng3747</groupId>
+  <artifactId>maven-mng3747-plugin</artifactId>
+  <packaging>maven-plugin</packaging>
+  <name>maven-mng3747-plugin Maven Mojo</name>
+  <version>1</version>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/src/main/java/jar/MyMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/src/main/java/jar/MyMojo.java?rev=693340&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/src/main/java/jar/MyMojo.java (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/src/main/java/jar/MyMojo.java Mon Sep  8 18:59:06 2008
@@ -0,0 +1,56 @@
+package jar;
+
+/*
+ * Copyright 2001-2005 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.
+ */
+
+import java.io.File;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * @goal test
+ */
+public class MyMojo
+    extends AbstractMojo
+{
+    /**
+     * Location of the file.
+     * @parameter default-value="${project.build.directory}"
+     * @readonly
+     */
+    private File buildDirectory;
+    
+    /**
+     * @parameter
+     * @required
+     */
+    private String config;
+
+    public void execute()
+        throws MojoExecutionException
+    {
+        if ( !buildDirectory.isAbsolute() )
+        {
+            throw new MojoExecutionException( "The expression 'project.build.directory' didn't render an absolute path when injected from a plugin parameter default value." );
+        }
+        
+        if ( config.indexOf( buildDirectory.getAbsolutePath() ) < 0 )
+        {
+            throw new MojoExecutionException( "The expression 'project.build.directory' didn't render an absolute path when used inside a plugin configuration of type String." );
+        }
+    }
+}

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/maven-mng3747-plugin/src/main/java/jar/MyMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/project/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/project/pom.xml?rev=693340&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/project/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/project/pom.xml Mon Sep  8 18:59:06 2008
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.mng3747</groupId>
+  <artifactId>project</artifactId>
+  <version>1</version>
+  <packaging>pom</packaging>
+  
+  <build>
+    <directory>relative</directory>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.mng3747</groupId>
+        <artifactId>maven-mng3747-plugin</artifactId>
+        <version>1</version>
+        <executions>
+          <execution>
+            <id>test</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>test</goal>
+            </goals>
+            <configuration>
+              <config>path is: ${project.build.directory}/somepath</config>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/project/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/readme.txt
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/readme.txt?rev=693340&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/readme.txt (added)
+++ maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/readme.txt Mon Sep  8 18:59:06 2008
@@ -0,0 +1 @@
+Fill this in with a description of the scenario this test attempts to check. Also include instructions for running the test manually from the command line.
\ No newline at end of file

Propchange: maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-3747-prefixedPathExpression/readme.txt
------------------------------------------------------------------------------
    svn:eol-style = native