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