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


Java TestClassFilter类代码示例

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


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

示例1: testInterfaceAudienceAnnotation

import org.apache.hadoop.hbase.ClassTestFinder.TestClassFilter; //导入依赖的package包/类
/**
 * Checks whether all the classes in client and common modules contain
 * {@link InterfaceAudience} annotations.
 */
@Test
public void testInterfaceAudienceAnnotation()
    throws ClassNotFoundException, IOException, LinkageError {

  // find classes that are:
  // In the main jar
  // AND are not in a hadoop-compat module
  // AND are public
  // NOT test classes
  // AND NOT generated classes
  // AND are NOT annotated with InterfaceAudience
  // AND are NOT from Clover rewriting sources
  ClassFinder classFinder = new ClassFinder(
    new And(new MainCodeResourcePathFilter(),
            new TestFileNameFilter()),
    new Not((FileNameFilter)new TestFileNameFilter()),
    new And(new PublicClassFilter(),
            new Not(new TestClassFilter()),
            new Not(new GeneratedClassFilter()),
            new Not(new IsInterfaceStabilityClassFilter()),
            new Not(new InterfaceAudienceAnnotatedClassFilter()),
            new Not(new CloverInstrumentationFilter()))
  );

  Set<Class<?>> classes = classFinder.findClasses(false);

  LOG.info("These are the classes that DO NOT have @InterfaceAudience annotation:");
  for (Class<?> clazz : classes) {
    LOG.info(clazz);
  }

  Assert.assertEquals("All classes should have @InterfaceAudience annotation",
    0, classes.size());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:39,代码来源:TestInterfaceAudienceAnnotations.java

示例2: testInterfaceStabilityAnnotation

import org.apache.hadoop.hbase.ClassTestFinder.TestClassFilter; //导入依赖的package包/类
/**
 * Checks whether all the classes in client and common modules that are marked
 * InterfaceAudience.Public also have {@link InterfaceStability} annotations.
 */
@Test
public void testInterfaceStabilityAnnotation()
    throws ClassNotFoundException, IOException, LinkageError {

  // find classes that are:
  // In the main jar
  // AND are not in a hadoop-compat module
  // AND are public
  // NOT test classes
  // AND NOT generated classes
  // AND are annotated with InterfaceAudience.Public
  // AND NOT annotated with InterfaceStability
  ClassFinder classFinder = new ClassFinder(
    new And(new MainCodeResourcePathFilter(),
            new TestFileNameFilter()),
    new Not((FileNameFilter)new TestFileNameFilter()),
    new And(new PublicClassFilter(),
            new Not(new TestClassFilter()),
            new Not(new GeneratedClassFilter()),
            new InterfaceAudiencePublicAnnotatedClassFilter(),
            new Not(new IsInterfaceStabilityClassFilter()),
            new Not(new InterfaceStabilityAnnotatedClassFilter()))
  );

  Set<Class<?>> classes = classFinder.findClasses(false);

  LOG.info("These are the classes that DO NOT have @InterfaceStability annotation:");
  for (Class<?> clazz : classes) {
    LOG.info(clazz);
  }

  Assert.assertEquals("All classes that are marked with @InterfaceAudience.Public should "
      + "have @InterfaceStability annotation as well",
    0, classes.size());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:40,代码来源:TestInterfaceAudienceAnnotations.java

示例3: testInterfaceAudienceAnnotation

import org.apache.hadoop.hbase.ClassTestFinder.TestClassFilter; //导入依赖的package包/类
/**
 * Checks whether all the classes in client and common modules contain
 * {@link InterfaceAudience} annotations.
 */
@Test
public void testInterfaceAudienceAnnotation()
    throws ClassNotFoundException, IOException, LinkageError {

  // find classes that are:
  // In the main jar
  // AND are public
  // NOT test classes
  // AND NOT generated classes
  // AND are NOT annotated with InterfaceAudience
  ClassFinder classFinder = new ClassFinder(
    new MainCodeResourcePathFilter(),
    new Not((FileNameFilter)new TestFileNameFilter()),
    new And(new PublicClassFilter(),
            new Not(new TestClassFilter()),
            new Not(new GeneratedClassFilter()),
            new Not(new IsInterfaceStabilityClassFilter()),
            new Not(new InterfaceAudienceAnnotatedClassFilter()))
  );

  Set<Class<?>> classes = classFinder.findClasses(false);

  LOG.info("These are the classes that DO NOT have @InterfaceAudience annotation:");
  for (Class<?> clazz : classes) {
    LOG.info(clazz);
  }

  Assert.assertEquals("All classes should have @InterfaceAudience annotation",
    0, classes.size());
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:35,代码来源:TestInterfaceAudienceAnnotations.java

示例4: testInterfaceStabilityAnnotation

import org.apache.hadoop.hbase.ClassTestFinder.TestClassFilter; //导入依赖的package包/类
/**
 * Checks whether all the classes in client and common modules that are marked
 * InterfaceAudience.Public also have {@link InterfaceStability} annotations.
 */
@Test
public void testInterfaceStabilityAnnotation()
    throws ClassNotFoundException, IOException, LinkageError {

  // find classes that are:
  // In the main jar
  // AND are public
  // NOT test classes
  // AND NOT generated classes
  // AND are annotated with InterfaceAudience.Public
  // AND NOT annotated with InterfaceStability
  ClassFinder classFinder = new ClassFinder(
    new MainCodeResourcePathFilter(),
    new Not((FileNameFilter)new TestFileNameFilter()),
    new And(new PublicClassFilter(),
            new Not(new TestClassFilter()),
            new Not(new GeneratedClassFilter()),
            new InterfaceAudiencePublicAnnotatedClassFilter(),
            new Not(new IsInterfaceStabilityClassFilter()),
            new Not(new InterfaceStabilityAnnotatedClassFilter()))
  );

  Set<Class<?>> classes = classFinder.findClasses(false);

  LOG.info("These are the classes that DO NOT have @InterfaceStability annotation:");
  for (Class<?> clazz : classes) {
    LOG.info(clazz);
  }

  Assert.assertEquals("All classes that are marked with @InterfaceAudience.Public should "
      + "have @InterfaceStability annotation as well",
    0, classes.size());
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:38,代码来源:TestInterfaceAudienceAnnotations.java

示例5: testInterfaceAudienceAnnotation

import org.apache.hadoop.hbase.ClassTestFinder.TestClassFilter; //导入依赖的package包/类
/**
 * Checks whether all the classes in client and common modules contain
 * {@link InterfaceAudience} annotations.
 */
@Ignore @Test
public void testInterfaceAudienceAnnotation()
    throws ClassNotFoundException, IOException, LinkageError {

  // find classes that are:
  // In the main jar
  // AND are not in a hadoop-compat module
  // AND are public
  // NOT test classes
  // AND NOT generated classes
  // AND are NOT annotated with InterfaceAudience
  // AND are NOT from Clover rewriting sources
  ClassFinder classFinder = new ClassFinder(
    new And(new MainCodeResourcePathFilter(),
            new TestFileNameFilter()),
    new Not((FileNameFilter)new TestFileNameFilter()),
    new And(new PublicClassFilter(),
            new Not(new TestClassFilter()),
            new Not(new GeneratedClassFilter()),
            new Not(new ShadedProtobufClassFilter()),
            new Not(new IsInterfaceStabilityClassFilter()),
            new Not(new InterfaceAudienceAnnotatedClassFilter()),
            new Not(new CloverInstrumentationFilter()))
  );

  Set<Class<?>> classes = classFinder.findClasses(false);
  if (!classes.isEmpty()) {
    LOG.info("These are the classes that DO NOT have @InterfaceAudience annotation:");
    for (Class<?> clazz : classes) {
      LOG.info(Objects.toString(clazz));
    }
  }

  Assert.assertEquals("All classes should have @InterfaceAudience annotation",
    0, classes.size());
}
 
开发者ID:apache,项目名称:hbase,代码行数:41,代码来源:TestInterfaceAudienceAnnotations.java

示例6: testNoInterfaceStabilityAnnotationForPublicAPI

import org.apache.hadoop.hbase.ClassTestFinder.TestClassFilter; //导入依赖的package包/类
/**
 * Checks whether all the classes in client and common modules that are marked
 * InterfaceAudience.Public do not have {@link InterfaceStability} annotations.
 */
@Ignore @Test
public void testNoInterfaceStabilityAnnotationForPublicAPI()
    throws ClassNotFoundException, IOException, LinkageError {

  // find classes that are:
  // In the main jar
  // AND are not in a hadoop-compat module
  // AND are public
  // NOT test classes
  // AND NOT generated classes
  // AND are annotated with InterfaceAudience.Public
  // AND annotated with InterfaceStability
  ClassFinder classFinder = new ClassFinder(
    new And(new MainCodeResourcePathFilter(),
            new TestFileNameFilter()),
    new Not((FileNameFilter)new TestFileNameFilter()),
    new And(new PublicClassFilter(),
            new Not(new TestClassFilter()),
            new Not(new GeneratedClassFilter()),
            new Not(new ShadedProtobufClassFilter()),
            new InterfaceAudiencePublicAnnotatedClassFilter(),
            new Not(new IsInterfaceStabilityClassFilter()),
            new InterfaceStabilityAnnotatedClassFilter())
  );

  Set<Class<?>> classes = classFinder.findClasses(false);

  if (!classes.isEmpty()) {
    LOG.info("These are the @InterfaceAudience.Public classes that have @InterfaceStability " +
        "annotation:");
    for (Class<?> clazz : classes) {
      LOG.info(Objects.toString(clazz));
    }
  }

  Assert.assertEquals("All classes that are marked with @InterfaceAudience.Public should not "
      + "have @InterfaceStability annotation",
    0, classes.size());
}
 
开发者ID:apache,项目名称:hbase,代码行数:44,代码来源:TestInterfaceAudienceAnnotations.java

示例7: testInterfaceStabilityAnnotationForLimitedAPI

import org.apache.hadoop.hbase.ClassTestFinder.TestClassFilter; //导入依赖的package包/类
/**
 * Checks whether all the classes in client and common modules that are marked
 * InterfaceAudience.Public do not have {@link InterfaceStability} annotations.
 */
@Ignore
@Test
public void testInterfaceStabilityAnnotationForLimitedAPI()
    throws ClassNotFoundException, IOException, LinkageError {

  // find classes that are:
  // In the main jar
  // AND are not in a hadoop-compat module
  // AND are public
  // NOT test classes
  // AND NOT generated classes
  // AND are annotated with InterfaceAudience.LimitedPrivate
  // AND NOT annotated with InterfaceStability
  ClassFinder classFinder = new ClassFinder(
    new And(new MainCodeResourcePathFilter(),
            new TestFileNameFilter()),
    new Not((FileNameFilter)new TestFileNameFilter()),
    new And(new PublicClassFilter(),
            new Not(new TestClassFilter()),
            new Not(new GeneratedClassFilter()),
            new Not(new ShadedProtobufClassFilter()),
            new InterfaceAudienceLimitedPrivateAnnotatedNotConfigClassFilter(),
            new Not(new IsInterfaceStabilityClassFilter()),
            new Not(new InterfaceStabilityAnnotatedClassFilter()))
  );

  Set<Class<?>> classes = classFinder.findClasses(false);

  if (!classes.isEmpty()) {
    LOG.info("These are the @InterfaceAudience.LimitedPrivate classes that DO NOT " +
        "have @InterfaceStability annotation:");
    for (Class<?> clazz : classes) {
      LOG.info(Objects.toString(clazz));
    }
  }
  Assert.assertEquals("All classes that are marked with @InterfaceAudience.LimitedPrivate " +
      "should have @InterfaceStability annotation",
    0, classes.size());
}
 
开发者ID:apache,项目名称:hbase,代码行数:44,代码来源:TestInterfaceAudienceAnnotations.java

示例8: findPublicClasses

import org.apache.hadoop.hbase.ClassTestFinder.TestClassFilter; //导入依赖的package包/类
private Set<Class<?>> findPublicClasses()
    throws ClassNotFoundException, IOException, LinkageError {
  ClassFinder classFinder =
      new ClassFinder(new And(new MainCodeResourcePathFilter(), new TestFileNameFilter()),
          new Not((FileNameFilter) new TestFileNameFilter()),
          new And(new PublicClassFilter(), new Not(new TestClassFilter()),
              new Not(new GeneratedClassFilter()),
              new Not(new ShadedProtobufClassFilter()),
              new InterfaceAudiencePublicAnnotatedClassFilter()));
  Set<Class<?>> classes = classFinder.findClasses(false);
  return classes;
}
 
开发者ID:apache,项目名称:hbase,代码行数:13,代码来源:TestInterfaceAudienceAnnotations.java


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