Add ok/failure status per test

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@497221 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Kenney Westerhof 2007-01-17 22:51:00 +00:00
parent 91c7b75a11
commit 89543f6644

View File

@ -1,26 +1,36 @@
package org.apache.maven.integrationtests;
import java.io.PrintStream;
import junit.framework.TestCase;
/**
* @author Jason van Zyl
* @author Kenney Westerhof
*/
public abstract class AbstractMavenIntegrationTestCase
extends TestCase
{
private boolean printed = false;
protected void setUp()
throws Exception
protected void runTest()
throws Throwable
{
if ( !printed )
{
String simpleName = getClass().getName();
simpleName = simpleName.startsWith( "MavenIT" ) ? simpleName.substring( "MavenIT".length() ) : simpleName;
simpleName = simpleName.endsWith( "Test" ) ? simpleName.substring(0, simpleName.length() -4 ) : simpleName;
String simpleName = getClass().getSimpleName();
simpleName = simpleName.startsWith( "MavenIT" ) ? simpleName.substring( "MavenIT".length() ) : simpleName;
simpleName = simpleName.endsWith( "Test" ) ? simpleName.substring( 0, simpleName.length() - 4 ) : simpleName;
System.out.println( simpleName + ".." );
printed = true;
PrintStream out = System.out;
out.print( simpleName + ".." );
try
{
super.runTest();
out.println( " Ok" );
}
catch ( Throwable t )
{
out.println( " Failure" );
throw t;
}
}
}