Skip to content

Commit

Permalink
[TEST] expect simpletext CFS format in test
Browse files Browse the repository at this point in the history
  • Loading branch information
s1monw committed Apr 7, 2015
1 parent f1abf0a commit c2f9987
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions src/test/java/org/elasticsearch/common/lucene/LuceneTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,15 @@ public void testFiles() throws IOException {
for (String f : Lucene.files(Lucene.readSegmentInfos(dir))) {
files.add(f);
}

final boolean simpleTextCFS = files.contains("_0.scf");
assertTrue(files.toString(), files.contains("segments_1"));
assertTrue(files.toString(), files.contains("_0.cfs"));
assertTrue(files.toString(), files.contains("_0.cfe"));
if (simpleTextCFS) {
assertFalse(files.toString(), files.contains("_0.cfs"));
assertFalse(files.toString(), files.contains("_0.cfe"));
} else {
assertTrue(files.toString(), files.contains("_0.cfs"));
assertTrue(files.toString(), files.contains("_0.cfe"));
}
assertTrue(files.toString(), files.contains("_0.si"));

doc = new Document();
Expand All @@ -193,12 +198,23 @@ public void testFiles() throws IOException {
}
assertFalse(files.toString(), files.contains("segments_1"));
assertTrue(files.toString(), files.contains("segments_2"));
assertTrue(files.toString(), files.contains("_0.cfs"));
assertTrue(files.toString(), files.contains("_0.cfe"));
if (simpleTextCFS) {
assertFalse(files.toString(), files.contains("_0.cfs"));
assertFalse(files.toString(), files.contains("_0.cfe"));
} else {
assertTrue(files.toString(), files.contains("_0.cfs"));
assertTrue(files.toString(), files.contains("_0.cfe"));
}
assertTrue(files.toString(), files.contains("_0.si"));

assertTrue(files.toString(), files.contains("_1.cfs"));
assertTrue(files.toString(), files.contains("_1.cfe"));

if (simpleTextCFS) {
assertFalse(files.toString(), files.contains("_1.cfs"));
assertFalse(files.toString(), files.contains("_1.cfe"));
} else {
assertTrue(files.toString(), files.contains("_1.cfs"));
assertTrue(files.toString(), files.contains("_1.cfe"));
}
assertTrue(files.toString(), files.contains("_1.si"));
writer.close();
dir.close();
Expand Down

0 comments on commit c2f9987

Please sign in to comment.