From surefire-commits-returndavid04@example.net Tue Mar 16 10:52:08 2010
Return-Path: <surefire-commits-returndavid04@example.net>
Delivered-To: david04@example.net
Received: (qmail 73044 invoked from network); 16 Mar 2010 10:52:07 -0000
Received: from unknown (HELO mail.apache.org) (83.161.120.155)
  by 83.161.120.155 with SMTP; 16 Mar 2010 10:52:07 -0000
Received: (qmail 57441 invoked by uid 500); 16 Mar 2010 10:52:07 -0000
Delivered-To: david04@example.net
Received: (qmail 57401 invoked by uid 500); 16 Mar 2010 10:52:07 -0000
Mailing-List: contact david04@example.net; run by ezmlm
Precedence: bulk
List-Help: <mailto:david04@example.net>
List-Unsubscribe: <mailto:david04@example.net>
List-Post: <mailto:david04@example.net>
List-Id: <surefire-commits.maven.apache.org>
Reply-To: david04@example.net
Delivered-To: mailing list david04@example.net
Received: (qmail 57394 invoked by uid 99); 16 Mar 2010 10:52:06 -0000
Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Mar 2010 10:52:06 +0000
X-ASF-Spam-Status: No, hits=-1001.3 required=10.0
	tests=ALL_TRUSTED,AWL
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Mar 2010 10:52:05 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id A601B23888CC; Tue, 16 Mar 2010 10:51:45 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r923683 -
 /maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
Date: Tue, 16 Mar 2010 10:51:45 -0000
To: david04@example.net
From: david04@example.net
X-Mailer: svnmailer-1.0.8
Message-Id: <david04@example.net>

Author: stephenc
Date: Tue Mar 16 10:51:45 2010
New Revision: 923683

URL: http://svn.apache.org/viewvc?rev=923683&view=rev
Log:
[SUREFIRE-604] Submitted by Volkmar Nissen

o Tabs replaced with spaces

o Reformatted to Maven Apache code style

Modified:
    maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java

Modified: maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java?rev=923683&r1=923682&r2=923683&view=diff
==============================================================================
--- maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java (original)
+++ maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java Tue Mar 16 10:51:45 2010
@@ -610,11 +610,19 @@ public class IntegrationTestMojo
             }
             catch ( SurefireBooterForkException e )
             {
-                throw new MojoExecutionException( e.getMessage(), e );
+                // Don't stop processing when timeout or other exception occures
+                // Otherwise, the following life cycles (e.g. post-integration-test)
+                // won't be executed
+                result.setResult( SurefireBooter.TESTS_FAILED_EXIT_CODE );
+                result.setException( e.getMessage() );
             }
             catch ( SurefireExecutionException e )
             {
-                throw new MojoExecutionException( e.getMessage(), e );
+                // Don't stop processing when timeout or other exception occures
+                // Otherwise, the following life cycles (e.g. post-integration-test)
+                // won't be executed
+                result.setResult( SurefireBooter.TESTS_FAILED_EXIT_CODE );
+                result.setException( e.getMessage() );
             }
 
             if ( originalSystemProperties != null && !surefireBooter.isForking() )



From surefire-commits-returndavid04@example.net Tue Mar 16 17:31:56 2010
Return-Path: <surefire-commits-returndavid04@example.net>
Delivered-To: david04@example.net
Received: (qmail 3695 invoked from network); 16 Mar 2010 17:31:56 -0000
Received: from unknown (HELO mail.apache.org) (83.161.120.155)
  by 83.161.120.155 with SMTP; 16 Mar 2010 17:31:56 -0000
Received: (qmail 41764 invoked by uid 500); 16 Mar 2010 17:31:56 -0000
Delivered-To: david04@example.net
Received: (qmail 41727 invoked by uid 500); 16 Mar 2010 17:31:56 -0000
Mailing-List: contact david04@example.net; run by ezmlm
Precedence: bulk
List-Help: <mailto:david04@example.net>
List-Unsubscribe: <mailto:david04@example.net>
List-Post: <mailto:david04@example.net>
List-Id: <surefire-commits.maven.apache.org>
Reply-To: david04@example.net
Delivered-To: mailing list david04@example.net
Received: (qmail 41720 invoked by uid 99); 16 Mar 2010 17:31:55 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Mar 2010 17:31:55 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Mar 2010 17:31:52 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id C559A238890A; Tue, 16 Mar 2010 17:31:30 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r923888 - in /maven/surefire/trunk:
 maven-failsafe-plugin/src/it/working-directory/
 maven-failsafe-plugin/src/it/working-directory/src/
 maven-failsafe-plugin/src/it/working-directory/src/test/
 maven-failsafe-plugin/src/it/working-directory/...
Date: Tue, 16 Mar 2010 17:31:30 -0000
To: david04@example.net
From: david04@example.net
X-Mailer: svnmailer-1.0.8
Message-Id: <david04@example.net>
X-Virus-Checked: Checked by ClamAV on apache.org

Author: stephenc
Date: Tue Mar 16 17:31:30 2010
New Revision: 923888

URL: http://svn.apache.org/viewvc?rev=923888&view=rev
Log:
SUREFIRE-607 Submitted by Peter Janes

o Updated patch to reflect the move from failsafe-maven-plugin to maven-failsafe-plugin.

o Updated Integration Test in patch to comply with failsafe naming convention

o Ported patch to maven-surefire-plugin

o Added integration test to surefire-integration-tests

