Author: krosenvold Date: Wed Nov 16 20:00:14 2011 New Revision: 1202865 URL: http://svn.apache.org/viewvc?rev=1202865&view=rev Log: [SUREFIRE-787] Added a (..) to truncated exception messages
Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/ maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/pom.xml (with props) maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/src/ maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/src/test/ maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/src/test/java/ maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/src/test/java/failingbuilds/ maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/src/test/java/failingbuilds/ExceptionsTest.java (with props) Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/RunStatistics.java Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/RunStatistics.java URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/RunStatistics.java?rev=1202865&r1=1202864&r2=1202865&view=diff ============================================================================== --- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/RunStatistics.java (original) +++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/RunStatistics.java Wed Nov 16 20:00:14 2011 @@ -85,7 +85,7 @@ public class RunStatistics private String trimToSingleLine( String str ) { int i = str.indexOf( "\n" ); - return i >= 0 ? str.substring( 0, i ) : str; + return i >= 0 ? str.substring( 0, i ) + "(..)" : str; } Collection getListOfSources() Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/pom.xml URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/pom.xml?rev=1202865&view=auto ============================================================================== --- maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/pom.xml (added) +++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/pom.xml Wed Nov 16 20:00:14 2011 @@ -0,0 +1,46 @@ +<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.surefire</groupId> + <artifactId>failingBuilds-test</artifactId> + <packaging>jar</packaging> + <version>1.0-SNAPSHOT</version> + <name>failingBuilds</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> + <includes> + <include>**/*Test.java</include> + <include>**/MySuiteTest1.java</include> + <include>**/MySuiteTest2.java</include> + <include>**/MySuiteTest3.java</include> + </includes> + </configuration> + </plugin> + </plugins> + </build> + <properties> + <junit.version>4.8.1</junit.version> + <forkMode>once</forkMode> + </properties> +</project> Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/src/test/java/failingbuilds/ExceptionsTest.java URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/src/test/java/failingbuilds/ExceptionsTest.java?rev=1202865&view=auto ============================================================================== --- maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/src/test/java/failingbuilds/ExceptionsTest.java (added) +++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/src/test/java/failingbuilds/ExceptionsTest.java Wed Nov 16 20:00:14 2011 @@ -0,0 +1,19 @@ +package failingbuilds; + +import org.junit.Test; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.hamcrest.CoreMatchers.*; +import static org.junit.Assume.*; + +import junit.framework.TestCase; + +public class ExceptionsTest + extends TestCase +{ + public void testWithMultiLineExceptionBeingThrown() + { + throw new RuntimeException( "A very very long exception message indeed, which is to demonstrate truncation. It will be truncated somewhere\nA cat\nAnd a dog\nTried to make a\nParrot swim" ); + } +} \ No newline at end of file Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/failingBuilds/src/test/java/failingbuilds/ExceptionsTest.java ------------------------------------------------------------------------------ svn:eol-style = native