Search in sources :

Example 1 with FreeMarkerService

use of org.isisaddons.module.freemarker.dom.service.FreeMarkerService in project estatio by estatio.

the class DocFragments_for_Invoicing_Test method setUp.

@Before
public void setUp() throws Exception {
    clockService = new ClockService();
    fake = new FakeDataService();
    ReflectUtils.inject(fake, clockService);
    fake.init();
    freeMarkerService = new FreeMarkerService();
    ReflectUtils.inject(freeMarkerService, "configurationService", mockConfigurationService);
    final ImmutableMap<String, String> props = ImmutableMap.of();
    freeMarkerService.init(props);
    templateName = "Template name";
}
Also used : FakeDataService(org.isisaddons.module.fakedata.dom.FakeDataService) FreeMarkerService(org.isisaddons.module.freemarker.dom.service.FreeMarkerService) ClockService(org.apache.isis.applib.services.clock.ClockService) Before(org.junit.Before)

Example 2 with FreeMarkerService

use of org.isisaddons.module.freemarker.dom.service.FreeMarkerService in project estatio by estatio.

the class DocumentTypeAndTemplatesFSForInvoicesUsingSsrs_Test method rendererForFreemarker.

private RendererForFreemarker rendererForFreemarker() throws NoSuchFieldException, IllegalAccessException {
    final FreeMarkerService freeMarkerService = new FreeMarkerService();
    final Field configurationServiceField = FreeMarkerService.class.getDeclaredField("configurationService");
    configurationServiceField.setAccessible(true);
    configurationServiceField.set(freeMarkerService, mockConfigurationService);
    freeMarkerService.init(ImmutableMap.of());
    final RendererForFreemarker renderer = new RendererForFreemarker();
    final Field freeMarkerServiceField = RendererForFreemarker.class.getDeclaredField("freeMarkerService");
    freeMarkerServiceField.setAccessible(true);
    freeMarkerServiceField.set(renderer, freeMarkerService);
    return renderer;
}
Also used : Field(java.lang.reflect.Field) FreeMarkerService(org.isisaddons.module.freemarker.dom.service.FreeMarkerService) RendererForFreemarker(org.incode.module.docrendering.freemarker.dom.impl.RendererForFreemarker)

Aggregations

FreeMarkerService (org.isisaddons.module.freemarker.dom.service.FreeMarkerService)2 Field (java.lang.reflect.Field)1 ClockService (org.apache.isis.applib.services.clock.ClockService)1 RendererForFreemarker (org.incode.module.docrendering.freemarker.dom.impl.RendererForFreemarker)1 FakeDataService (org.isisaddons.module.fakedata.dom.FakeDataService)1 Before (org.junit.Before)1