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

svn commit: r684323 - in /maven/plugins/trunk/maven-invoker-plugin: ./ src/it/ src/it/pom-less-invocation/ src/it/pom-less-invocation/src/ src/it/pom-less-invocation/src/it/ src/it/pom-less-invocation/src/it/no-pom/ src/it/project-cloning/ src/it/proje...

Author: bentmann
Date: Sat Aug  9 12:59:57 2008
New Revision: 684323

URL: http://svn.apache.org/viewvc?rev=684323&view=rev
Log:
o Converted unit tests that executed the mojo to ITs

Added:
    maven/plugins/trunk/maven-invoker-plugin/src/it/
    maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/
    maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/pom.xml   (with props)
    maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/src/
    maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/src/it/
    maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/src/it/no-pom/
    maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/src/it/no-pom/workaround.txt   (with props)
    maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/verify.bsh   (with props)
    maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/
    maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/pom.xml   (with props)
    maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/
    maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/
    maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module/
    maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module-1/
    maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module-1/pom.xml   (with props)
    maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module-1/sub-module/
    maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module-1/sub-module/pom.xml   (with props)
    maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module/pom.xml   (with props)
    maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/verify.bsh   (with props)
    maven/plugins/trunk/maven-invoker-plugin/src/it/settings.xml   (with props)
Modified:
    maven/plugins/trunk/maven-invoker-plugin/pom.xml
    maven/plugins/trunk/maven-invoker-plugin/src/test/java/org/apache/maven/plugin/invoker/InvokerMojoTest.java

Modified: maven/plugins/trunk/maven-invoker-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/pom.xml?rev=684323&r1=684322&r2=684323&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-invoker-plugin/pom.xml Sat Aug  9 12:59:57 2008
@@ -136,4 +136,40 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
+
+  <profiles>
+    <profile>
+      <id>run-its</id>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-invoker-plugin</artifactId>
+            <configuration>
+              <debug>true</debug>
+              <projectsDirectory>src/it</projectsDirectory>
+              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+              <pomIncludes>
+                <pomInclude>*/pom.xml</pomInclude>
+              </pomIncludes>
+              <postBuildHookScript>verify.bsh</postBuildHookScript>
+              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+              <settingsFile>src/it/settings.xml</settingsFile>
+              <goals>
+                <goal>verify</goal>
+              </goals>
+            </configuration>
+            <executions>
+              <execution>
+                <id>integration-test</id>
+                <goals>
+                  <goal>install</goal>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
 </project>

