From 2d71e8843ca984e15c19d127d896e933dc994566 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 11 Mar 2013 02:42:46 +0000 Subject: [PATCH] add test git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1454978 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/org/apache/lucene/util/TestVersion.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lucene/core/src/test/org/apache/lucene/util/TestVersion.java b/lucene/core/src/test/org/apache/lucene/util/TestVersion.java index 6afc52d67d1..2a62fca5e37 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestVersion.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestVersion.java @@ -32,4 +32,13 @@ public class TestVersion extends LuceneTestCase { assertEquals(Version.LUCENE_40, Version.parseLeniently("LUCENE_40")); assertEquals(Version.LUCENE_CURRENT, Version.parseLeniently("LUCENE_CURRENT")); } + + public void testDeprecations() throws Exception { + Version values[] = Version.values(); + // all but the latest version should be deprecated + for (int i = 0; i < values.length-2; i++) { + assertTrue(values[i].name() + " should be deprecated", + Version.class.getField(values[i].name()).isAnnotationPresent(Deprecated.class)); + } + } }