Added:
    maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/
    maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/pom.xml   (with props)
    maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/src/
    maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/src/test/
    maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/src/test/java/
    maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/src/test/java/MyIT.java   (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryMissingIT.java   (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/pom.xml   (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/src/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/src/test/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/src/test/java/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/src/test/java/MyTest.java   (with props)
Modified:
    maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
    maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java

Added: maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/pom.xml?rev=923888&view=auto
==============================================================================
--- maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/pom.xml (added)
+++ maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/pom.xml Tue Mar 16 17:31:30 2010
@@ -0,0 +1,57 @@
+<?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>localhost</groupId>
+  <artifactId>working-directory-test</artifactId>
+  <version>1.0</version>
+  <name>Run tests in a nonexistent working directory</name>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.2</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>@project.groupId@</groupId>
+        <artifactId>@project.artifactId@</artifactId>
+        <version>@project.version@</version>
+        <executions>
+          <execution>
+            <id>integration-test</id>
+            <goals>
+              <goal>integration-test</goal>
+            </goals>
+            <configuration>
+              <workingDirectory>${project.build.directory}/failsafe-working-directory</workingDirectory>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Propchange: maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/src/test/java/MyIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/src/test/java/MyIT.java?rev=923888&view=auto
==============================================================================
--- maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/src/test/java/MyIT.java (added)
+++ maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/src/test/java/MyIT.java Tue Mar 16 17:31:30 2010
@@ -0,0 +1,7 @@
+import junit.framework.TestCase;
+
+public class MyIT extends TestCase {
+    public void testSomething() {
+        assertTrue(true);
+    }
+}

Propchange: maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/src/test/java/MyIT.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/surefire/trunk/maven-failsafe-plugin/src/it/working-directory/src/test/java/MyIT.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java?rev=923888&r1=923887&r2=923888&view=diff
==============================================================================
--- maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java (original)
+++ maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java Tue Mar 16 17:31:30 2010
@@ -686,6 +686,19 @@ public class IntegrationTestMojo
             return false;
         }
 
+        if ( !workingDirectory.exists() )
+        {
+            if ( !workingDirectory.mkdirs() )
+            {
+                throw new MojoFailureException( "Cannot create workingDirectory " + workingDirectory );
+            }
+        }
+
+        if ( !workingDirectory.isDirectory() )
+        {
+            throw new MojoFailureException( "workingDirectory " + workingDirectory + " exists and is not a directory" );
+        }
+
         if ( useSystemClassLoader != null && ForkConfiguration.FORK_NEVER.equals( forkMode ) )
         {
             getLog().warn( "useSystemClassloader setting has no effect when not forking" );

Modified: maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java?rev=923888&r1=923887&r2=923888&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java (original)
+++ maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java Tue Mar 16 17:31:30 2010
@@ -650,6 +650,19 @@ public class SurefirePlugin
             return false;
         }
 
+        if ( !workingDirectory.exists() )
+        {
+            if ( !workingDirectory.mkdirs() )
+            {
+                throw new MojoFailureException( "Cannot create workingDirectory " + workingDirectory );
+            }
+        }
+
+        if ( !workingDirectory.isDirectory() )
+        {
+            throw new MojoFailureException( "workingDirectory " + workingDirectory + " exists and is not a directory" );
+        }
+
         if ( useSystemClassLoader != null && ForkConfiguration.FORK_NEVER.equals( forkMode ) )
         {
             getLog().warn( "useSystemClassloader setting has no effect when not forking" );

Added: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryMissingIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryMissingIT.java?rev=923888&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryMissingIT.java (added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryMissingIT.java Tue Mar 16 17:31:30 2010
@@ -0,0 +1,39 @@
+package org.apache.maven.surefire.its;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Properties;
+
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * Test when the configured working directory does not exist, SUREFIRE-607
+ * 
+ * @author <a href="mailto:david04@example.net">Stephen Connolly</a>
+ * 
+ */
+public class WorkingDirectoryMissingIT
+    extends AbstractSurefireIntegrationTestClass
+{
+
+    private File testDir;
+
+    public void setUp()
+        throws IOException
+    {
+        testDir = ResourceExtractor.simpleExtractResources( getClass(), "/working-directory-missing" );
+    }
+
+    public void testWorkingDirectory()
+        throws Exception
+    {
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        this.executeGoal( verifier, "test" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+    }
+
+}

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryMissingIT.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryMissingIT.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/pom.xml?rev=923888&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/pom.xml (added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/pom.xml Tue Mar 16 17:31:30 2010
@@ -0,0 +1,49 @@
+<?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>localhost</groupId>
+  <artifactId>working-directory-test</artifactId>
+  <version>1.0</version>
+  <name>Run tests in a nonexistent working directory</name>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.2</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>${surefire.version}</version>
+        <configuration>
+          <workingDirectory>${project.build.directory}/surefire-working-directory</workingDirectory>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/src/test/java/MyTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/src/test/java/MyTest.java?rev=923888&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/src/test/java/MyTest.java (added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/src/test/java/MyTest.java Tue Mar 16 17:31:30 2010
@@ -0,0 +1,7 @@
+import junit.framework.TestCase;
+
+public class MyTest extends TestCase {
+    public void testSomething() {
+        assertTrue(true);
+    }
+}

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/src/test/java/MyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/working-directory-missing/src/test/java/MyTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain




{'source': 'Apache Software Foundation Public Mail Archives'}