项目:search
文件:TestIndexWriterCon
fig.java
@Test
public void testReuse() throws Exception {
Directory dir = newDirectory();
// test that IWC cannot be reused across two IWs
IndexWriterConfig conf = newIndexWriterConfig(null);
new RandomIndexWriter(random(),dir,conf).close();
// this should fail
try {
assertNotNull(new RandomIndexWriter(random(),conf));
fail("should have hit AlreadySetException");
} catch (AlreadySetException e) {
// expected
}
dir.close();
}
项目:elasticsearch_my
文件:IndexModuleTests.java
public void testForceCustomQueryCache() throws IOException {
Settings indexSettings = Settings.builder()
.put(Environment.PATH_HOME_SETTING.getKey(),createTempDir().toString())
.put(IndexMetaData.SETTING_VERSION_CREATED,Version.CURRENT).build();
IndexModule module = new IndexModule(IndexSettingsModule.newIndexSettings("foo",indexSettings),new AnalysisRegistry(environment,emptyMap(),emptyMap()));
module.forceQueryCacheProvider((a,b) -> new CustomQueryCache());
expectThrows(AlreadySetException.class,() -> module.forceQueryCacheProvider((a,b) -> new CustomQueryCache()));
IndexService indexService = newIndexService(module);
assertTrue(indexService.cache().query() instanceof CustomQueryCache);
indexService.close("simon says",false);
}
项目:search
文件:TestS
etonce.java
@Test(expected=AlreadySetException.class)
public void testSetonce() throws Exception {
Setonce<Integer> set = new Setonce<>();
set.set(new Integer(5));
assertEquals(5,set.get().intValue());
set.set(new Integer(7));
}
项目:NYBC
文件:TestS
etonce.java
@Test(expected=AlreadySetException.class)
public void testSetonce() throws Exception {
Setonce<Integer> set = new Setonce<Integer>();
set.set(new Integer(5));
assertEquals(5,set.get().intValue());
set.set(new Integer(7));
}
项目:Maskana-Gestor-de-Conocimiento
文件:TestS
etonce.java
@Test(expected=AlreadySetException.class)
public void testSetonce() throws Exception {
Setonce<Integer> set = new Setonce<Integer>();
set.set(new Integer(5));
assertEquals(5,set.get().intValue());
set.set(new Integer(7));
}
项目:search
文件:TestS
etonce.java
@Test(expected=AlreadySetException.class)
public void testSettingCtor() throws Exception {
Setonce<Integer> set = new Setonce<>(new Integer(5));
assertEquals(5,set.get().intValue());
set.set(new Integer(7));
}
项目:NYBC
文件:TestS
etonce.java
@Test(expected=AlreadySetException.class)
public void testSettingCtor() throws Exception {
Setonce<Integer> set = new Setonce<Integer>(new Integer(5));
assertEquals(5,set.get().intValue());
set.set(new Integer(7));
}
项目:Maskana-Gestor-de-Conocimiento
文件:TestS
etonce.java
@Test(expected=AlreadySetException.class)
public void testSettingCtor() throws Exception {
Setonce<Integer> set = new Setonce<Integer>(new Integer(5));
assertEquals(5,set.get().intValue());
set.set(new Integer(7));
}