Allow TestCompiler to load cglib generated classes
Update `TestCompiler` so that it can now load cglib generated classes. This commit adds support to `DynamicJavaFileManager` so that it can reference generated classes and adds a new lookup function to `CompileWithTargetClassAccessClassLoader` to that it can load the bytecode of generated classes directly. See gh-29141 Co-authored-by: Phillip Webb <pwebb@vmware.com>
This commit is contained in:
committed by
Phillip Webb
parent
5277b1dbf0
commit
7168141504
@@ -101,8 +101,8 @@ class DynamicJavaFileManagerTests {
|
||||
Kind.CLASS, null);
|
||||
this.fileManager.getJavaFileForOutput(this.location, "com.example.MyClass2",
|
||||
Kind.CLASS, null);
|
||||
assertThat(this.fileManager.getClassFiles().stream().map(ClassFile::getName))
|
||||
.contains("com.example.MyClass1", "com.example.MyClass2");
|
||||
assertThat(this.fileManager.getCompiledClasses()).containsKeys(
|
||||
"com.example.MyClass1", "com.example.MyClass2");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user