Class BinaryStubClasspathTest

java.lang.Object
org.checkerframework.checker.test.junit.BinaryStubClasspathTest

public class BinaryStubClasspathTest extends Object
Guards against build-wiring rot for the generated .astub.bin.gz resources, for a checker built-in stub (the framework-level counterpart is org.checkerframework.framework.stub.BinaryStubClasspathTest in the framework subproject).

The binary stub files are produced by the generateBinaryStubFiles Gradle task and wired into processResources/sourcesJar via explicit dependsOn hooks, because the idiomatic sourceSets.main.resources.srcDir(taskProvider) wiring does not register the producer dependency on this project's Gradle version: with that wiring, processResources goes UP-TO-DATE without ever scheduling generateBinaryStubFiles, and the built jars silently ship without any .astub.bin.gz resources. See commit 278a3e3b for the revert and the evidence. If that dependsOn wiring ever rots the same way, the binaries vanish from the classpath again, and the reader silently falls back to text parsing with no diagnostic. This test makes that failure loud by asserting that a known checker built-in binary stub is present on the classpath, at the exact resource path the framework's AnnotationFileElementTypes.parseOneStubFile looks up (relative to the checker class' own package, since parseOneStubFile is also called with checker.getClass()).

  • Constructor Details

    • BinaryStubClasspathTest

      public BinaryStubClasspathTest()
  • Method Details

    • nullnessBuiltinStubBinaryIsOnClasspath

      public void nullnessBuiltinStubBinaryIsOnClasspath()
      Asserts that the binary form of the nullness checker's built-in jdk11.astub is present on the classpath.