@Test public void testGenerate() throws Exception { final GroupDefinition definition = new GroupDefinition(ID); definition.setX(X); definition.setY(Y); definition.setAlpha(ALPHA); definition.setTransformDefinition(new TransformDefinitionImpl(VBOX_WIDTH, VBOX_HEIGHT, VBOX_MIN_X, VBOX_MIN_Y)); final String generated = tested.generate(definition).toString(); assertTrue(generated.contains("new " + Group.class.getName() + "()")); GeneratorAssertions.assertDraggable(generated); GeneratorAssertions.assertID(generated, ID); GeneratorAssertions.assertX(generated, X); GeneratorAssertions.assertY(generated, Y); GeneratorAssertions.assertAlpha(generated, ALPHA); GeneratorAssertions.assertScale(generated, VBOX_WIDTH, VBOX_HEIGHT); GeneratorAssertions.assertListening(generated, LISTENING); }
@Override public StringBuffer generate(final GroupDefinition input) throws GeneratorException { final StringBuffer wrapped = super.generate(input); final StringBuffer wrapper; try { wrapper = writeTemplate(new HashMap<>()); super.appendDraggable(wrapper, input); super.appendListening(wrapped, input); wrapper.append(formatString(ADD_WRAPPED, wrapped.toString())); } catch (final GenerationException e) { throw new GeneratorException(e); } return wrapper; }
GroupDefinitionGenerator extends AbstractPrimitiveDefinitionGenerator<GroupDefinition> implements PrimitiveDefinitionGenerator<GroupDefinition> { @Override public StringBuffer generate(final GroupDefinition input) throws GeneratorException { final StringBuffer wrapped = super.generate(input); final StringBuffer wrapper; try { wrapper = writeTemplate(new HashMap<>()); super.appendDraggable(wrapper, input); super.appendListening(wrapped, input); wrapper.append(formatString(ADD_WRAPPED, wrapped.toString())); } catch (final GenerationException e) { throw new GeneratorException(e); } return wrapper; } }
GroupDefinitionGenerator extends AbstractPrimitiveDefinitionGenerator<GroupDefinition> implements PrimitiveDefinitionGenerator<GroupDefinition> { @Override public StringBuffer generate(final GroupDefinition input) throws GeneratorException { final StringBuffer wrapped = super.generate(input); final StringBuffer wrapper; try { wrapper = writeTemplate(new HashMap<>()); super.appendDraggable(wrapper, input); super.appendListening(wrapped, input); wrapper.append(formatString(ADD_WRAPPED, wrapped.toString())); } catch (final GenerationException e) { throw new GeneratorException(e); } return wrapper; }  }
GroupDefinitionGenerator extends AbstractPrimitiveDefinitionGenerator<GroupDefinition> implements PrimitiveDefinitionGenerator<GroupDefinition> { @Override public StringBuffer generate(final GroupDefinition input) throws GeneratorException { final StringBuffer wrapped = super.generate(input); final StringBuffer wrapper; try { wrapper = writeTemplate(new HashMap<>()); super.appendDraggable(wrapper, input); super.appendListening(wrapped, input); wrapper.append(formatString(ADD_WRAPPED, wrapped.toString())); } catch (final GenerationException e) { throw new GeneratorException(e); } return wrapper; }  @Override StringBuffer generate(final GroupDefinition input); @Override Class<GroupDefinition> getDefinitionType(); }
GroupDefinitionGenerator extends AbstractPrimitiveDefinitionGenerator<GroupDefinition> implements PrimitiveDefinitionGenerator<GroupDefinition> { @Override public StringBuffer generate(final GroupDefinition input) throws GeneratorException { final StringBuffer wrapped = super.generate(input); final StringBuffer wrapper; try { wrapper = writeTemplate(new HashMap<>()); super.appendDraggable(wrapper, input); super.appendListening(wrapped, input); wrapper.append(formatString(ADD_WRAPPED, wrapped.toString())); } catch (final GenerationException e) { throw new GeneratorException(e); } return wrapper; }  @Override StringBuffer generate(final GroupDefinition input); @Override Class<GroupDefinition> getDefinitionType();  }