Class StatisticsTest
java.lang.Object
org.checkerframework.common.util.count.StatisticsTest
Tests for
AnnotationStatistics and JavaCodeStatistics.
Regression test for issue #2089: AnnotationStatistics crashed with a NullPointerException in SourceChecker.setRoot because treePathCacher was null,
and JavaCodeStatistics failed to instantiate because TreeUtils.getMethod was
called at field initialization time before processingEnv was initialized.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTests runningAnnotationStatisticson annotated code.voidTests runningAnnotationStatisticson unannotated code.voidTests runningJavaCodeStatisticson Java code.
-
Constructor Details
-
StatisticsTest
public StatisticsTest()
-
-
Method Details
-
testAnnotationStatisticsOnUnannotatedCode
public void testAnnotationStatisticsOnUnannotatedCode()Tests runningAnnotationStatisticson unannotated code.Regression test for issue #2089: verifies that running
AnnotationStatisticson classes without annotations succeeds without throwing aNullPointerException. -
testAnnotationStatisticsCountsAnnotations
public void testAnnotationStatisticsCountsAnnotations()Tests runningAnnotationStatisticson annotated code.Verifies that
AnnotationStatisticscorrectly counts occurrences of annotations on classes and fields. -
testJavaCodeStatistics
public void testJavaCodeStatistics()Tests runningJavaCodeStatisticson Java code.Regression test for issue #2089: verifies that
JavaCodeStatisticsinstantiates and counts code constructs without failing during initialization.
-