Class ByteCodeWriterTck
java.lang.Object
io.micronaut.sourcegen.bytecode.tck.ByteCodeWriterTck
The behaviour every bytecode backend must provide, asserted through the classes a backend writes
rather than through the bytecode it emits, so that the same tests hold for any backend.
A backend runs the TCK by extending this class and implementing write(ObjectDef).
Assertions about a particular backend's encoding, such as the exact instructions it selects or
the fallbacks it offers, belong in that backend's own tests.
- Since:
- 2.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final Class<?> Loads a definition written bywrite(ObjectDef).voidvoidprotected abstract byte[]Writes one definition to class file bytes with the backend under test.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoid
-
Constructor Details
-
ByteCodeWriterTck
public ByteCodeWriterTck()
-
-
Method Details
-
write
Writes one definition to class file bytes with the backend under test.An implementation should assert whatever its backend guarantees about how the bytes were produced, such as verifying them or refusing a fallback path, so that a backend cannot pass the TCK by quietly declining to write the definition itself.
- Parameters:
definition- The definition to write- Returns:
- The class file bytes
-
define
Loads a definition written bywrite(ObjectDef).- Parameters:
definition- The definition to write and load- Returns:
- The loaded class
- Throws:
ClassNotFoundException- If the class cannot be loaded
-
writesEveryIntegerMathOperationAndWidePrimitiveOperations
-
writesAllComparisonsForIntegralAndFloatingPointValues
-
writesCastsBoxingNullChecksEqualityInstanceOfAndArrays
-
writesWhileLoopsAndFinallyOnReturnAndThrow
-
writesReflectedGenericBridgeAndGenericSignatures
-
invokesMethodsThroughInterfaceBoundTypeVariables
-
verifiesHierarchyFromGeneratedModelDefinitions
-
writesReferencesToAMemberTypeByItsBinaryName
-
writesEmptyWideGenericAndBridgedRecords
-
writesExplicitSuperConstructorsAndObjectCreation
-
writesBooleanCompositionConditionalExpressionsAndArraySizes
-
writesCatchVariablesThrowsAndDeclarationMetadata
-
writesGenericRecordSignaturesAndRecordsWithAnAdditionalConstructor
-
writesSuperCallsAndSuperConstructorDelegation
-
writesDefaultMethodCallsOnAnInterfaceReceiverWithInvokeInterface
-
writesArrayConstantsAndMultiDimensionalArrays
-
writesVoidMethodsThatReturnAnExpression
-
writesConstructorsWhoseSuperCallUsesAnEarlierLocal
-
writesSwitchesSharingOneBodyAcrossManyKeys
-
writesNestedCastsWithoutUnboxingAndReboxingAReference
-
writesBoxedConstantsSmallPrimitivesAndPrimitiveHashCodes
-
writesInterfacesWithAbstractDefaultAndStaticMethods
-
writesEnums
-
writesTryWhoseCatchCompletesInsideAnIfBranch
-
writesConstructorDelegationWithoutRepeatingFieldInitializers
-