test: use one IndexSetting instance

Original commit: elastic/x-pack-elasticsearch@1f35455ebe
This commit is contained in:
Martijn van Groningen 2015-11-11 00:05:44 +07:00
parent 101e4ff7ce
commit 46044a4fe0
1 changed files with 4 additions and 5 deletions

View File

@ -48,14 +48,13 @@ public class FieldDataCacheWithFieldSubsetReaderTests extends ESTestCase {
@Before
public void setup() throws Exception {
Index index = new Index("_name");
Settings settings = Settings.EMPTY;
IndexSettings indexSettings = createIndexSettings();
CircuitBreakerService circuitBreakerService = new NoneCircuitBreakerService();
MappedFieldType.Names names = new MappedFieldType.Names("_field");
FieldDataType fieldDataType = new StringFieldMapper.StringFieldType().fieldDataType();
indexFieldDataCache = new DummyAccountingFieldDataCache();
sortedSetDVOrdinalsIndexFieldData = new SortedSetDVOrdinalsIndexFieldData(createIndexSettings(),indexFieldDataCache, names, circuitBreakerService, fieldDataType);
pagedBytesIndexFieldData = new PagedBytesIndexFieldData(createIndexSettings(), names, fieldDataType, indexFieldDataCache, circuitBreakerService);
sortedSetDVOrdinalsIndexFieldData = new SortedSetDVOrdinalsIndexFieldData(indexSettings,indexFieldDataCache, names, circuitBreakerService, fieldDataType);
pagedBytesIndexFieldData = new PagedBytesIndexFieldData(indexSettings, names, fieldDataType, indexFieldDataCache, circuitBreakerService);
dir = newDirectory();
IndexWriterConfig iwc = new IndexWriterConfig(null);
@ -73,7 +72,7 @@ public class FieldDataCacheWithFieldSubsetReaderTests extends ESTestCase {
}
}
iw.close();
ir = ElasticsearchDirectoryReader.wrap(DirectoryReader.open(dir), new ShardId(index, 0));
ir = ElasticsearchDirectoryReader.wrap(DirectoryReader.open(dir), new ShardId(indexSettings.getIndex(), 0));
}
@After