提交 85fbafb2 authored 作者: Thomas Mueller's avatar Thomas Mueller

assertThrows

上级 c2678bb4
......@@ -1355,7 +1355,7 @@ public abstract class TestBase {
}
};
Class<?>[] interfaces = c.getInterfaces();
if (Modifier.isFinal(c.getModifiers()) || interfaces.length > 0) {
if (Modifier.isFinal(c.getModifiers()) || (interfaces.length > 0 && getClass() != c)) {
// interface class proxies
if (interfaces.length == 0) {
throw new RuntimeException("Can not create a proxy for the class " +
......
......@@ -36,6 +36,9 @@ public class ProxyCodeGenerator {
if (p != null) {
return p;
}
// TODO how to extend a class with private constructor
// TODO call right constructor
// TODO use the right package
ProxyCodeGenerator cg = new ProxyCodeGenerator();
cg.setPackageName("bytecode");
cg.generateClassProxy(c);
......@@ -44,6 +47,7 @@ public class ProxyCodeGenerator {
String code = sw.toString();
String proxy = "bytecode."+ c.getSimpleName() + "Proxy";
compiler.setSource(proxy, code);
// System.out.println(code);
Class<?> px = compiler.getClass(proxy);
proxyMap.put(c, px);
return px;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论