Author: krosenvold Date: Thu May 19 20:18:49 2011 New Revision: 1125083 URL: http://svn.apache.org/viewvc?rev=1125083&view=rev Log: o Added integration test for sout/serr in xml file output
Test coverage was missing, as was revealed in discussion in SUREFIRE-704 Added: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkConsoleOutputWithErrorsIT.java (with props) Modified: maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-consoleOutputWithErrors/src/test/java/forkConsoleOutput/Test2.java Added: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkConsoleOutputWithErrorsIT.java URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkConsoleOutputWithErrorsIT.java?rev=1125083&view=auto ============================================================================== --- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkConsoleOutputWithErrorsIT.java (added) +++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkConsoleOutputWithErrorsIT.java Thu May 19 20:18:49 2011 @@ -0,0 +1,49 @@ +package org.apache.maven.surefire.its; +/* + * 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 java.io.File; + +/** + * Asserts proper behaviour of console output when forking + * SUREFIRE-639 + * SUREFIRE-651 + * + * @author Kristian Rosenvold + */ +public class ForkConsoleOutputWithErrorsIT + extends SurefireVerifierTestClass +{ + + public ForkConsoleOutputWithErrorsIT() + { + super( "/fork-consoleOutputWithErrors" ); + } + + public void testXmlFileContainsConsoleOutput() + throws Exception + { + failNever(); + execute( "test" ); + final File surefireReportsFile = getSurefireReportsFile( "TEST-forkConsoleOutput.Test2.xml" ); + assertContainsText( surefireReportsFile, "sout: Will Fail soon" ); + assertContainsText( surefireReportsFile, "serr: Will Fail now" ); + } +} Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkConsoleOutputWithErrorsIT.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-consoleOutputWithErrors/src/test/java/forkConsoleOutput/Test2.java URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-consoleOutputWithErrors/src/test/java/forkConsoleOutput/Test2.java?rev=1125083&r1=1125082&r2=1125083&view=diff ============================================================================== --- maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-consoleOutputWithErrors/src/test/java/forkConsoleOutput/Test2.java (original) +++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-consoleOutputWithErrors/src/test/java/forkConsoleOutput/Test2.java Thu May 19 20:18:49 2011 @@ -19,14 +19,16 @@ package forkConsoleOutput; * under the License. */ -import org.junit.AfterClass; -import org.junit.BeforeClass; 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"); } }