public void testClassGen() {
final List<Class<?>> classes = new ArrayList<Class<?>>();
classes.add(java.lang.Runnable.class);
classes.add(java.lang.Appendable.class);
ContextFactory cf = ContextFactory.getGlobal();
cf.call(new ContextAction() {
public Object run(Context cx) {
Class<?> c1 = EventAdapter.getAdapterClass(classes.toArray(), null);
Class<?> c2 = EventAdapter.getAdapterClass(classes.toArray(), null);
assertTrue(c1.getSuperclass() == Object.class);
assertTrue(Runnable.class.isAssignableFrom(c1));
assertTrue(Appendable.class.isAssignableFrom(c1));
assertEquals(c1, c2);
return null;
}
});
cf.call(new ContextAction() {
public Object run(Context cx) {
Map<String,String> bindings = new HashMap<String,String>();
bindings.put("append", "add");
bindings.put("run", "run");
Class<?> c1 = EventAdapter.getAdapterClass(classes.toArray(),