当前位置: 首页>>代码示例>>Java>>正文


Java LRUCache类代码示例

本文整理汇总了Java中org.apache.solr.search.LRUCache的典型用法代码示例。如果您正苦于以下问题:Java LRUCache类的具体用法?Java LRUCache怎么用?Java LRUCache使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LRUCache类属于org.apache.solr.search包,在下文中一共展示了LRUCache类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testCallMBeanInfo

import org.apache.solr.search.LRUCache; //导入依赖的package包/类
/**
 * Gets a list of everything we can find in the classpath and makes sure it has
 * a name, description, etc...
 */
public void testCallMBeanInfo() throws Exception {
  List<Class> classes = new ArrayList<>();
  classes.addAll(getClassesForPackage(StandardRequestHandler.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(SearchHandler.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(SearchComponent.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(LukeRequestHandler.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(DefaultSolrHighlighter.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(LRUCache.class.getPackage().getName()));
 // System.out.println(classes);
  
  int checked = 0;
  for( Class clazz : classes ) {
    if( SolrInfoMBean.class.isAssignableFrom( clazz ) ) {
      try {
        SolrInfoMBean info = (SolrInfoMBean)clazz.newInstance();
        
        //System.out.println( info.getClass() );
        assertNotNull( info.getName() );
        assertNotNull( info.getDescription() );
        assertNotNull( info.getCategory() );
        
        if( info instanceof LRUCache ) {
          continue;
        }
        
        assertNotNull( info.toString() );
        // increase code coverage...
        assertNotNull( info.getDocs() + "" );
        assertNotNull( info.getStatistics()+"" );
        checked++;
      }
      catch( InstantiationException ex ) {
        // expected...
        //System.out.println( "unable to initalize: "+clazz );
      }
    }
  }
  assertTrue( "there are at least 10 SolrInfoMBean that should be found in the classpath, found " + checked, checked > 10 );
}
 
开发者ID:europeana,项目名称:search,代码行数:44,代码来源:SolrInfoMBeanTest.java

示例2: testCallMBeanInfo

import org.apache.solr.search.LRUCache; //导入依赖的package包/类
/**
 * Gets a list of everything we can find in the classpath and makes sure it has
 * a name, description, etc...
 */
public void testCallMBeanInfo() throws Exception {
  List<Class> classes = new ArrayList<Class>();
  classes.addAll(getClassesForPackage(StandardRequestHandler.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(SearchHandler.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(SearchComponent.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(LukeRequestHandler.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(DefaultSolrHighlighter.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(LRUCache.class.getPackage().getName()));
 // System.out.println(classes);
  
  int checked = 0;
  for( Class clazz : classes ) {
    if( SolrInfoMBean.class.isAssignableFrom( clazz ) ) {
      try {
        SolrInfoMBean info = (SolrInfoMBean)clazz.newInstance();
        
        //System.out.println( info.getClass() );
        assertNotNull( info.getName() );
        assertNotNull( info.getDescription() );
        assertNotNull( info.getSource() );
        assertNotNull( info.getCategory() );
        
        // Make sure the URL has the classname in it
        //assertTrue(info.getSource(), info.getSource().indexOf(info.getClass().getSimpleName()+".java")>0 );

        if( info instanceof LRUCache ) {
          continue;
        }
        
        assertNotNull( info.toString() );
        // increase code coverage...
        assertNotNull( info.getDocs() + "" );
        assertNotNull( info.getStatistics()+"" );
        checked++;
      }
      catch( InstantiationException ex ) {
        // expected...
        //System.out.println( "unable to initalize: "+clazz );
      }
    }
  }
  assertTrue( "there are at least 10 SolrInfoMBean that should be found in the classpath, found " + checked, checked > 10 );
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:48,代码来源:SolrInfoMBeanTest.java


注:本文中的org.apache.solr.search.LRUCache类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。