Class SignatureTck


public abstract class SignatureTck extends AbstractByteCodeWriterTck
Erasure and generic signatures: descriptors, Signature attributes, type annotations and member flags of generated classes, compared with the classes javac writes from the same declarations.

A backend runs these tests by extending this class and implementing AbstractByteCodeWriterTck.write(io.micronaut.sourcegen.model.ObjectDef).

Since:
2.3
  • Constructor Details

    • SignatureTck

      public SignatureTck()
  • Method Details

    • methodVariableUsesItsDeclaredBound

      @Test public void methodVariableUsesItsDeclaredBound() throws Exception
      Throws:
      Exception
    • methodVariableShadowsClassVariable

      @Test public void methodVariableShadowsClassVariable() throws Exception
      Throws:
      Exception
    • methodVariableArrayUsesChainedBound

      @Test public void methodVariableArrayUsesChainedBound() throws Exception
      Throws:
      Exception
    • classVariableArrayUsesChainedBound

      @Test public void classVariableArrayUsesChainedBound() throws Exception
      Throws:
      Exception
    • explicitObjectFirstIntersectionErasesToObject

      @Test public void explicitObjectFirstIntersectionErasesToObject() throws Exception
      Throws:
      Exception
    • retainsUnusedMethodTypeParameters

      @Test public void retainsUnusedMethodTypeParameters() throws Exception
      Throws:
      Exception
    • retainsGenericExceptionVariable

      @Test public void retainsGenericExceptionVariable() throws Exception
      Throws:
      Exception
    • writesAbstractMethodWithParameters

      @Test public void writesAbstractMethodWithParameters() throws Exception
      Throws:
      Exception
    • genericConstructorUsesItsOwnBound

      @Test public void genericConstructorUsesItsOwnBound() throws Exception
      Throws:
      Exception
    • recursiveClassBoundPreservesSignature

      @Test public void recursiveClassBoundPreservesSignature() throws Exception
      Throws:
      Exception
    • nestedWildcardsAndGenericArraysPreserveSignature

      @Test public void nestedWildcardsAndGenericArraysPreserveSignature() throws Exception
      Throws:
      Exception
    • enumMethodRetainsItsOwnGenericSignatureAndErasedDescriptor

      @Test public void enumMethodRetainsItsOwnGenericSignatureAndErasedDescriptor() throws Exception
      Throws:
      Exception
    • genericSignaturesMatchJavac

      @ParameterizedTest(name="{0} / {1} / {2}") @MethodSource("genericSignatureCases") public void genericSignaturesMatchJavac(Class<?> reference, boolean inline, String part) throws Exception
      Checks metadata and descriptors independently, with name-only and inline-bound references.
      Parameters:
      reference - The fixture javac compiled
      inline - Whether the model writes type variables inline with their bounds rather than by name
      part - The part of the class compared with javac's
      Throws:
      Exception - If the generated class cannot be loaded
    • genericInterfaceSignaturesMatchJavac

      @ParameterizedTest(name="{0} / {1} / {2}") @MethodSource("genericInterfaceCases") public void genericInterfaceSignaturesMatchJavac(Class<?> reference, boolean inline, String part) throws Exception
      Compares abstract interface declarations with javac, including covariant generic redeclarations.
      Parameters:
      reference - The fixture javac compiled
      inline - Whether the model writes type variables inline with their bounds rather than by name
      part - The part of the class compared with javac's
      Throws:
      Exception - If the generated class cannot be loaded
    • annotatedGenericSignaturesMatchJavac

      @ParameterizedTest(name="{0} / {1} / {2}") @MethodSource("annotatedSignatureCases") public void annotatedGenericSignaturesMatchJavac(Class<?> reference, boolean inline, String part) throws Exception
      Checks annotations at every nested type path, as well as ordinary generic metadata.
      Parameters:
      reference - The fixture javac compiled
      inline - Whether the model writes type variables inline with their bounds rather than by name
      part - The part of the class compared with javac's
      Throws:
      Exception - If the generated class cannot be loaded
    • genericRecordSignaturesMatchJavac

      @ParameterizedTest(name="{0} / {1} / {2}") @MethodSource("genericRecordCases") public void genericRecordSignaturesMatchJavac(Class<?> reference, boolean inline, String part) throws Exception
      Checks generic record components and their expanded fields, accessors and constructor.
      Parameters:
      reference - The fixture javac compiled
      inline - Whether the model writes type variables inline with their bounds rather than by name
      part - The part of the class compared with javac's
      Throws:
      Exception - If the generated class cannot be loaded
    • genericSignaturesOfAnEnumMatchJavac

      @Test public void genericSignaturesOfAnEnumMatchJavac() throws Exception
      Throws:
      Exception
    • synchronizedMethodKeepsItsFlag

      @Test public void synchronizedMethodKeepsItsFlag() throws Exception
      Throws:
      Exception
    • volatileAndTransientFieldsKeepTheirFlags

      @Test public void volatileAndTransientFieldsKeepTheirFlags() throws Exception
      Throws:
      Exception