lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: svn commit: r1455179 - /lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestVersion.java
Date Mon, 11 Mar 2013 16:00:44 GMT
:-)

Sorry for heavy committing, I removed the stupid extra import in a second commit :-)

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Robert Muir [mailto:rcmuir@gmail.com]
> Sent: Monday, March 11, 2013 4:27 PM
> To: dev@lucene.apache.org
> Subject: Re: svn commit: r1455179 -
> /lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestVersio
> n.java
> 
> thanks Uwe!
> 
> On Mon, Mar 11, 2013 at 11:24 AM,  <uschindler@apache.org> wrote:
> > Author: uschindler
> > Date: Mon Mar 11 15:24:18 2013
> > New Revision: 1455179
> >
> > URL: http://svn.apache.org/r1455179
> > Log:
> > Improve test for deprecated Version enum constants
> >
> > Modified:
> >
> > lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestVersi
> > on.java
> >
> > Modified:
> > lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestVersi
> > on.java
> > URL:
> > http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org
> >
> /apache/lucene/util/TestVersion.java?rev=1455179&r1=1455178&r2=145517
> 9
> > &view=diff
> >
> ==========================================================
> ============
> > ========
> > ---
> > lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestVersi
> > on.java (original)
> > +++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/TestV
> > +++ ersion.java Mon Mar 11 15:24:18 2013
> > @@ -17,6 +17,8 @@
> >
> >  package org.apache.lucene.util;
> >
> > +import java.lang.annotation.Annotation;
> > +
> >  public class TestVersion extends LuceneTestCase {
> >
> >    public void test() {
> > @@ -36,9 +38,17 @@ public class TestVersion extends LuceneT
> >    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++) {
> > -      assertNotNull(values[i].name() + " should be deprecated",
> > -
> Version.class.getField(values[i].name()).getAnnotation(Deprecated.class));
> > +    for (int i = 0; i < values.length; i++) {
> > +      if (i + 1 == values.length) {
> > +        assertSame("Last constant must be LUCENE_CURRENT",
> Version.LUCENE_CURRENT, values[i]);
> > +      }
> > +      // TODO: Use isAnnotationPresent once bug in Java 8 is fixed (LUCENE-
> 4808)
> > +      final Annotation ann =
> Version.class.getField(values[i].name()).getAnnotation(Deprecated.class);
> > +      if (i + 2 != values.length) {
> > +        assertNotNull(values[i].name() + " should be deprecated", ann);
> > +      } else {
> > +        assertNull(values[i].name() + " should not be deprecated", ann);
> > +      }
> >      }
> >    }
> >  }
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional
> commands, e-mail: dev-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message