1   package org.apache.maven.surefire.its;
2   
3   
4   import junit.framework.TestCase;
5   
6   import org.apache.maven.it.VerificationException;
7   import org.apache.maven.it.Verifier;
8   import org.apache.maven.it.util.ResourceExtractor;
9   
10  import java.io.File;
11  
12  /**
13   * Test for checking that the output from a forked suite is properly captured even if the suite encounters a severe error.
14   * 
15   * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
16   * 
17   */
18  public class TestNgExecuteErrorTest
19      extends TestCase
20  {
21      public void testExecuteError()
22          throws Exception
23      {
24          File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/testng-execute-error" );
25  
26          Verifier verifier = new Verifier( testDir.getAbsolutePath() );
27          try {
28              verifier.executeGoal( "test" );
29          } catch (VerificationException e) {} // expected 
30          verifier.resetStreams();
31          assertTrue( new File( testDir, "target/surefire-reports/TestSuite-output.txt" ).length() > 0 );
32      }
33  }