From 1421a185a417af58b67c15a88cf30ac00bf7a4e2 Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Fri, 30 Jan 2009 01:26:27 +0000 Subject: [PATCH] remove the snapshot in comparison for tests - this will make them much more readable and we have no need to differentiate git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@739122 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/it/AbstractMavenIntegrationTestCase.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java index 692408b4b6..5ebf110c17 100644 --- a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java +++ b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java @@ -81,7 +81,7 @@ public abstract class AbstractMavenIntegrationTestCase ArtifactVersion version = getMavenVersion(); if ( version != null ) { - skip = !versionRange.containsVersion( version ); + skip = !versionRange.containsVersion( removeSnapshot( version ) ); } else { @@ -129,7 +129,7 @@ public abstract class AbstractMavenIntegrationTestCase ArtifactVersion version = getMavenVersion(); if ( version != null ) { - return versionRange.containsVersion( version ); + return versionRange.containsVersion( removeSnapshot( version ) ); } else { @@ -225,4 +225,14 @@ public abstract class AbstractMavenIntegrationTestCase return localRepo; } + + private static ArtifactVersion removeSnapshot( ArtifactVersion version ) + { + String v = version.toString(); + if ( v.endsWith( "-SNAPSHOT" ) ) + { + return new DefaultArtifactVersion( v.substring( 0, v.length() - 9 ) ); + } + return version; + } }