Repository: maven-integration-testing Updated Branches: refs/heads/MNG-3507 [created] 47e463085
[MNG-3507] added color to ITs run tracking Project: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/commit/47e46308 Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/47e46308 Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/47e46308 Branch: refs/heads/MNG-3507 Commit: 47e463085885b728ab7d6c32b2acb4e41e658f4d Parents: 6c86dc6 Author: Hervé Boutemy <hbout...@apache.org> Authored: Sun Jun 5 11:44:56 2016 +0200 Committer: Hervé Boutemy <hbout...@apache.org> Committed: Tue Jan 24 23:39:21 2017 +0100 ---------------------------------------------------------------------- core-it-support/maven-it-helper/pom.xml | 5 ++++ .../it/AbstractMavenIntegrationTestCase.java | 26 ++++++++++++-------- pom.xml | 2 +- 3 files changed, 22 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/47e46308/core-it-support/maven-it-helper/pom.xml ---------------------------------------------------------------------- diff --git a/core-it-support/maven-it-helper/pom.xml b/core-it-support/maven-it-helper/pom.xml index 4bafebc..da9c352 100644 --- a/core-it-support/maven-it-helper/pom.xml +++ b/core-it-support/maven-it-helper/pom.xml @@ -60,5 +60,10 @@ under the License. <artifactId>junit</artifactId> <version>3.8.2</version> </dependency> + <dependency> + <groupId>org.fusesource.jansi</groupId> + <artifactId>jansi</artifactId> + <version>1.12</version> + </dependency> </dependencies> </project> http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/47e46308/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java ---------------------------------------------------------------------- diff --git a/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java b/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java index 8966dce..6628a66 100644 --- a/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java +++ b/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java @@ -26,6 +26,8 @@ import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.shared.utils.io.FileUtils; +import static org.fusesource.jansi.Ansi.ansi; + import java.io.File; import java.io.IOException; import java.io.PrintStream; @@ -97,8 +99,8 @@ public abstract class AbstractMavenIntegrationTestCase } else { - out.println( "WARNING: " + getITName() + ": version range '" + versionRange - + "' supplied but no Maven version - not skipping test." ); + out.println( ansi().bold().fgYellow().a( "WARNING: " ).reset() + getITName() + ": version range '" + + versionRange + "' supplied but no Maven version - not skipping test." ); } } @@ -201,10 +203,12 @@ public abstract class AbstractMavenIntegrationTestCase String line = getTestName(); out.print( line ); out.print( pad( RESULT_COLUMN - line.length() ) ); + out.print( ' ' ); if ( skip ) { - out.println( "SKIPPED - Maven version " + getMavenVersion() + " not in range " + versionRange ); + out.println( ansi().bold().fgYellow().a( "SKIPPED" ).reset() + " - Maven version " + getMavenVersion() + + " not in range " + versionRange ); return; } @@ -218,22 +222,24 @@ public abstract class AbstractMavenIntegrationTestCase { super.runTest(); milliseconds = System.currentTimeMillis() - milliseconds; - out.println( "OK " + formatTime( milliseconds ) ); + out.println( ansi().bold().fgGreen().a( "OK " ).reset() + formatTime( milliseconds ) ); } catch ( UnsupportedJavaVersionException e ) { - out.println( "SKIPPED - Java version " + e.javaVersion + " not in range " + e.supportedRange ); + out.println( ansi().bold().fgYellow().a( "SKIPPED" ).reset() + " - Java version " + e.javaVersion + + " not in range " + e.supportedRange ); return; } catch ( UnsupportedMavenVersionException e ) { - out.println( "SKIPPED - Maven version " + e.mavenVersion + " not in range " + e.supportedRange ); + out.println( ansi().bold().fgYellow().a( "SKIPPED" ).reset() + " - Maven version " + e.mavenVersion + + " not in range " + e.supportedRange ); return; } catch ( Throwable t ) { milliseconds = System.currentTimeMillis() - milliseconds; - out.println( "FAILURE " + formatTime( milliseconds ) ); + out.println( ansi().bold().fgRed().a( "FAILURE " ).reset() + formatTime( milliseconds ) ); throw t; } } @@ -295,8 +301,8 @@ public abstract class AbstractMavenIntegrationTestCase } else { - out.println( "WARNING: " + getITName() + ": version range '" + versionRange - + "' supplied but no Maven version found - not skipping test." ); + out.println( ansi().bold().fgYellow().a( "WARNING: " ).reset() + getITName() + ": version range '" + + versionRange + "' supplied but no Maven version found - not skipping test." ); } } @@ -352,7 +358,7 @@ public abstract class AbstractMavenIntegrationTestCase { methodName = methodName.substring( 4 ); } - return className + '(' + methodName + ')'; + return className + '(' + ansi().bold().a( methodName ).reset() + ')'; } private String pad( int chars ) http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/47e46308/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index af8b16e..31e6104 100644 --- a/pom.xml +++ b/pom.xml @@ -77,7 +77,7 @@ under the License. <dependency> <groupId>org.apache.maven.shared</groupId> <artifactId>maven-verifier</artifactId> - <version>1.6</version> + <version>1.7-SNAPSHOT</version><!-- waiting release for MSHARED-547 --> </dependency> </dependencies> </dependencyManagement>