Updated Branches: refs/heads/master 25fb9fd4f -> 06801079f
o IT project for new failure display Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/06801079 Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/06801079 Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/06801079 Branch: refs/heads/master Commit: 06801079f2d609debc7b22dbc4b997e1dd8bca4f Parents: 25fb9fd Author: Kristian Rosenvold <krosenv...@apache.org> Authored: Mon Dec 10 14:51:01 2012 +0100 Committer: Kristian Rosenvold <krosenv...@apache.org> Committed: Mon Dec 10 19:40:22 2012 +0100 ---------------------------------------------------------------------- .../src/test/resources/failureOutput/pom.xml | 56 ++++++++++ .../src/test/java/forkConsoleOutput/Test1.java | 85 +++++++++++++++ .../src/test/java/forkConsoleOutput/Test2.java | 35 ++++++ .../src/test/resources/failureOutput/test | 15 +++ 4 files changed, 191 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/06801079/surefire-integration-tests/src/test/resources/failureOutput/pom.xml ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/resources/failureOutput/pom.xml b/surefire-integration-tests/src/test/resources/failureOutput/pom.xml new file mode 100644 index 0000000..5be8fc4 --- /dev/null +++ b/surefire-integration-tests/src/test/resources/failureOutput/pom.xml @@ -0,0 +1,56 @@ +<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>failureOutput</artifactId> + <packaging>jar</packaging> + <version>1.0-SNAPSHOT</version> + <name>failureOutput</name> + <url>http://maven.apache.org</url> + + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${junit.version}</version> + </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> + <configuration> + <forkMode>${forkMode}</forkMode> + <printSummary>${printSummary}</printSummary> + <useFile>${userFile}</useFile> + <reportFormat>${reportFormat}</reportFormat> + <redirectTestOutputToFile>${redirect.to.file}</redirectTestOutputToFile> + <includes> + <include>**/Test*.java</include> + </includes> + </configuration> + </plugin> + </plugins> + + </build> + + <properties> + <junit.version>4.8.1</junit.version> + <redirect.to.file>true</redirect.to.file> + <forkMode>once</forkMode> + <printSummary>true</printSummary> + <useFile>true</useFile> + <reportFormat>brief</reportFormat> + </properties> + +</project> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/06801079/surefire-integration-tests/src/test/resources/failureOutput/src/test/java/forkConsoleOutput/Test1.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/resources/failureOutput/src/test/java/forkConsoleOutput/Test1.java b/surefire-integration-tests/src/test/resources/failureOutput/src/test/java/forkConsoleOutput/Test1.java new file mode 100644 index 0000000..af92952 --- /dev/null +++ b/surefire-integration-tests/src/test/resources/failureOutput/src/test/java/forkConsoleOutput/Test1.java @@ -0,0 +1,85 @@ +package forkConsoleOutput; + +/* + * 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 org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.io.File; + +public class Test1 +{ + @Test + public void test6281() { + System.out.println( "Test1 on" + Thread.currentThread().getName()); + } + + @Test + public void nullPointerInLibrary() { + new File((String)null); + } + + @Test + public void failInMethod() { + innerFailure(); + } + + @Test + public void failInLibInMethod() { + new File((String)null); + } + + + @Test + public void failInNestedLibInMethod() { + nestedLibFailure(); + } + + @Test + public void assertion1() { + Assert.assertEquals("Bending maths", "123", "312"); + } + + @Test + public void assertion2() { + Assert.assertFalse("True is false", true); + } + + private void innerFailure(){ + throw new NullPointerException("Fail here"); + } + + private void nestedLibFailure(){ + new File((String) null); + } + + @BeforeClass + public static void testWithFailingAssumption2() { + System.out.println( "BeforeTest1 on" + Thread.currentThread().getName()); + } + + @AfterClass + public static void testWithFailingAssumption3() { + System.out.println( "AfterTest1 on" + Thread.currentThread().getName()); + } + +} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/06801079/surefire-integration-tests/src/test/resources/failureOutput/src/test/java/forkConsoleOutput/Test2.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/resources/failureOutput/src/test/java/forkConsoleOutput/Test2.java b/surefire-integration-tests/src/test/resources/failureOutput/src/test/java/forkConsoleOutput/Test2.java new file mode 100644 index 0000000..f5c825e --- /dev/null +++ b/surefire-integration-tests/src/test/resources/failureOutput/src/test/java/forkConsoleOutput/Test2.java @@ -0,0 +1,35 @@ +package forkConsoleOutput; + +/* + * 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 org.junit.Test; + +public class Test2 +{ + @Test + public void test6281() + { + System.out.println( "sout: I am talking to you" ); + System.out.println( "sout: Will Fail soon" ); + System.err.println( "serr: And you too" ); + System.err.println( "serr: Will Fail now" ); + throw new RuntimeException( "FailHere" ); + } +} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/06801079/surefire-integration-tests/src/test/resources/failureOutput/test ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/resources/failureOutput/test b/surefire-integration-tests/src/test/resources/failureOutput/test new file mode 100644 index 0000000..873a7bf --- /dev/null +++ b/surefire-integration-tests/src/test/resources/failureOutput/test @@ -0,0 +1,15 @@ +[INFO] Scanning for projects... +[WARNING] +[WARNING] Some problems were encountered while building the effective model for org.apache.maven.plugins.surefire:failureOutput:jar:1.0-SNAPSHOT +[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 20, column 17 +[WARNING] +[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. +[WARNING] +[WARNING] For this reason, future Maven versions might no longer support building such malformed projects. +[WARNING] +[INFO] +[INFO] ------------------------------------------------------------------------ +[INFO] Building failureOutput 1.0-SNAPSHOT +[INFO] ------------------------------------------------------------------------ +[INFO] +[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ failureOutput ---