@Test public void testGetEngine() throws Exception { final VelocityEngine engine = mock(VelocityEngine.class); whenNew(VelocityEngine.class).withNoArguments().thenReturn(engine); final ConcreteGenerator generator = new ConcreteGenerator(); assertThat(generator.getEngine()).isEqualTo(engine); verify(engine).setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath"); verify(engine).setProperty("classpath.resource.loader.class", ClassResourceLoader.class.getName()); verify(engine).setProperty("runtime.log.logsystem.class", NullLogChute.class.getCanonicalName()); verify(engine).init(); }
protected VelocityEngine getEngine() throws MavenReportException { final VelocityEngine engine = new VelocityEngine(); engine.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath"); engine.setProperty("classpath.resource.loader.class", ClassResourceLoader.class.getName()); engine.setProperty("runtime.log.logsystem.class", NullLogChute.class.getCanonicalName()); try { engine.init(); } catch (final Exception e) { throw new MavenReportException("Failed to initialize Velocity engine.", e); } return engine; }
AbstractVelocityGenerator { protected VelocityEngine getEngine() throws MavenReportException { final VelocityEngine engine = new VelocityEngine(); engine.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath"); engine.setProperty("classpath.resource.loader.class", ClassResourceLoader.class.getName()); engine.setProperty("runtime.log.logsystem.class", NullLogChute.class.getCanonicalName()); try { engine.init(); } catch (final Exception e) { throw new MavenReportException("Failed to initialize Velocity engine.", e); } return engine; } }
AbstractVelocityGenerator { protected VelocityEngine getEngine() throws MavenReportException { final VelocityEngine engine = new VelocityEngine(); engine.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath"); engine.setProperty("classpath.resource.loader.class", ClassResourceLoader.class.getName()); engine.setProperty("runtime.log.logsystem.class", NullLogChute.class.getCanonicalName()); try { engine.init(); } catch (final Exception e) { throw new MavenReportException("Failed to initialize Velocity engine.", e); } return engine; }  }
AbstractVelocityGenerator { protected VelocityEngine getEngine() throws MavenReportException { final VelocityEngine engine = new VelocityEngine(); engine.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath"); engine.setProperty("classpath.resource.loader.class", ClassResourceLoader.class.getName()); engine.setProperty("runtime.log.logsystem.class", NullLogChute.class.getCanonicalName()); try { engine.init(); } catch (final Exception e) { throw new MavenReportException("Failed to initialize Velocity engine.", e); } return engine; }   }
AbstractVelocityGenerator { protected VelocityEngine getEngine() throws MavenReportException { final VelocityEngine engine = new VelocityEngine(); engine.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath"); engine.setProperty("classpath.resource.loader.class", ClassResourceLoader.class.getName()); engine.setProperty("runtime.log.logsystem.class", NullLogChute.class.getCanonicalName()); try { engine.init(); } catch (final Exception e) { throw new MavenReportException("Failed to initialize Velocity engine.", e); } return engine; }    }