EventStubGenerator { public GeneratedClass getFrontend() { JavaVar target = JavaVar.of(senderInterface, "target"); ClassBuilder cb = new ClassBuilder(myFrontendName(), stubsPackage); addGeneratedAnnotation(cb); cb.implement(listenerInterface); cb.fieldsAndConstructorParameters(Arrays.asList(target)); for (JavaMethod method : listenerMethods) { cb.addMethod("" + " @Override\n" + " public void " + method.getName() + "(" + JavaVar.toFormalArguments(method.getArguments(), cb.imports) + ") {\n" + " " + target.getName() + ".send(new " + myEventWrapperName(method) + "(" + JavaVar.toActualArguments(method.getArguments()) + "));\n" + " }\n"); } return cb.build(); } EventStubGenerator(TypeElement listenerType, String targetPackage); void setGeneratorName(String generatorName); void setGenerationDate(Date generationDate); List<GeneratedClass> getGeneratedClasses(); GeneratedClass getEventizer(); GeneratedClass getFrontend(); GeneratedClass getBackend(); List<GeneratedClass> getEvents();  }
@Test public void generates_frontend_class() { assertClassEquals("fi.jumi.actors.generator.reference.dummyListener.DummyListenerToEvent", generator.getFrontend()); }
@Ignore @Test public void supports_methods_inherited_from_parent_interfaces() { generator = newEventStubGenerator(ChildInterface.class); GeneratedClass frontend = generator.getFrontend(); assertThat(frontend.source, containsString("void methodInChild()")); assertThat(frontend.source, containsString("void methodInParent()")); }