Class StubAnnotationValuesTest

java.lang.Object
org.checkerframework.framework.stub.StubAnnotationValuesTest

public class StubAnnotationValuesTest extends Object
Tests that every form of annotation element value that Java permits (JLS 9.7.1) -- constant expressions (JLS 15.29), constants named in all the ways Java scopes them, text blocks, and nested annotations -- has the same value in a stub file as in Java source, whether the stub file is text-parsed (AnnotationFileParser) or read from its binary form (BinaryStubReader).

Each stub method's return type carries a Value Checker annotation whose value is such an expression, and the checked source assigns the method's result to a variable annotated with the same expression, written in Java, so that javac computes the expected value. A wrong or missing value is an assignment.type.incompatible error. The binary form is also compared with the text by -AbinaryStubDiffCheck.

  • Field Details

    • tempFolder

      public final org.junit.rules.TemporaryFolder tempFolder
      A fresh directory per test.
  • Constructor Details

    • StubAnnotationValuesTest

      public StubAnnotationValuesTest()
  • Method Details

    • constantExpressionValuesMatchJava

      public void constantExpressionValuesMatchJava() throws IOException
      Every value form has the value javac gives it, through the text parser and through the binary form, and the two forms agree.
      Throws:
      IOException