You are viewing a plain text version of this content. The canonical link for it is here.
Posted to surefire-commits@maven.apache.org by kr...@apache.org on 2010/12/21 23:38:45 UTC

svn commit: r1051688 - in /maven/surefire/trunk/surefire-integration-tests/src/test: java/org/apache/maven/surefire/its/Surefire674BuildFailingWhenErrorsIT.java resources/surefire-673-mockito/pom.xml

Author: krosenvold
Date: Tue Dec 21 22:38:45 2010
New Revision: 1051688

URL: http://svn.apache.org/viewvc?rev=1051688&view=rev
Log:
o Improved IT

Modified:
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire674BuildFailingWhenErrorsIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/pom.xml

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire674BuildFailingWhenErrorsIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire674BuildFailingWhenErrorsIT.java?rev=1051688&r1=1051687&r2=1051688&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire674BuildFailingWhenErrorsIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire674BuildFailingWhenErrorsIT.java Tue Dec 21 22:38:45 2010
@@ -19,12 +19,11 @@ package org.apache.maven.surefire.its;
  */
 
 
+import org.apache.maven.it.VerificationException;
 import org.apache.maven.it.Verifier;
 import org.apache.maven.it.util.ResourceExtractor;
 
 import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
 
 /**
  * SUREFIRE-674 Asserts that the build fails when tests have errors
@@ -39,10 +38,16 @@ public class Surefire674BuildFailingWhen
     {
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/surefire-674-buildFailingWhenErrors" );
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        String[] opts = { "-fn" };
-        verifier.setCliOptions( new ArrayList( Arrays.asList( opts ) ) );
-        this.executeGoal( verifier, "test" );
+        try
+        {
+            this.executeGoal( verifier, "test" );
+        }
+        catch ( VerificationException ignore )
+        {
+            // We're supposed to fail and verifier does not allow us to ignore it. Maybe not the most convincing
+            // os solutions
+        }
         verifier.resetStreams();
-        verifier.verifyTextInLog(  "BUILD FAILURE");
+        verifier.verifyTextInLog( "BUILD FAILURE" );
     }
 }
\ No newline at end of file

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/pom.xml?rev=1051688&r1=1051687&r2=1051688&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/pom.xml (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/pom.xml Tue Dec 21 22:38:45 2010
@@ -1,31 +1,40 @@
-<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.surefire</groupId>
-	<artifactId>MockitoTest</artifactId>
-	<name>surefire-673-mockito</name>
-	<version>1.0.0-SNAPSHOT</version>
+<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.surefire</groupId>
+  <artifactId>MockitoTest</artifactId>
+  <name>surefire-673-mockito</name>
+  <version>1.0.0-SNAPSHOT</version>
 
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-surefire-plugin</artifactId>
-				<version>${surefire.version}</version>
-			</plugin>
-		</plugins>
-	</build>
-	<dependencies>
-		<dependency>
-			<groupId>junit</groupId>
-			<artifactId>junit</artifactId>
-			<version>4.8.2</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.mockito</groupId>
-			<artifactId>mockito-core</artifactId>
-			<version>1.8.5</version>
-			<scope>test</scope>
-		</dependency>
-	</dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>${surefire.version}</version>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.8.2</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <version>1.8.5</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
 </project>