From d58e179f627a7f7c2f39030d689c6bb589888cb8 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Wed, 28 Aug 2013 20:20:18 +0000 Subject: [PATCH] LUCENE-5190: Fix failure of TestCheckIndex.testLuceneConstantVersion in Jenkins trunk clover build and other builds using -Ddev.version.suffix git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1518354 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/org/apache/lucene/index/TestCheckIndex.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCheckIndex.java b/lucene/core/src/test/org/apache/lucene/index/TestCheckIndex.java index cd33794142d..66542ab0b49 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestCheckIndex.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestCheckIndex.java @@ -117,8 +117,10 @@ public class TestCheckIndex extends LuceneTestCase { public void testLuceneConstantVersion() throws IOException { // common-build.xml sets lucene.version - final String version = System.getProperty("lucene.version"); + String version = System.getProperty("lucene.version"); assertNotNull( "null version", version); + // remove anything after a "-" from the version string: + version = version.replaceAll("-.*$", ""); final String constantVersion; String parts[] = Constants.LUCENE_MAIN_VERSION.split("\\."); if (parts.length == 4) { @@ -130,7 +132,6 @@ public class TestCheckIndex extends LuceneTestCase { constantVersion = Constants.LUCENE_MAIN_VERSION; } assertTrue("Invalid version: "+version, - version.equals(constantVersion+"-SNAPSHOT") || version.equals(constantVersion)); assertTrue(Constants.LUCENE_VERSION + " should start with: "+version, Constants.LUCENE_VERSION.startsWith(version));