@@ -0,0 +1,2098 @@
+/*%0A * Licensed to ElasticSearch and Shay Banon under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership. ElasticSearch licenses this%0A * file to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A * with the License.  You may obtain a copy of the License at%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied.  See the License for the%0A * specific language governing permissions and limitations%0A * under the License.%0A */%0Apackage org.elasticsearch.test.unit.common.lucene;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.core.IsEqual.equalTo;%0A%0Aimport org.apache.lucene.util.Version;%0Aimport org.elasticsearch.common.logging.ESLogger;%0Aimport org.elasticsearch.common.logging.ESLoggerFactory;%0Aimport org.elasticsearch.common.lucene.Lucene;%0Aimport org.testng.annotations.Test;%0A%0A/**%0A * %0A */%0Apublic class LuceneTest %7B%0A%0A%0A    /*%0A     * simple test that ensures that we bumb the version on Upgrade%0A     */%0A    @Test%0A    public void testVersion() %7B%0A        ESLogger logger = ESLoggerFactory.getLogger(LuceneTest.class.getName());%0A        Version%5B%5D values = Version.values();%0A        assertThat(Version.LUCENE_CURRENT, equalTo(values%5Bvalues.length-1%5D));%0A        assertThat(%22Latest Lucene Version is not set after upgrade%22, Lucene.VERSION, equalTo(values%5Bvalues.length-2%5D));%0A        assertThat(Lucene.parseVersion(null, Lucene.VERSION, null), equalTo(Lucene.VERSION));%0A        for (int i = 0; i %3C values.length-1; i++) %7B%0A            // this should fail if the lucene version is not mapped as a string in Lucene.java%0A            assertThat(Lucene.parseVersion(values%5Bi%5D.name().replaceFirst(%22%5ELUCENE_(%5C%5Cd)(%5C%5Cd)$%22, %22$1.$2%22), Version.LUCENE_CURRENT, logger), equalTo(values%5Bi%5D));%0A        %7D%0A    %7D%0A%7D%0A

add test that ensures that we bumb the version on a Lucene Upgrade