EventStubGenerator { public GeneratedClass getEventizer() { ClassBuilder cb = new ClassBuilder(myEventizerName(), eventizerPackage); addGeneratedAnnotation(cb); cb.implement(eventizerInterface); cb.imports.addPackageImport(stubsPackage); String listenerType = cb.imports.getSimpleName(listenerInterface); String senderType = cb.imports.getSimpleName(senderInterface); cb.addMethod("" + " @Override\n" + " public Class<" + listenerType + "> getType() {\n" + " return " + listenerType + ".class;\n" + " }\n"); cb.addMethod("" + " @Override\n" + " public " + listenerType + " newFrontend(" + senderType + " target) {\n" + " return new " + myFrontendName() + "(target);\n" + " }\n"); cb.addMethod("" + " @Override\n" + " public " + senderType + " newBackend(" + listenerType + " target) {\n" + " return new " + myBackendName() + "(target);\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_eventizer_class() { assertClassEquals("fi.jumi.actors.generator.reference.DummyListenerEventizer", generator.getEventizer()); }