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);
}
Aggregations