Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2019-03-28 10:10:00 +0000
committerAlexander Kurtakov2019-04-10 15:40:49 +0000
commitd4fc6564f0361d8d51e42fbbd5d27c926a4320cd (patch)
treec3273dca2dc447bdf4f617490e9920b0b665d8b6 /org.eclipse.ua.tests/help
parente6dc7152006510d01785e8c4cd1d879e42d0afd5 (diff)
downloadeclipse.platform.ua-d4fc6564f0361d8d51e42fbbd5d27c926a4320cd.tar.gz
eclipse.platform.ua-d4fc6564f0361d8d51e42fbbd5d27c926a4320cd.tar.xz
eclipse.platform.ua-d4fc6564f0361d8d51e42fbbd5d27c926a4320cd.zip
Change-Id: I2d4135cf79d60bb503677c44c27ff4b26be242df Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.ua.tests/help')
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java28
1 files changed, 20 insertions, 8 deletions
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java
index f3301db93..94b828a3f 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2016 IBM Corporation and others.
+ * Copyright (c) 2011, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -86,7 +86,7 @@ public class PrebuiltIndexCompatibility {
/**
* Test index built with Lucene 6.1.0
*/
- @Test(expected = IllegalArgumentException.class)
+ @Test(expected = IndexFormatTooOldException.class)
public void test6_1_0_IndexUnReadable() throws Exception {
checkReadable("data/help/searchindex/index610");
}
@@ -94,12 +94,20 @@ public class PrebuiltIndexCompatibility {
/**
* Test index built with Lucene 7.0.0
*/
- @Test
- public void test7_0_0_IndexReadable() throws Exception {
+ @Test(expected = IndexFormatTooOldException.class)
+ public void test7_0_0_IndexUnReadable() throws Exception {
checkReadable("data/help/searchindex/index700");
}
/**
+ * Test index built with Lucene 8.0.0
+ */
+ @Test
+ public void test8_0_0_IndexReadable() throws Exception {
+ checkReadable("data/help/searchindex/index800");
+ }
+
+ /**
** Test compatibility of Lucene 1.9.1 index with current Lucene
*/
@Test
@@ -138,7 +146,7 @@ public class PrebuiltIndexCompatibility {
*/
@Test
public void test7_0_0Compatible() {
- checkCompatible("data/help/searchindex/index700", true);
+ checkCompatible("data/help/searchindex/index700", false);
}
@Test
@@ -171,7 +179,12 @@ public class PrebuiltIndexCompatibility {
@Test
public void test7_0_0LuceneCompatible() {
- checkLuceneCompatible("7.0.0", true);
+ checkLuceneCompatible("7.0.0", false);
+ }
+
+ @Test
+ public void test8_0_0LuceneCompatible() {
+ checkLuceneCompatible("8.0.0", true);
}
@Test
@@ -227,7 +240,7 @@ public class PrebuiltIndexCompatibility {
try (Directory luceneDirectory = new NIOFSDirectory(new File(filePath).toPath())) {
searcher = new IndexSearcher(DirectoryReader.open(luceneDirectory));
TopDocs hits = searcher.search(luceneQuery, 500);
- assertTrue(hits.totalHits >= 1);
+ assertTrue(hits.totalHits.value >= 1);
}
} else {
fail("Cannot resolve to file protocol");
@@ -263,5 +276,4 @@ public class PrebuiltIndexCompatibility {
index);
assertEquals(expected, index.isLuceneCompatible(version));
}
-
}

Back to the top