Search in sources :

Example 1 with BytecodeAccessFlags

use of de.mirkosertic.bytecoder.core.BytecodeAccessFlags in project Bytecoder by mirkosertic.

the class NaiveProgramGeneratorTest method newProgramFrom.

private Program newProgramFrom(BytecodeProgram aProgram, BytecodeMethodSignature aSignature) {
    BytecodeLinkerContext theContext = mock(BytecodeLinkerContext.class);
    ProgramGenerator theGenerator = NaiveProgramGenerator.FACTORY.createFor(theContext);
    BytecodeClass theClass = mock(BytecodeClass.class);
    BytecodeMethod theMethod = mock(BytecodeMethod.class);
    when(theMethod.getAccessFlags()).thenReturn(new BytecodeAccessFlags(0));
    when(theMethod.getSignature()).thenReturn(aSignature);
    BytecodeCodeAttributeInfo theCodeAttribute = mock(BytecodeCodeAttributeInfo.class);
    when(theCodeAttribute.getProgramm()).thenReturn(aProgram);
    when(theMethod.getCode(any())).thenReturn(theCodeAttribute);
    return theGenerator.generateFrom(theClass, theMethod);
}
Also used : BytecodeAccessFlags(de.mirkosertic.bytecoder.core.BytecodeAccessFlags) BytecodeLinkerContext(de.mirkosertic.bytecoder.core.BytecodeLinkerContext) BytecodeMethod(de.mirkosertic.bytecoder.core.BytecodeMethod) BytecodeCodeAttributeInfo(de.mirkosertic.bytecoder.core.BytecodeCodeAttributeInfo) BytecodeClass(de.mirkosertic.bytecoder.core.BytecodeClass)

Aggregations

BytecodeAccessFlags (de.mirkosertic.bytecoder.core.BytecodeAccessFlags)1 BytecodeClass (de.mirkosertic.bytecoder.core.BytecodeClass)1 BytecodeCodeAttributeInfo (de.mirkosertic.bytecoder.core.BytecodeCodeAttributeInfo)1 BytecodeLinkerContext (de.mirkosertic.bytecoder.core.BytecodeLinkerContext)1 BytecodeMethod (de.mirkosertic.bytecoder.core.BytecodeMethod)1