Added: maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/pom.xml?rev=684323&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/pom.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/pom.xml Sat Aug  9 12:59:57 2008
@@ -0,0 +1,60 @@
+<?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.
+  -->
+
+<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.plugins.invoker</groupId>
+  <artifactId>pom-less-invocation</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <description>Test to check for support to launch Maven on a mere directory, i.e. without a POM</description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-invoker-plugin</artifactId>
+        <version>@pom.version@</version>
+        <configuration>
+          <projectsDirectory>src/it</projectsDirectory>
+          <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+          <pomIncludes>
+            <pomInclude>no-pom</pomInclude>
+          </pomIncludes>
+          <goals>
+            <goal>--version</goal>
+          </goals>
+        </configuration>
+        <executions>
+          <execution>
+            <id>integration-test</id>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/src/it/no-pom/workaround.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/src/it/no-pom/workaround.txt?rev=684323&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/src/it/no-pom/workaround.txt (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/src/it/no-pom/workaround.txt Sat Aug  9 12:59:57 2008
@@ -0,0 +1 @@
+This file ensures the directory is cloned, to be deleted once MINVOKER-48 is released.

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/src/it/no-pom/workaround.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/src/it/no-pom/workaround.txt
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/verify.bsh?rev=684323&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/verify.bsh (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/verify.bsh Sat Aug  9 12:59:57 2008
@@ -0,0 +1,34 @@
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+
+try
+{
+    File itDir = new File( basedir, "target/it" );
+    if ( !itDir.isDirectory() )
+    {
+        System.out.println( "IT directory not existent: " + itDir );
+        return false;
+    }
+
+    String[] paths = {
+            "no-pom", 
+            "no-pom/build.log", 
+    };
+    for ( String path : paths )
+    {
+        File file = new File( itDir, path );
+        if ( !file.exists() )
+        {
+            System.out.println( "Expected file/directory not existent: " + file );
+            return false;
+        }
+    }
+}
+catch( Throwable t )
+{
+    t.printStackTrace();
+    return false;
+}
+
+return true;

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/verify.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/pom-less-invocation/verify.bsh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/pom.xml?rev=684323&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/pom.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/pom.xml Sat Aug  9 12:59:57 2008
@@ -0,0 +1,60 @@
+<?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.
+  -->
+
+<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.plugins.invoker</groupId>
+  <artifactId>project-cloning</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <description>Test to check for proper project cloning</description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-invoker-plugin</artifactId>
+        <version>@pom.version@</version>
+        <configuration>
+          <projectsDirectory>src/it</projectsDirectory>
+          <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+          <pomIncludes>
+            <pomInclude>**/pom.xml</pomInclude>
+          </pomIncludes>
+          <goals>
+            <goal>validate</goal>
+          </goals>
+        </configuration>
+        <executions>
+          <execution>
+            <id>integration-test</id>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module-1/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module-1/pom.xml?rev=684323&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module-1/pom.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module-1/pom.xml Sat Aug  9 12:59:57 2008
@@ -0,0 +1,29 @@
+<?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.
+-->
+<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.test</groupId>
+  <artifactId>unit</artifactId>
+  <packaging>pom</packaging>
+  <version>0.1-SNAPSHOT</version>
+  <properties>
+    <interpolateValue>@foo@</interpolateValue>
+  </properties>
+</project>
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module-1/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module-1/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module-1/sub-module/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module-1/sub-module/pom.xml?rev=684323&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module-1/sub-module/pom.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module-1/sub-module/pom.xml Sat Aug  9 12:59:57 2008
@@ -0,0 +1,29 @@
+<?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.
+-->
+<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.test</groupId>
+  <artifactId>unit</artifactId>
+  <packaging>pom</packaging>
+  <version>0.1-SNAPSHOT</version>
+  <properties>
+    <interpolateValue>@foo@</interpolateValue>
+  </properties>
+</project>
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module-1/sub-module/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module-1/sub-module/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module/pom.xml?rev=684323&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module/pom.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module/pom.xml Sat Aug  9 12:59:57 2008
@@ -0,0 +1,29 @@
+<?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.
+-->
+<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.test</groupId>
+  <artifactId>unit</artifactId>
+  <packaging>pom</packaging>
+  <version>0.1-SNAPSHOT</version>
+  <properties>
+    <interpolateValue>@foo@</interpolateValue>
+  </properties>
+</project>
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/src/it/module/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/verify.bsh?rev=684323&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/verify.bsh (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/verify.bsh Sat Aug  9 12:59:57 2008
@@ -0,0 +1,39 @@
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+
+try
+{
+    File itDir = new File( basedir, "target/it" );
+    if ( !itDir.isDirectory() )
+    {
+        System.out.println( "IT directory not existent: " + itDir );
+        return false;
+    }
+
+    // NOTE: It is part of the test design that "module" is a prefix of "module-1"
+    String[] paths = {
+            "module", 
+            "module/pom.xml", 
+            "module-1", 
+            "module-1/pom.xml",
+            "module-1/sub-module",
+            "module-1/sub-module/pom.xml",
+    };
+    for ( String path : paths )
+    {
+        File file = new File( itDir, path );
+        if ( !file.exists() )
+        {
+            System.out.println( "Cloned file/directory not existent: " + file );
+            return false;
+        }
+    }
+}
+catch( Throwable t )
+{
+    t.printStackTrace();
+    return false;
+}
+
+return true;

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/project-cloning/verify.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: maven/plugins/trunk/maven-invoker-plugin/src/it/settings.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/settings.xml?rev=684323&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/settings.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/settings.xml Sat Aug  9 12:59:57 2008
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+      </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-invoker-plugin/src/it/settings.xml
------------------------------------------------------------------------------
    svn:eol-style = native

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

Modified: maven/plugins/trunk/maven-invoker-plugin/src/test/java/org/apache/maven/plugin/invoker/InvokerMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/test/java/org/apache/maven/plugin/invoker/InvokerMojoTest.java?rev=684323&r1=684322&r2=684323&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/test/java/org/apache/maven/plugin/invoker/InvokerMojoTest.java (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/test/java/org/apache/maven/plugin/invoker/InvokerMojoTest.java Sat Aug  9 12:59:57 2008
@@ -20,16 +20,12 @@
  */
 
 import java.io.File;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
 import org.apache.maven.plugin.testing.AbstractMojoTestCase;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
-import org.apache.maven.settings.Settings;
-import org.apache.maven.shared.invoker.Invoker;
-import org.codehaus.plexus.util.FileUtils;
 
 /**
  * @author <a href="mailto:olamy@apache.org">olamy</a>
@@ -57,36 +53,6 @@
         assertEquals( 3, goals.size() );
     }
 
-    public void testSimpleRunValidate()
-        throws Exception
-    {
-        MavenProjectStub project = new MavenProjectStub();
-        project.setTestClasspathElements( Collections.EMPTY_LIST );
-
-        InvokerMojo invokerMojo = new InvokerMojo();
-        setVariableValueToObject( invokerMojo, "goalsFile", "validate-goal.txt" );
-        setVariableValueToObject( invokerMojo, "project", project );
-        String dirPath = getBasedir() + "/src/test/resources/unit/goals-from-file/";
-        List goals = invokerMojo.getGoals( new File( dirPath ) );
-        assertEquals( 1, goals.size() );
-        setVariableValueToObject( invokerMojo, "projectsDirectory", new File( dirPath ) );
-        List pomIncludes = new ArrayList();
-        pomIncludes.add( "pom.xml" );
-        setVariableValueToObject( invokerMojo, "pomIncludes", pomIncludes );
-        setVariableValueToObject( invokerMojo, "invoker", getContainer().lookup( Invoker.ROLE ) );
-        File cloneProjectsTo = new File( getBasedir(), "target/unit/goals-from-file/" );
-        // clean if exists
-        if ( cloneProjectsTo.exists() )
-        {
-            FileUtils.deleteDirectory( cloneProjectsTo );
-        }
-        //cloneProjectsTo.getParent()
-        setVariableValueToObject( invokerMojo, "cloneProjectsTo", cloneProjectsTo );
-        setVariableValueToObject( invokerMojo, "postBuildHookScript", "verify.bsh" );
-        setVariableValueToObject( invokerMojo, "settings", new Settings() );
-        invokerMojo.execute();
-    }
-
     public void testSingleInvokerTest()
         throws Exception
     {
@@ -141,67 +107,4 @@
         assertFalse( InvokerMojo.alreadyCloned( "dirs", Collections.singletonList( "dir" ) ) );
     }    
 
-    public void testProjectCloning()
-        throws Exception
-    {
-        String dirPath = getBasedir() + "/src/test/resources/unit/nested-projects";
-
-        File cloneProjectsTo = new File( getBasedir(), "target/unit/nested-projects" );
-        if ( cloneProjectsTo.exists() )
-        {
-            FileUtils.deleteDirectory( cloneProjectsTo );
-        }
-
-        MavenProjectStub project = new MavenProjectStub();
-        project.setTestClasspathElements( Collections.EMPTY_LIST );
-
-        InvokerMojo invokerMojo = new InvokerMojo();
-        setVariableValueToObject( invokerMojo, "goals", Collections.singletonList( "validate" ) );
-        setVariableValueToObject( invokerMojo, "projectsDirectory", new File( dirPath ) );
-        setVariableValueToObject( invokerMojo, "pomIncludes", Collections.singletonList( "**/pom.xml" ) );
-        setVariableValueToObject( invokerMojo, "pomExcludes", Collections.singletonList( "pom.xml" ) );
-        setVariableValueToObject( invokerMojo, "cloneProjectsTo", cloneProjectsTo );
-        setVariableValueToObject( invokerMojo, "project", project );
-        setVariableValueToObject( invokerMojo, "settings", new Settings() );
-        setVariableValueToObject( invokerMojo, "invoker", getContainer().lookup( Invoker.ROLE ) );
-
-        invokerMojo.execute();
-
-        // NOTE: It is part of the test design that "module" is a prefix of "module-1"
-        assertTrue( new File( cloneProjectsTo, "module" ).isDirectory() );
-        assertTrue( new File( cloneProjectsTo, "module-1" ).isDirectory() );
-        assertTrue( new File( cloneProjectsTo, "module-1/sub-module" ).isDirectory() );
-    }
-
-    public void testPomLessMavenInvocation()
-        throws Exception
-    {
-        String dirPath = getBasedir() + "/src/test/resources/unit";
-
-        File cloneProjectsTo = new File( getBasedir(), "target/unit" );
-        if ( cloneProjectsTo.exists() )
-        {
-            FileUtils.deleteDirectory( cloneProjectsTo );
-        }
-
-        MavenProjectStub project = new MavenProjectStub();
-        project.setTestClasspathElements( Collections.EMPTY_LIST );
-
-        String pomIndependentMojo = "org.apache.maven.plugins:maven-deploy-plugin:2.4:help";
-
-        InvokerMojo invokerMojo = new InvokerMojo();
-        setVariableValueToObject( invokerMojo, "goals", Collections.singletonList( pomIndependentMojo ) );
-        setVariableValueToObject( invokerMojo, "projectsDirectory", new File( dirPath ) );
-        setVariableValueToObject( invokerMojo, "pomIncludes", Collections.singletonList( "no-pom" ) );
-        setVariableValueToObject( invokerMojo, "cloneProjectsTo", cloneProjectsTo );
-        setVariableValueToObject( invokerMojo, "project", project );
-        setVariableValueToObject( invokerMojo, "settings", new Settings() );
-        setVariableValueToObject( invokerMojo, "invoker", getContainer().lookup( Invoker.ROLE ) );
-
-        invokerMojo.execute();
-
-        assertTrue( new File( cloneProjectsTo, "no-pom" ).isDirectory() );
-        assertTrue( new File( cloneProjectsTo, "no-pom/build.log" ).isFile() );
-    }
-
 }