LUCENE-2493 -- fix test case

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1000720 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan McKinley 2010-09-24 06:09:45 +00:00
parent 852419b026
commit b20a4b7097
2 changed files with 7 additions and 5 deletions

View File

@ -77,9 +77,9 @@ public final class Constants {
Package pkg = LucenePackage.get();
String v = (pkg == null) ? null : pkg.getImplementationVersion();
if (v == null) {
v = LUCENE_MAIN_VERSION + "-dev";
v = LUCENE_MAIN_VERSION + "-SNAPSHOT";
} else if (!v.startsWith(LUCENE_MAIN_VERSION)) {
v = LUCENE_MAIN_VERSION + "-dev " + v;
v = LUCENE_MAIN_VERSION + "-SNAPSHOT " + v;
}
LUCENE_VERSION = ident(v);
}

View File

@ -93,9 +93,11 @@ public class TestCheckIndex extends LuceneTestCase {
public void testLuceneConstantVersion() throws IOException {
// common-build.xml sets lucene.version
final String version = System.getProperty("lucene.version");
assertNotNull(version);
assertTrue(version.equals(Constants.LUCENE_MAIN_VERSION+"-dev") ||
assertNotNull( "null version", version);
assertTrue("Invalid version: "+version,
version.equals(Constants.LUCENE_MAIN_VERSION+"-SNAPSHOT") ||
version.equals(Constants.LUCENE_MAIN_VERSION));
assertTrue(Constants.LUCENE_VERSION.startsWith(version));
assertTrue(version + " should start with: "+Constants.LUCENE_VERSION,
Constants.LUCENE_VERSION.startsWith(version));
}
}