本文整理汇总了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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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;
}