MCPcopy Create free account
hub / github.com/ReadyTalk/avian / makeTestClass

Method makeTestClass

test/Subroutine.java:90–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88 }
89
90 private static Class makeTestClass() throws IOException {
91 List pool = new ArrayList();
92 ByteArrayOutputStream out = new ByteArrayOutputStream();
93 String name = "$SubroutineTest$";
94
95 Assembler.writeClass
96 (out, pool, ConstantPool.addClass(pool, name),
97 ConstantPool.addClass(pool, "java/lang/Object"),
98 new int[0], new MethodData[]
99 { new MethodData(Assembler.ACC_STATIC | Assembler.ACC_PUBLIC,
100 ConstantPool.addUtf8(pool, "test"),
101 ConstantPool.addUtf8(pool, "()V"),
102 makeTestCode(pool)) });
103
104 return new MyClassLoader(Subroutine.class.getClassLoader())
105 .defineClass(name, out.toByteArray());
106 }
107
108 // These tests are intended to cover the jsr and ret instructions.
109 // However, recent Sun javac versions avoid generating these

Callers 1

mainMethod · 0.95

Calls 7

writeClassMethod · 0.95
addClassMethod · 0.95
addUtf8Method · 0.95
makeTestCodeMethod · 0.95
toByteArrayMethod · 0.95
getClassLoaderMethod · 0.80
defineClassMethod · 0.45

Tested by

no test coverage detected